diff --git a/.gitignore b/.gitignore index 9b9a9ac..af5fd2c 100644 --- a/.gitignore +++ b/.gitignore @@ -143,6 +143,7 @@ venv/ ENV/ env.bak/ venv.bak/ +isaric-venv # Spyder project settings .spyderproject @@ -151,6 +152,9 @@ venv.bak/ # Rope project settings .ropeproject +# VScode project settings +.vscode + # mkdocs documentation /site diff --git a/fhir/fhir2flat.py b/fhir/fhir2flat.py new file mode 100644 index 0000000..947fbfc --- /dev/null +++ b/fhir/fhir2flat.py @@ -0,0 +1,63 @@ +""" +Convert FHIR resources as JSON files to FHIRflat CSV files. +""" + +import pandas as pd +import json + + +def expandCoding(df: pd.DataFrame, column_name: str): + """ + Expands a column containing a list of dictionaries with coding information into + multiple columns. + """ + + i = df.columns.get_loc(column_name) + df.insert(i + 1, column_name + "_system", df[column_name][0][0]["system"]) + df.insert(i + 2, column_name + "_code", df[column_name][0][0]["code"]) + df.insert(i + 3, column_name + "_display", df[column_name][0][0]["display"]) + + df.drop(columns=[column_name], inplace=True) + + +def condenseReference(df, reference): + """ + Condenses a reference into a string containing the reference type and the reference + id. + """ + df[reference] = df[reference].apply(lambda x: x.split("/")[-1]) + + +def fhir2flat(fhir_file: str, flat_file: str): + """ + Converts a FHIR JSON file into a FHIRflat file. + + fhir_file: path to FHIR JSON file + flat_file: path to save new FHIRflat CSV file to + """ + + # Load JSON data + with open(fhir_file) as json_file: + data = json.load(json_file) + + # Flatten JSON and convert to DataFrame + df = pd.json_normalize(data) + + # expand all instances of the "coding" list + for coding in df.columns[df.columns.str.endswith("coding")]: + expandCoding(df, coding) + + # condense all references + for reference in df.columns[df.columns.str.endswith("reference")]: + condenseReference(df, reference) + + # drop static columns + # Can we drop status in all cases? "status" in MedicationAdministration might be + # for indicating "not taken"... + df.drop(columns=["status", "meta.profile"], axis=1, inplace=True) + + # save to csv + df.to_csv(flat_file, index=False) + + +fhir2flat("resource_structure_dev/procedure.json", "flat_procedure.csv") diff --git a/fhir/fhir_export.py b/fhir/fhir_export_isaric.py similarity index 54% rename from fhir/fhir_export.py rename to fhir/fhir_export_isaric.py index 813178d..30c4899 100644 --- a/fhir/fhir_export.py +++ b/fhir/fhir_export_isaric.py @@ -9,6 +9,8 @@ from dataclasses import dataclass from typing import Optional, Literal, Any +from drug_name_codes import corticosteroid_snomed, antiviral_snomed + @dataclass class Patient: @@ -17,6 +19,7 @@ class Patient: birthDate: Optional[str] = None deceasedBoolean: Optional[bool] = None deceasedDateTime: Optional[str] = None + # outcome here? def to_json(self) -> dict[str, Any]: out = { @@ -74,6 +77,94 @@ def to_json(self) -> dict[str, Any]: } +@dataclass +class Medication: + subject: str + visit: str + is_present: bool + snomed_code: int + text: str + datetime: Optional[str] = None + period: Optional[tuple(str, str)] = None + + def to_json(self) -> dict[str, Any]: + return { + "resourceType": "MedicationStatement", + "id": str(uuid.uuid4()), + "status": "recorded", + "medication": { # not sure about this structure + "concept": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": str(self.snomed_code), + "display": self.text, + } # could put LOINC code here too + ], + }, + }, + "adherence": { + "code": { + "coding": { + "system": "http://hl7.org/fhir/CodeSystem/medication-statement-adherence", + "code": "taking" if self.is_present else "not-taking", + } + } + }, + "subject": {"reference": f"Patient/{self.subject}"}, + "encounter": {"reference": f"Encounter/{self.visit}"}, + "effectiveTimeDate": self.datetime, + "effectivePeriod": {"start": self.period[0], "end": self.period[1]} + if self.period + else None, + } + + +@dataclass +class Procedure: + subject: str + visit: str + is_present: bool + snomed_code: int + text: str + datetime: Optional[str] = None + period: Optional[tuple(str, str)] = None + + def to_json(self) -> dict[str, Any]: + return { + # "resourceType": "Procedure", + # "id": str(uuid.uuid4()), + # "status": "recorded", + # "medication": { + # "concept": { + # "coding": [ + # { + # "system": "http://snomed.info/sct", + # "code": str(self.snomed_code), + # "display": self.text, + # } # could put LOINC code here too + # ], + # }, + # }, + # "adherence": { + # "code": { + # "coding": { + # "system": "http://hl7.org/fhir/CodeSystem/medication-statement-adherence", + # "code": "taking" if self.is_present else "not-taking", + # } + # } + # }, + # "subject": {"reference": f"Patient/{self.subject}"}, + # "encounter": { + # "reference": f"Patient/{self.visit}" + # }, # Should this be stored in Patient? + # "effectiveTimeDate": self.datetime, + # "effectivePeriod": {"start": self.period[0], "end": self.period[1]} + # if self.period + # else None, + } + + @dataclass class Observation: category: Literal[ @@ -81,7 +172,7 @@ class Observation: "vital-signs", "imaging", "laboratory", - "procedure", + # "procedure", "survey", "exam", "therapy", @@ -98,12 +189,12 @@ def to_json(self) -> dict[str, Any]: SUBJECT_SNOMED = [ - ("has_chronic_hematologic_disease", 414022008), + ("has_chronic_hematologic_disease", 398983000), ("has_asplenia", 707147002), ("has_tuberculosis", 427099000), ("has_dementia", 52448006), ("has_obesity", 414916001), - ("has_rheumatologic_disorder", 363059001), + ("has_rheumatologic_disorder", 363059001), # ? ("has_hiv", 86406008), ("has_hypertension", 38341003), ("has_malignant_neoplasm", 363346000), @@ -122,6 +213,55 @@ def to_json(self) -> dict[str, Any]: ("has_immunosuppression", 234532001), ] +VISIT_MEDS_SNOMED = [ + ("treatment_corticosteroid", 788751009), + ("treatment_corticosteroid_type", corticosteroid_snomed), + ("treatment_antifungal_agent", 373219008), + ("treatment_antifungal_agent_type",), + ("treatment_antivirals", 372701006), + ("treatment_antiviral_type", antiviral_snomed), + ("treatment_antibiotics", 346325008), + ("treatment_antibiotics_type",), + ("treatment_anticoagulation", 372862008), + ("treatment_inhaled_nitric_oxide", 6710000), + ("treatment_ace_inhibitors", 372733002), + ("treatment_arb", 372913009), + ("treatment_antimalarial", 373287002), + ("treatment_antimalarial_type",), + ("treatment_immunosuppressant", 372823004), + ("treatment_intravenous_fluids", 118431008), + ("treatment_nsaid", 713443004), + ("treatment_neuromuscular_blocking_agents", 373295003), + # ("treatment_offlabel",), + ("treatment_colchine", 73133000), # ? + ("treatment_immunoglobulins",), + ("treatment_delirium",), + ("treatment_delirium_type",), + ("treatment_monoclonal_antibody", 49616005), + # ("treatment_other",), +] + +VISIT_PROC_SNOMED = [ + ("treatment_dialysis", 265764009), + ("treatment_ecmo", 233573008), + ("treatment_oxygen_therapy", 57485005), + ( + "treatment_oxygen_mask_prongs", + 371907003, + ), # oxygen administration by nasal cannula + ("treatment_prone_position", 1240000), + ("treatment_invasive_ventilation", 1258985005), + ("treatment_noninvasive_ventilation", 428311008), + ( + "treatment_high_flow_nasal_cannula", + 426854004, + ), # equipment rather than treatment - 1259025002 is heated/humidified HFNC + ("treatment_cpr", 89666000), + ("treatment_respiratory_support",), + ("treatment_cardiovascular_support",), + ("treatment_pacing", 18590009), +] + SUBJECT_INDICATOR_SNOMED_CODES = dict(SUBJECT_SNOMED) SNOMED_DISPLAY = dict( (v, " ".join(k.split("_")[1:]).capitalize()) diff --git a/fhir/resource_structure_dev/condition.json b/fhir/resource_structure_dev/condition.json new file mode 100644 index 0000000..d0ebd10 --- /dev/null +++ b/fhir/resource_structure_dev/condition.json @@ -0,0 +1,282 @@ +{ + "resourceType": "Condition", + "id": "example-symptom-present", + "meta": { + "profile": [ + "our_url_here" + ] + }, + "category": [ + { + "coding": [ + { + "code": "75325-1", + "system": "http://loinc.org", + "display": "Symptom" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "49727002", + "display": "Cough" + } + ] + }, + "verificationStatus": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status", + "code": "confirmed", + "display": "Confirmed" + }, + { + "system": "http://snomed.info/sct", + "code": "410605003", + "display": "Confirmed present (qualifier value)" + } + ] + }, + "clinicalStatus": { + "coding": [ + { + "code": "active", + "system": "http://terminology.hl7.org/CodeSystem/condition-clinical", + "display": "Active" + } + ] + }, + "severity": { + "coding": [ + { + "code": "24484000", + "system": "http://snomed.info/sct", + "display": "Severe" + } + ] + }, + "subject": { + "reference": "Patient/" + }, + "recordedDate": "2020-10-05" +}, +{ + "resourceType": "Condition", + "id": "example-symptom-absent", + "meta": { + "profile": [ + "our_url_here" + ] + }, + "category": [ + { + "coding": [ + { + "code": "75325-1", + "system": "http://loinc.org", + "display": "Symptom" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "40917007", + "display": "Clouded consciousness" + } + ] + }, + "verificationStatus": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status", + "code": "refuted", + "display": "Refuted" + }, + { + "system": "http://snomed.info/sct", + "code": "410594000", + "display": "Definitely NOT present (qualifier value)" + } + ] + }, + "subject": { + "reference": "Patient/" + }, + "recordedDate": "2020-10-05" +} + +{ + "resourceType": "Condition", + "id": "chronic-condition-present", + "meta": { + "profile": [ + "our_url_here" + ] + }, + "category": [ + { + "coding": [ + { + "code": "392521001", + "system": "http://snomed.info/sct", + "display": "History of (contextual qualifier) (qualifier value)" + } + ] + } + ], + "verificationStatus": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status", + "code": "confirmed", + "display": "Confirmed" + }, + { + "system": "http://snomed.info/sct", + "code": "410605003", + "display": "Confirmed present (qualifier value)" + } + ] + }, + "clinicalStatus": { + "coding": [ + { + "code": "active", + "system": "http://terminology.hl7.org/CodeSystem/condition-clinical", + "display": "Active" + } + ] + }, + "code": { + "coding": [ + { + "code": "709044004", + "system": "http://snomed.info/sct", + "display": "Chronic kidney disease (disorder)" + } + ] + }, + "severity": { + "coding": [ + { + "code": "24484000", + "system": "http://snomed.info/sct", + "display": "Severe" + } + ] + }, + "subject": { + "reference": "Patient/" + }, + "recordedDate": "2020-10-28" +} + +{ + "resourceType": "Condition", + "id": "chronic-comorbidity-absent", + "meta": { + "profile": [ + "our_url_here" + ] + }, + "category": [ + { + "coding": [ + { + "code": "392521001", + "system": "http://snomed.info/sct", + "display": "History of (contextual qualifier) (qualifier value)" + } + ] + } + ], + "verificationStatus": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status", + "code": "refuted", + "display": "Refuted" + }, + { + "system": "http://snomed.info/sct", + "code": "410594000", + "display": "Definitely NOT present (qualifier value)" + } + ] + }, + "code": { + "coding": [ + { + "code": "709044004", + "system": "http://snomed.info/sct", + "display": "Chronic kidney disease (disorder)" + } + ] + }, + "subject": { + "reference": "Patient/" + }, + "recordedDate": "2020-10-28" +}, +{ + "resourceType": "Condition", + "id": "complication-present", + "meta": { + "profile": [ + "our_url_here" + ] + }, + "category": [ + { + "coding": [ + { + "code": "116223007", + "system": "http://snomed.info/sct", + "display": "Complication (disorder)" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "14669001", + "display": "Acute renal failure syndrome (disorder)" + } + ] + }, + "verificationStatus": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status", + "code": "confirmed", + "display": "Confirmed" + }, + { + "system": "http://snomed.info/sct", + "code": "410605003", + "display": "Confirmed present (qualifier value)" + } + ] + }, + "clinicalStatus": { + "coding": [ + { + "code": "active", + "system": "http://terminology.hl7.org/CodeSystem/condition-clinical", + "display": "Active" + } + ] + }, + "subject": { + "reference": "Patient/" + }, + "recordedDate": "2020-10-15" +} diff --git a/fhir/resource_structure_dev/encounter.json b/fhir/resource_structure_dev/encounter.json new file mode 100644 index 0000000..48f349d --- /dev/null +++ b/fhir/resource_structure_dev/encounter.json @@ -0,0 +1,129 @@ +{ + "resourceType": "Encounter", + "id": "encounter_example_hospital_admission_for_covid", + "meta": { + "profile": [ + "our_url_here" + ] + }, + "extension": [ + { + "url": "our-research-study-url", + "valueReference": { + "reference": "ResearchStudy/" + } + } + ], + "status": "completed", + "class": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "IMP", + "display": "inpatient encounter" + } + ] + } + ], + "type": [ + { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "270427003", + "display": "Patient-initiated encounter" + } + ] + } + ], + "subject": { + "reference": "Patient/" + }, + "partOf": { + "reference": "Encounter/" + }, + "actualPeriod": { + "start": "2022-07-10", + "end": "2022-07-22" + }, + "length": { + "value": 12, + "unit": "day", + "system": "http://unitsofmeasure.org", + "code": "d" + }, + "diagnosis": [ + { + "condition": [ + { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "840539006", + "display": "COVID-19" + } + ] + } + ], + "use": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/diagnosis-role", + "code": "AD", + "display": "Admission diagnosis" + } + ] + } + ] + }, + { + "condition": [ + { + "concept": { + "text": "The patient is treated for a tumor" + } + } + ], + "use": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/diagnosis-role", + "code": "CC", + "display": "Chief complaint" + } + ] + } + ] + } + ], + "admission": { + "preAdmissionidentifier": "", + "admitSource": { + "coding": { + "system": "http://snomed.info/sct", + "code": "50849002", + "display": "Emergency room admission" + } + }, + "reAdmission": { + "coding": { + "system": "http://terminology.hl7.org/CodeSystem/v2-0092", + "code": "R", + "display": "Re-admission" + } + }, + "dischargeDisposition": { + "coding": { + "system": "http://snomed.info/sct", + "code": "306689006", + "display": "Discharge to home" + } + } + }, + "location": { + "reference": "Location/" + } +} diff --git a/fhir/resource_structure_dev/medication_administration.json b/fhir/resource_structure_dev/medication_administration.json new file mode 100644 index 0000000..a6ab886 --- /dev/null +++ b/fhir/resource_structure_dev/medication_administration.json @@ -0,0 +1,40 @@ +{ + "resourceType": "MedicationAdministration", + "id": "example", + "meta": { + "profile": [ + "our_url_here" + ] + }, + "status": "not-taken", + "medicationCodeableConcept": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "392327001", + "display": "Azithromycin-containing product in oral dose form" + } + ], + "text": "Azithromycin" + }, + "subject": { + "reference": "Patient/", + "display": "Eve Everywoman" + }, + "encounter": { + "reference": "Encounter/", + "display": "encounter_name" + }, + "effectiveDateTime": "2018-03-07", + "dosage": { + "route": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "26643006", + "display": "Oral route" + } + ] + } + } +} diff --git a/fhir/resource_structure_dev/observation.json b/fhir/resource_structure_dev/observation.json new file mode 100644 index 0000000..b770a4d --- /dev/null +++ b/fhir/resource_structure_dev/observation.json @@ -0,0 +1,153 @@ +{ + "resourceType": "Observation", + "id": "vital-sign-example", + "meta": { + "profile": [ + "our_url_here" + ] + }, + "extension": [ + { + "url": "our-timing-extension", + "valueText": "on admission" + } + ], + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "Vital Signs" + } + ], + "text": "Vital Signs" + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "8867-4", + "display": "Heart Rate" + } + ], + "text": "heart_rate" + }, + "subject": { + "reference": "Patient/" + }, + "encounter": { + "reference": "Encounter/" + }, + "effectiveDateTime": "1999-07-02", + "valueQuantity": { + "value": 44, + "unit": "beats/min", + "system": "http://unitsofmeasure.org", + "code": "/min" + } +}, +{ + "resourceType": "Observation", + "id": "example-pregnancy-status", + "meta": { + "profile": [ + 🔗 "http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-pregnancystatus|7.0.0-ballot" + ] + }, + "text": { + "status": "generated", + "div": "

