refs/refs/fhir-to-omop-demo/data/convert/mapping/010-DiagnosticReport-note.sh
lines 119–124
128 lines · sh
3# Converts FHIR DiagnosticReport resources to OMOPCDM note records. 7REPO="https://github.com/barabo/fhir-to-omop-demo" 8FILE="data/convert/mapping/010-DiagnosticReport-note.sh" 11#--------------------------#-----------------------------#-------------------# 12# FHIR DiagnosticReport # OMOP note # Notes # 13#--------------------------#-----------------------------#-------------------# 14 null, # note_id # REQUIRED # 15 null, # person_id # REQUIRED # 16 null, # note_date # REQUIRED # 17 null, # note_datetime # set the time to midnight if not given 18 null, # note_type_concept_id # REQUIRED # 19 null, # note_class_concept_id # REQUIRED # 21 null, # note_text # REQUIRED # 22 null, # encoding_concept_id # REQUIRED # 23 null, # language_concept_id # REQUIRED # 25 null, # visit_occurrence_id # 26 null, # visit_detail_id # 27 null, # note_source_value # 28 null, # note_event_id # 29 null, # note_event_field_concept_id # 30#--------------------------#-----------------------------#-------------------# 35cat <<NOTES # Everything below is notes. 38https://athena.ohdsi.org/search-terms/terms 40# OMOP CDM 5.4 note TABLE 41https://ohdsi.github.io/CommonDataModel/cdm54.html#note 43 note_id integer NOT NULL PRIMARY KEY, 44 person_id integer NOT NULL REFERENCES PERSON (PERSON_ID), 45 note_date date NOT NULL, 46 note_datetime datetime NULL, 47 note_type_concept_id integer NOT NULL REFERENCES CONCEPT (CONCEPT_ID), 48 note_class_concept_id integer NOT NULL REFERENCES CONCEPT (CONCEPT_ID), 50 note_text TEXT NOT NULL, 51 encoding_concept_id integer NOT NULL REFERENCES CONCEPT (CONCEPT_ID), 52 language_concept_id integer NOT NULL REFERENCES CONCEPT (CONCEPT_ID), 53 provider_id integer NULL REFERENCES PROVIDER (PROVIDER_ID), 54 visit_occurrence_id integer NULL REFERENCES VISIT_OCCURRENCE (VISIT_OCCURRENCE_ID), 55 visit_detail_id integer NULL REFERENCES VISIT_DETAIL (VISIT_DETAIL_ID), 56 note_source_value TEXT NULL, 57 note_event_id integer NULL, 58 note_event_field_concept_id integer NULL REFERENCES CONCEPT (CONCEPT_ID) 61# FHIR R4 Example DiagnosticReport Resource 62https://www.hl7.org/fhir/R4B/DiagnosticReport.html 64 "resourceType": "DiagnosticReport", 68 "lastUpdated": "2024-06-01T20:19:17.304+00:00", 69 "source": "#8IRCgpLiSxJLv3VD", 71 "http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-note" 79 "system": "http://loinc.org", 81 "display": "History and physical note" 84 "system": "http://loinc.org", 86 "display": "Evaluation+Plan note" 94 "system": "http://loinc.org", 96 "display": "History and physical note" 99 "system": "http://loinc.org", 101 "display": "Evaluation+Plan note" 106 "reference": "Patient/4217" 109 "reference": "Encounter/4218" 111 "effectiveDateTime": "1959-02-22T06:37:53-05:00", 112 "issued": "1959-02-22T06:37:53.630-05:00", 115 "reference": "Practitioner/2187", 116 "display": "Dr. Douglass930 Windler79" 121 "contentType": "text/plain", 122 "data": "CjE5NTktMDItMjIKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkh1bWJlcnRvNDgyCiBpcyBhIDM1IHllYXItb2xkIG5vbi1oaXNwYW5pYyB3aGl0ZSBtYWxlLgoKIyBTb2NpYWwgSGlzdG9yeQpQYXRpZW50IGlzIG1hcnJpZWQuIFBhdGllbnQgaXMgYW4gYWN0aXZlIHNtb2tlciBhbmQgaXMgYW4gYWxjb2hvbGljLgogUGF0aWVudCBpZGVudGlmaWVzIGFzIGhldGVyb3NleHVhbC4KClBhdGllbnQgY29tZXMgZnJvbSBhIGhpZ2ggc29jaW9lY29ub21pYyBiYWNrZ3JvdW5kLgogUGF0aWVudCBoYXMgY29tcGxldGVkIHNvbWUgY29sbGVnZSBjb3Vyc2VzLgpQYXRpZW50IGN1cnJlbnRseSBoYXMgSHVtYW5hLgoKIyBBbGxlcmdpZXMKTm8gS25vd24gQWxsZXJnaWVzLgoKIyBNZWRpY2F0aW9ucwpObyBBY3RpdmUgTWVkaWNhdGlvbnMuCgojIEFzc2Vzc21lbnQgYW5kIFBsYW4KUGF0aWVudCBpcyBwcmVzZW50aW5nIHdpdGggYm9keSBtYXNzIGluZGV4IDMwKyAtIG9iZXNpdHkgKGZpbmRpbmcpLiAKCiMjIFBsYW4KCg=="