Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Note

On the OpenMRS Design Forum 2018-10-03 (meeting notes: https://notes.openmrs.org/2018-10-03-Design-Forum) we decided (together with OpenMRS community) synchronize this object via REST because mapping via FHIR is too complex.

Introduction

Note that information about OpenMRS programs is placed here.

FHIR Mapping

On this page are placed suggestion on how to map OpenMRS classes:

OpenMRS class

FHIR class

This is a suggestion on how to map OpenMRS Form object into FHIR Questionnaire.

...

PatientStateEpisodeOfCare
PatientProgramReferralRequest
ProgramPlanDefinition
ProgramWorkflowCarePlan
ProgramWorkflowStateReferralRequest


Keyword extension means that FHIR Extension has to be used to synchronize this field.
Fields which partially match into FHIR representation are marked on orange.

OpenMRS class

...

PatientState. FHIR

...

class EpisodeOfCare.

OpenMRS classOpenMRS fieldDB
field
columnFHIR fieldDetails
Form

PatientState

formId

patientStateId : Integer

form

patient_state_id : INT

identifier : IdentifierCan be put as one of the identifiersBaseOpenmrsMetadataname : Stringname : TEXTname : stringMatches wellFormversion : Stringversion : TEXTversion : stringMatches wellFormbuild : Integerbuild : INTextensionFormpublished : Booleanpublished : INTapprovalDate : dateAssume that published = (approvalDate != null)xslt : ?Absent in OpenMRS core objecttemplate : ?Absent in OpenMRS core objectBaseOpenmrsMetadatadescription : Stringdescription : TEXTdescription : markdownMatches wellFormencounterType : EncounterTypeencounter_type : INTextensionTo be put into extension. Only encounterTypeId will be synchronizedFormformFields : Set<FormField>Many to one relationitem : BackboneElementSee FormField object mapping for detailsBaseOpenmrsMetadataBaseOpenmrsMetadata

-

Instead of database id is used the UUID.

PatientStatepatientProgram : PatientProgrampatient_program_id : INTreferralRequest : Reference(ReferralRequest)

PatientState

state : ProgramWorkflowState

state : INT

referralRequest : Reference(ReferralRequest)


PatientState

startDate : Date

start_date : DATE

period : Period

Used start date from the Period object.

PatientState

endDate : Date

end_date : DATE

period : Period

Used end date from the Period object.

BaseOpenmrsData

creator : User

creator : INT

publisher : stringFHIR expects text representation of the user's name in this field. OpenMRS uses id of the user
extension

BaseOpenmrsData

dateCreated : Date

date_created : DATETIME

extension
BaseOpenmrsMetadata

BaseOpenmrsData

changedBy : User

changed_by : INT

extension
BaseOpenmrsMetadata

BaseOpenmrsData

dateChanged : Date

date_changed : DATETIME

date : dateTimeMatches wellBaseOpenmrsMetadataretired
extension

BaseOpenmrsData

voided : Boolean

retired

voided :

INTBaseOpenmrsMetadataretiredBy : Userretired_by : INTextensionBaseOpenmrsMetadatadateRetired : Userdate_retired : DATETIMEextensionBaseOpenmrsMetadataretireReason : Stringretired_reason : TEXT

TINYINT

status : code
(draft | active | retired | unknown)

FHIR status field can be set to "retired"
extension

BaseOpenmrsData

dateVoided : Date

date_voided : DATETIME

extension

BaseOpenmrsData

voidedBy : User

voided_by : INT

extension

BaseOpenmrsData

voidedReason : String

void_reason : VARCHAR(255)

extension

BaseOpenmrsObject

uuid : String

uuid :

TEXT

CHAR(38)

identifier : Identifier

Can be put as one of the identifiers



OpenMRS

...

class PatientProgram. FHIR

...

class ReferralRequest.


OpenMRS classOpenMRS fieldDB
field
columnFHIR fieldDetails
Field

PatientProgram

fieldId

patientProgramId : Integer

field

patient_program_id : INT

extensionBaseOpenmrsMetadataname : Stringname : TEXTtext : stringMatches wellBaseOpenmrsMetadatadescription : Stringdescription : TEXTextensionFieldfieldType : FieldTypefield_type : INT

type : code
(group | display | boolean | decimal | integer | date | dateTime +
QuestionnaireItemType)

FHIR code is required. FHIR type is not designed to hold Id of field_type.Fieldconcept : Conceptconcept_id : INTextensionOnly Id of the concept will be synchronized. Whole Concepts will be synchronized separately.FieldtableName: Stringtable_name : TEXTextensionFieldattributeName : Stringattribute_name : TEXTextensionFielddefaultValue : Stringdefault_value : INTinitialString : stringFieldselectMultiple : Booleanselect_multiple : INTextensionFieldanswers : Set<FieldAnswer>Many to one relation.enableWhen : BackboneElementSee FieldAnswer object mapping.FormFieldformFieldId : Integerform_field_id : INTlinkId : stringRequired by FHIR.FormFieldform : Formform_id : INTCan be deduced from JSON structure.FormFieldfield : Fieldfield_id : INTextensionFormFieldfieldNumber : Integerfield_number : INTextensionFormFieldfieldPart : Stringfield_part : INTextensionFormFieldpageNumber : Integerpage_number : INTextensionFormFieldparent : FormFieldparent_form_field : INTextensionField Id will be synced.FormFieldminOccurs : Integermin_occurs : INTextensionFormFieldmaxOccurs : Integermax_occurs : INTextensionFormFieldrequired : Booleanrequired : INTrequired : booleanFormFieldsortWeight : Floatsort_weight : INTextensionFormFieldfield : Fieldfield_id : INTextensionField Id will be synced

-

Instead of database id is used the UUID.

PatientProgram

patient : Patient

patient_id : INT

subject : Reference(Patient)


PatientProgram

program : Program

program_id : INT

definition : Reference(PlanDefinition)


PatientProgram

location : Location

location_id : INT

supportingInfo : Reference(Any)


PatientProgram

dateEnrolled : Date

date_enrolled : DATETIME

occurrencePeriod : Period

Used start date from the Period object.

PatientProgram

dateCompleted : Date

date_completed : DATETIME

occurrencePeriod : Period

Used end date from the Period object.

PatientProgram

outcome : Concept

outcome_concept_id : INT

reasonCode : CodeableConcept


PatientProgram

states : Set<PatientState>

Many to one relation

-

In the PatientState is the reference to PatientProgram.

BaseOpenmrsData

creator : User

creator : INT

extension

BaseOpenmrsData

dateCreated : Date

date_created : DATETIME

authoredOn : dateTime

BaseOpenmrsData

changedBy : User

changed_by : INT

extension

BaseOpenmrsData

dateChanged : Date

date_changed : DATETIME

extension

BaseOpenmrsData

voided : Boolean

voided : TINYINT

extension

BaseOpenmrsData

dateVoided : Date

date_voided : DATETIME

extension

BaseOpenmrsData

voidedBy : User

voided_by : INT

extension

BaseOpenmrsData

voidedReason : String

void_reason : VARCHAR(255)

extension

BaseOpenmrsObject

uuid : String

uuid : CHAR(38)

idenfifier : Identifier



OpenMRS class Program. FHIR class PlanDefinition.


OpenMRS classOpenMRS fieldDB columnFHIR fieldDetails

Program

programId : Integer

program_id : INT

-

Instead of database id is used the UUID.

Program

concept : Concept

concept_id : INT

goal.description : CodeableConcept


Program

outcomesConcept : Concept

Outcomes_concept_id : INT

goal.target.detailCodeableConcept : CodeableConcept


Program

allWorkflows : Set<ProgramWorkflow>

Many to one relation

-

In the PatientProgram is the reference to Program.


BaseOpenmrsMetadata

name : String

name : VARCHAR(50)

name : string


BaseOpenmrsMetadata

description : String

description : TEXT

description : markdown


BaseOpenmrsMetadata

creator : User

creator : INT

extension

BaseOpenmrsMetadata

dateCreated : Date

date_created : DATETIME

extension

BaseOpenmrsMetadata

changedBy : User

changed_by : INT

extension

BaseOpenmrsMetadata

dateChanged : Date

date_changed : DATETIME

date : dateTime

BaseOpenmrsMetadata

retired : Boolean

retired : TINYINT

extension

BaseOpenmrsObject

uuid : String

uuid : CHAR(38)

idenfifier : Identifier



OpenMRS class ProgramWorkflow. FHIR class CarePlan.


OpenMRS classOpenMRS fieldDB columnFHIR fieldDetails

ProgramWorkflow

programWorkflowId : Integer

program_workflow_id : INT

-

Instead of database id is used the UUID.

ProgramWorkflow

program : Program

program_id : INT

definition : Reference(PlanDefinition)


ProgramWorkflow

concept : Concept

concept_id : INT

category : CodeableConcept


ProgramWorkflow

states : Set<ProgramWorkflowState>

Many to one relation

-

In the ProgramWorkflowState is the referance to ProgramWorkflow.


BaseOpenmrsMetadata

creator : User

creator : INT

extension
User Id will be synced.

BaseOpenmrsMetadata

dateCreated : Date

date_created : DATETIME

extension

BaseOpenmrsMetadata

changedBy : User

changed_by : INT

extension
User Id will be synced.

BaseOpenmrsMetadata

dateChanged : Date

date_changed : DATETIME

extension

BaseOpenmrsMetadata

retired : Boolean

retired :

INT

TINYINT

extension
BaseOpenmrsMetadata

BaseOpenmrsObject

retiredBy

uuid :

User

String

retired_by : TEXTextensionUser Id will be synced.BaseOpenmrsMetadatadateRetired : Userdate_retired : DATETIMEextensionUser Id will be synced.BaseOpenmrsMetadataretireReason : Stringretire_reason : TEXTextensionBaseOpenmrsObjectuuid : Stringuuid : TEXTextension

OpenMRS class FieldAnswer.

OpenMRS classOpenMRS fieldDB fieldFHIR fieldDetailsFieldAnswer

uuid : CHAR(38)

idenfifier : Identifier




OpenMRS class ProgramWorkflowState. FHIR class ReferralRequest.


OpenMRS classOpenMRS fieldDB columnFHIR fieldDetails

ProgramWorkflowState

programWorkflowStateId : Integer

program_workflow_state_id : INT

-

Instead of database id is used the UUID.

ProgramWorkflowState

programWorkflow : ProgramWorkflow

program_workflow_id : INT

basedOn : Reference(CarePlan)


ProgramWorkflowState

concept : Concept

concept_id : INT

reasonCode : CodeableConcept


ProgramWorkflowState

initial : Boolean

initial : TINYINT

extension

Other solutions:

  1. using the status field

  2. using the note field

ProgramWorkflowState

terminal : Boolean

terminal : TINYINT

extension

Other solutions:

  1. using the status field

  2. using the note field

BaseOpenmrsMetadata

creator : User

creator : INT

extension

BaseOpenmrsMetadata

dateCreated : Date

date_created : DATETIME

extension
FieldAnswer

BaseOpenmrsMetadata

concept

changedBy :

Concept

User

answer

changed_

id

by : INT

answerCoding : Coding
extension
FieldAnswer

BaseOpenmrsMetadata

creator

dateChanged :

User

Date

creator

date_changed :

INT

DATETIME

extension
FieldAnswer

BaseOpenmrsMetadata

field

retired :

Field

Boolean

field_id

retired :

INTCan be deduced from JSON structure.FieldAnswerdirty : booleanNot saved to db.

TINYINT

extension

BaseOpenmrsObject

uuid : String

uuid :

TEXTextension

CHAR(38)

idenfifier : Identifier