Generated Narrative: Observation

Resource Observation "pregnancy-status"

Profile: US Core Observation Pregnancy Status Profile (version 7.0.0-ballot)

status: final

category: Social History (Observation Category Codes#social-history)

code: Pregnancy Status (LOINC#82810-3 "Pregnancy status")

subject: Patient/example: Amy Shaw " SHAW"

effective: 2022-08-24 10:39:52+0000

value: Pregnant (SNOMED CT[US]#77386006)

" + }, + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "social-history", + "display": "Social History" + } + ], + "text": "Social History" + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "82810-3", + "display": "Pregnancy status" + } + ], + "text": "Pregnancy Status" + }, + "subject": { + "reference": "Patient/", + }, + "encounter": { + "reference": "Encounter/", + }, + "effectiveDateTime": "2022-08-24", + "valueCodeableConcept": { + "coding": [ + { + "system": "http://snomed.info/sct", + "version": "http://snomed.info/sct/731000124108", + "code": "77386006", + "display": "Pregnant" + } + ], + "text": "Pregnant" + } +}, +{ + "resourceType": "Observation", + "id": "example-lab-result", + "meta": { + "profile": [ + "our_url_here" + ] + }, + "extension": [ + { + "url": "our-timing-extension", + "valueText": "during visit" + } + ], + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "laboratory", + "display": "Laboratory" + } + ], + "text": "Laboratory" + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "718-7", + "display": "Hemoglobin [Mass/volume] in Blood" + } + ], + "text": "Hemoglobin" + }, + "subject": { + "reference": "Patient/", + }, + "effectiveDateTime": "2005-07-05", + "valueQuantity": { + "value": 17, + "unit": "g/dL", + "system": "http://unitsofmeasure.org", + "code": "g/dL" + } +} diff --git a/fhir/resource_structure_dev/organization.json b/fhir/resource_structure_dev/organization.json new file mode 100644 index 0000000..c31c0a7 --- /dev/null +++ b/fhir/resource_structure_dev/organization.json @@ -0,0 +1,29 @@ +{ + "resourceType": "Organization", + "id": "", + "type": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/organization-type", + "code": "prov", + "display": "Healthcare Provider" + } + ] + } + ], + "name": "Burgers University Medical Center", + "contact": [ + { + "address": { + "use": "work", + "line": [ + "Galapagosweg 91" + ], + "city": "Den Burg", + "postalCode": "9105 PZ", + "country": "NLD" + } + } + ] +} diff --git a/fhir/resource_structure_dev/patient.json b/fhir/resource_structure_dev/patient.json new file mode 100644 index 0000000..aaf0970 --- /dev/null +++ b/fhir/resource_structure_dev/patient.json @@ -0,0 +1,87 @@ +{ + "resourceType": "Patient", + "id": "example", + "meta": { + "profile": [ + "our_url_here" + ] + }, + "extension": [ + { + "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-race", + "extension": [ + { + "url": "text", + "valueString": "White" + }, + { + "url": "ombCategory", + "valueCoding": { + "system": "urn:oid:2.16.840.1.113883.6.238", + "code": "2106-3", + "display": "White" + } + } + ] + }, + { + "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex", + "valueCode": "F" + }, + { + "url": "http://hl7.org/fhir/StructureDefinition/individual-genderIdentity", + "extension": [ + { + "url": "value", + "valueCodeableConcept": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/v3-NullFlavor", + "code": "ASKU", + "display": "asked but unknown" + } + ], + "text": "asked but unknown" + } + } + ] + }, + { + "url": "http://hl7.org/fhir/globalhealth/core/StructureDefinition/isaric-ethnicity", + "extension": [ + { + "url": "text", + "valueString": "Nepali" + }, + { + "url": "ethnicCategory", + "valueCoding": { + "system": "our_link", + "code": "5", + "display": "South Asian" + } + } + ] + }, + { + "url": "http://hl7.org/fhir/globalhealth/core/StructureDefinition/age", + "extension": [ + { + "url": "age", + "valueAge": { + "value": 36, + "code": "a", + "system": "http://unitsofmeasure.org", + "unit": "years" + } + } + ] + } + ], + "identifier": "", + "active": true, + "gender": "female", + "birthDate": "1987-02-20", + "deceasedBoolean": true, + "deceasedDateTime": "2022-07-22" +} diff --git a/fhir/resource_structure_dev/procedure.json b/fhir/resource_structure_dev/procedure.json new file mode 100644 index 0000000..de18299 --- /dev/null +++ b/fhir/resource_structure_dev/procedure.json @@ -0,0 +1,36 @@ +{ + "resourceType": "Procedure", + "id": "example_procedure_dialysis", + "meta": { + "profile": [ + "our_url_here" + ] + }, + "status": "completed", + "category": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "277132007", + "display": "Therapeutic procedure (procedure)" + } + ] + }, + "code": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "108241001", + "display": "Dialysis procedure (procedure)" + } + ], + "text": "Dialysis" + }, + "subject": { + "reference": "Patient/" + }, + "encounter": { + "reference": "Encounter/" + }, + "occurenceDateTime": "2018-03-07" +} diff --git a/fhir/resource_structure_dev/research_study.json b/fhir/resource_structure_dev/research_study.json new file mode 100644 index 0000000..4408bc2 --- /dev/null +++ b/fhir/resource_structure_dev/research_study.json @@ -0,0 +1,184 @@ +{ + "resourceType": "ResearchStudy", + "id": "example-study-ccpuk", + "url": "", + "name": "CCPUK", + "title": "ISARIC/WHO Clinical Characterisation Protocol UK", + "label": [ + { + "type": { + "text": "Study Code" + }, + "value": "CVCCPUK" + } + ], + "protocol": [ + { + "reference": "PlanDefinition/" + } + ], + "partOf": [ + { + "reference": "ResearchStudy/" + } + ], + "relatedArtifact": [ + { + "type": "created-with", + "display": "Original case report form", + "document": { + "url": "url-to-pdf" + } + }, + { + "type": "citation", + "display": "Publication: ", + "citation": "markdown-paper-citation-with-doi" + } + ], + "status": "active", + "primaryPurposeType": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/research-study-prim-purp-type", + "code": "diagnostic", + "display": "Diagnostic" + } + ] + }, + "phase": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/research-study-phase", + "code": "phase-1", + "display": "Phase 1" + } + ] + }, + "studyDesign": [ + { + "coding": { + "system": "http://hl7.org/fhir/ValueSet/study-design", + "code": "SEVCO:01043", + "display": "Multicentric" + } + }, + { + "text": "CT.gov StudyType: INTERVENTIONAL" + } + ], + "condition": [ + { + "value": [ + { + "concept": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "840539006", + "display": "COVID-19" + } + ] + } + } + ] + } + ], + "keyword": [ + { + "text": "COVID, Sars-Cov-2" + } + ], + "descriptionSummary": "", + "description": "", + "period": { + "start": "2020-05-05" + }, + "site": [ + { + "reference": "Organization/" + } + ], + "region": { + "coding": [ + { + "system": "http://hl7.org/fhir/ValueSet/jurisdiction", + "code": "GB", + "display": "United Kingdom of Great Britain and Northern Ireland" + } + ] + }, + "associatedParty": [ + { + "name": "University of Oxford", + "role": { + "coding": [ + { + "system": "http://hl7.org/fhir/research-study-party-role", + "code": "sponsor", + "display": "Sponsor" + } + ] + } + }, + { + "name": "Wellcome Trust", + "role": { + "coding": [ + { + "system": "http://hl7.org/fhir/research-study-party-role", + "code": "funding-source", + "display": "Funding Source" + } + ] + } + } + ], + "progressStatus": [ + { + "state": { + "coding": [ + { + "system": "http://hl7.org/fhir/research-study-status", + "code": "recruiting", + "display": "Recruiting" + } + ] + } + }, + { + "state": { + "coding": [ + { + "system": "http://hl7.org/fhir/research-study-status", + "code": "overall-study", + "display": "Overall Study" + } + ] + }, + "actual": false, + "period": { + "start": "2022-12-06", + "end": "2023-06" + } + } + ], + "recruitment": { + "targetNumber": 2000, + "actualNumber": 1990, + "eligibility": { + "reference": "url", + "type": "EvidenceVariable", + "identifier": { + "type": { + "text": "" + }, + "system": "", + "value": "", + "assigner": { + "display": "" + } + } + } + } +} diff --git a/fhir/resource_structure_dev/research_subject.json b/fhir/resource_structure_dev/research_subject.json new file mode 100644 index 0000000..2391d0b --- /dev/null +++ b/fhir/resource_structure_dev/research_subject.json @@ -0,0 +1,31 @@ +{ + "resourceType": "ResearchSubject", + "id": "example_research_subject", + "meta": { + "profile": [ + "our_url_here" + ] + }, + "status": "active", + "study": { + "reference": "ResearchStudy/" + }, + "subject": { + "reference": "Patient/" + }, + "progress": { + "subjectState": { + "coding": [ + { + "system": "http://hl7.org/fhir/ValueSet/research-subject-state", + "code": "on-study", + "display": "On study" + } + ], + "text": "On study" + } + }, + "period": { + "start": "" + } +} diff --git a/fhir/resource_structure_dev/specimen.json b/fhir/resource_structure_dev/specimen.json new file mode 100644 index 0000000..a26f6a3 --- /dev/null +++ b/fhir/resource_structure_dev/specimen.json @@ -0,0 +1,33 @@ +{ + "resourceType": "Specimen", + "id": "example-specimen", + "meta": { + "profile": [ + "our_url_here" + ] + }, + "type": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "257261003", + "display": "Swab (specimen)" + } + ] + }, + "subject": { + "reference": "Patient/" + }, + "collection": { + "collectedDateTime": "2020-04-07T14:00:00Z", + "bodySite": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "49928004", + "display": "Structure of anterior portion of neck (body structure)" + } + ] + } + } +}