update MIMIC code and reverse testing change (maven said no)

This commit is contained in:
Grahame Grieve 2019-11-07 20:57:16 +11:00
parent 7099f904f5
commit 02791ae21f
26 changed files with 1353 additions and 29 deletions

View File

@ -319,6 +319,25 @@ public class CodeableConcept extends Type implements ICompositeType {
return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(coding, text); return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(coding, text);
} }
// added from java-adornments.txt:
public boolean hasCoding(String system, String code) {
for (Coding c : getCoding()) {
if (system.equals(c.getSystem()) && code.equals(c.getCode()))
return true;
}
return false;
}
public CodeableConcept(Coding code) {
super();
addCoding(code);
}
// end addition
} }

View File

@ -31,9 +31,14 @@ import java.io.FileOutputStream;
import java.io.IOException; import java.io.IOException;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.nio.charset.Charset; import java.nio.charset.Charset;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet;
import java.util.Map; import java.util.Map;
import java.util.Set;
import java.util.UUID; import java.util.UUID;
import org.fhir.ucum.UcumEssenceService; import org.fhir.ucum.UcumEssenceService;
@ -53,6 +58,7 @@ import org.hl7.fhir.r4.model.DocumentReference;
import org.hl7.fhir.r4.model.Encounter; import org.hl7.fhir.r4.model.Encounter;
import org.hl7.fhir.r4.model.Enumerations.AdministrativeGender; import org.hl7.fhir.r4.model.Enumerations.AdministrativeGender;
import org.hl7.fhir.r4.model.Enumerations.DocumentReferenceStatus; import org.hl7.fhir.r4.model.Enumerations.DocumentReferenceStatus;
import org.hl7.fhir.r4.model.InstantType;
import org.hl7.fhir.r4.model.MedicationRequest; import org.hl7.fhir.r4.model.MedicationRequest;
import org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus; import org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus;
import org.hl7.fhir.r4.model.Observation; import org.hl7.fhir.r4.model.Observation;
@ -61,11 +67,15 @@ import org.hl7.fhir.r4.model.Observation.ObservationStatus;
import org.hl7.fhir.r4.model.Patient; import org.hl7.fhir.r4.model.Patient;
import org.hl7.fhir.r4.model.Practitioner; import org.hl7.fhir.r4.model.Practitioner;
import org.hl7.fhir.r4.model.PractitionerRole; import org.hl7.fhir.r4.model.PractitionerRole;
import org.hl7.fhir.r4.model.Procedure;
import org.hl7.fhir.r4.model.Procedure.ProcedureStatus;
import org.hl7.fhir.r4.model.Quantity; import org.hl7.fhir.r4.model.Quantity;
import org.hl7.fhir.r4.model.Quantity.QuantityComparator; import org.hl7.fhir.r4.model.Quantity.QuantityComparator;
import org.hl7.fhir.r4.model.Range;
import org.hl7.fhir.r4.model.Reference; import org.hl7.fhir.r4.model.Reference;
import org.hl7.fhir.r4.model.Type; import org.hl7.fhir.r4.model.Type;
import org.hl7.fhir.utilities.CSVReader; import org.hl7.fhir.utilities.CSVReader;
import org.hl7.fhir.utilities.IniFile;
import org.hl7.fhir.utilities.Utilities; import org.hl7.fhir.utilities.Utilities;
public class Mimic14Importer { public class Mimic14Importer {
@ -96,9 +106,10 @@ public class Mimic14Importer {
private Date date; private Date date;
private Map<String, LabItem> labItems = new HashMap<>(); private Map<String, LabItem> labItems = new HashMap<>();
private Map<String, Item> items = new HashMap<>(); private Map<String, Item> items = new HashMap<>();
// private Map<String, PractitionerRole> careGivers = new HashMap<>(); private Map<String, PractitionerRole> careGivers = new HashMap<>();
private Map<String, Patient> patients = new HashMap<>(); private Map<String, Patient> patients = new HashMap<>();
private Map<String, Encounter> encounters = new HashMap<>(); private Map<String, Encounter> encounters = new HashMap<>();
private IniFile ini;
private UcumService ucum; private UcumService ucum;
@ -116,6 +127,7 @@ public class Mimic14Importer {
System.out.println("Loading UCUM from "+ucumSrc); System.out.println("Loading UCUM from "+ucumSrc);
ucum = new UcumEssenceService(ucumSrc); ucum = new UcumEssenceService(ucumSrc);
ini = new IniFile(Utilities.path(src, "translations.ini"));
loadItems(Utilities.path(src, "d_items.csv")); loadItems(Utilities.path(src, "d_items.csv"));
loadLabItems(Utilities.path(src, "d_labitems.csv")); loadLabItems(Utilities.path(src, "d_labitems.csv"));
@ -127,7 +139,11 @@ public class Mimic14Importer {
processMicroEvents(Utilities.path(src, "microbiologyevents.csv"), Utilities.path(dest, "micro-observations.json")); processMicroEvents(Utilities.path(src, "microbiologyevents.csv"), Utilities.path(dest, "micro-observations.json"));
processNoteEvents(Utilities.path(src, "noteevents.csv"), Utilities.path(dest, "notes.json")); processNoteEvents(Utilities.path(src, "noteevents.csv"), Utilities.path(dest, "notes.json"));
processDiagnoses(Utilities.path(src, "diagnoses_icd.csv"), Utilities.path(dest, "diagnoses.json")); processDiagnoses(Utilities.path(src, "diagnoses_icd.csv"), Utilities.path(dest, "diagnoses.json"));
processProcedures(Utilities.path(src, "procedures_icd.csv"), Utilities.path(dest, "procedures.json"));
processPrescriptions(Utilities.path(src, "prescriptions.csv"), Utilities.path(dest, "prescriptions.json")); processPrescriptions(Utilities.path(src, "prescriptions.csv"), Utilities.path(dest, "prescriptions.json"));
processProcedureEvents(Utilities.path(src, "procedureevents_mv.csv"), Utilities.path(dest, "procedure-events.json"));
processOutputEvents(Utilities.path(src, "outputevents.csv"), Utilities.path(dest, "outputs.json"));
processChartEvents(Utilities.path(src, "chartevents.csv"), Utilities.path(dest, "chartevents.json"));
System.out.println("saving"); System.out.println("saving");
@ -198,6 +214,7 @@ public class Mimic14Importer {
t++; t++;
pr.setId(csv.cell("cgid")); pr.setId(csv.cell("cgid"));
pr.addCode().addCoding().setSystem("http://mimic.physionet.org/fhir/CareGiverType").setCode(csv.cell("label")).setDisplay(csv.cell("description")); pr.addCode().addCoding().setSystem("http://mimic.physionet.org/fhir/CareGiverType").setCode(csv.cell("label")).setDisplay(csv.cell("description"));
careGivers.put(pr.getId(), pr);
bnd.addEntry().setResource(pr); bnd.addEntry().setResource(pr);
} }
System.out.println(Integer.toString(t)+" found"); System.out.println(Integer.toString(t)+" found");
@ -232,7 +249,7 @@ public class Mimic14Importer {
obs.setEffective(readDateTime(csv.cell("charttime"))); obs.setEffective(readDateTime(csv.cell("charttime")));
if (item != null) { if (item != null) {
if (!Utilities.noString(item.category)) { if (!Utilities.noString(item.category)) {
obs.addCategory().setText(item.category); obs.addCategory().addCoding().setSystem("http://mimic.physionet.org/fhir/categories").setCode(item.category);
} }
obs.getCode().setText(item.label); obs.getCode().setText(item.label);
if (!Utilities.noString(item.fluid)) { if (!Utilities.noString(item.fluid)) {
@ -244,14 +261,7 @@ public class Mimic14Importer {
} }
if (csv.has("valuenum")) { if (csv.has("valuenum")) {
Quantity qty = new Quantity(); Quantity qty = parseQuantity(csv.cell("valuenum"), "valueuom");
qty.setValue(new BigDecimal(csv.cell("valuenum")));
String uom = csv.cell("valueuom");
qty.setUnit(uom);
if (ucum.validate(uom) == null) {
qty.setCode(uom);
qty.setSystem("http://unitsofmeasure.org");
}
obs.setValue(qty); obs.setValue(qty);
} else { } else {
obs.setValue(new CodeableConcept().setText(csv.cell("value"))); obs.setValue(new CodeableConcept().setText(csv.cell("value")));
@ -306,7 +316,7 @@ public class Mimic14Importer {
cache.put(cacheId, obs); cache.put(cacheId, obs);
obs.setId(csv.cell("row_id")); obs.setId(csv.cell("row_id"));
obs.setStatus(ObservationStatus.FINAL); obs.setStatus(ObservationStatus.FINAL);
obs.addCategory().setText("microbiology"); obs.addCategory().addCoding().setSystem("http://mimic.physionet.org/fhir/categories").setCode("microbiology");
bnd.addEntry().setResource(obs); bnd.addEntry().setResource(obs);
@ -594,6 +604,41 @@ public class Mimic14Importer {
new JsonParser().setOutputStyle(OutputStyle.PRETTY).compose(new FileOutputStream(dest), bnd); new JsonParser().setOutputStyle(OutputStyle.PRETTY).compose(new FileOutputStream(dest), bnd);
} }
private void processProcedures(String src, String dest) throws FileNotFoundException, IOException {
System.out.print("Processing Procedures... ");
CSVReader csv = new CSVReader(new FileInputStream(src));
Bundle bnd = new Bundle();
bnd.setId("procedures");
bnd.setType(BundleType.COLLECTION);
bnd.setTimestamp(date);
csv.readHeaders();
int t = 0;
while (csv.line()) {
Procedure prc = new Procedure();
t++;
Patient pat = patients.get(csv.cell("subject_id"));
Encounter enc = encounters.get(csv.cell("hadm_id"));
prc.setId(csv.cell("row_id"));
prc.setStatus(ProcedureStatus.UNKNOWN);
prc.getCategory().addCoding().setSystem("http://mimic.physionet.org/fhir/categories").setCode("diagnosis");
if (pat != null) {
prc.setSubject(new Reference("Patient/"+pat.getId()));
}
if (enc != null) {
prc.setEncounter(new Reference("Encounter/"+enc.getId()));
enc.addDiagnosis().setCondition(new Reference("Procedure/"+prc.getId())).setRank(Integer.parseInt(csv.cell("seq_num")));
}
prc.setCode(new CodeableConcept(new Coding().setCode(csv.cell("icd9_code")).setSystem("http://hl7.org/fhir/sid/icd-9-cm")));
bnd.addEntry().setResource(prc);
}
System.out.println(Integer.toString(t)+" found");
csv.close();
new JsonParser().setOutputStyle(OutputStyle.PRETTY).compose(new FileOutputStream(dest), bnd);
}
private void processPrescriptions(String src, String dest) throws FHIRException, FileNotFoundException, IOException { private void processPrescriptions(String src, String dest) throws FHIRException, FileNotFoundException, IOException {
System.out.print("Processing Prescriptions... "); System.out.print("Processing Prescriptions... ");
CSVReader csv = new CSVReader(new FileInputStream(src)); CSVReader csv = new CSVReader(new FileInputStream(src));
@ -618,20 +663,238 @@ public class Mimic14Importer {
if (enc != null) { if (enc != null) {
med.setEncounter(new Reference("Encounter/"+enc.getId())); med.setEncounter(new Reference("Encounter/"+enc.getId()));
} }
med.getDispenseRequest().getValidityPeriod().setStartElement(readDateTime(csv.cell("startdate")));
med.getDispenseRequest().getValidityPeriod().setEndElement(readDateTime(csv.cell("enddate")));
med.addCategory().addCoding().setSystem("http://mimic.physionet.org/fhir/categories").setCode(csv.cell("drug_type"));
CodeableConcept cc = new CodeableConcept();
cc.setText(csv.cell("drug"));
if (csv.has("formulary_drug_cd")) {
cc.addCoding().setSystem("http://mimic.physionet.org/fhir/drugs").setCode(csv.cell("formulary_drug_cd"));
}
med.setMedication(cc);
// if (csv.has("gsn")) {
// cc.addCoding().setSystem("http://hl7.org/fhir/sid/GSN?").setCode(csv.cell("gsn"));
// }
if (csv.has("ndc")) {
cc.addCoding().setSystem("http://hl7.org/fhir/sid/ndc").setCode(csv.cell("ndc"));
}
//PROD_STRENGTH, DOSE_VAL_RX, DOSE_UNIT_RX - ignore as denomormalizations
// cnd.setCode(new CodeableConcept(new Coding().setCode(csv.cell("icd9_code")).setSystem("http://hl7.org/fhir/sid/icd-9-cm"))); if (csv.has("dose_val_rx")) {
try {
med.getDosageInstructionFirstRep().getDoseAndRateFirstRep().setDose(parseQuantityRange(csv.cell("dose_val_rx"), csv.cell("dose_unit_rx")));
} catch (Exception e) {
med.getDosageInstructionFirstRep().setText(csv.cell("dose_val_rx"));
}
}
if (csv.has("route")) {
med.getDosageInstructionFirstRep().getRoute().addCoding().setSystem("http://mimic.physionet.org/fhir/route").setCode(csv.cell("route"));
}
bnd.addEntry().setResource(med); bnd.addEntry().setResource(med);
} }
System.out.println(Integer.toString(t)+" found"); System.out.println(Integer.toString(t)+" found");
csv.close(); csv.close();
new JsonParser().setOutputStyle(OutputStyle.PRETTY).compose(new FileOutputStream(dest), bnd); new JsonParser().setOutputStyle(OutputStyle.PRETTY).compose(new FileOutputStream(dest), bnd);
} }
private Type parseQuantity(String cell) { private void processProcedureEvents(String src, String dest) throws FileNotFoundException, IOException {
System.out.print("Processing Procedure Events... ");
CSVReader csv = new CSVReader(new FileInputStream(src));
Bundle bnd = new Bundle();
bnd.setId("procedure-events");
bnd.setType(BundleType.COLLECTION);
bnd.setTimestamp(date);
csv.readHeaders();
int t = 0;
while (csv.line()) {
Procedure prc = new Procedure();
t++;
Patient pat = patients.get(csv.cell("subject_id"));
Encounter enc = encounters.get(csv.cell("hadm_id"));
prc.setId(csv.cell("row_id"));
prc.setStatus(ProcedureStatus.UNKNOWN);
prc.getCategory().addCoding().setSystem("http://mimic.physionet.org/fhir/categories").setCode("diagnosis");
if (pat != null) {
prc.setSubject(new Reference("Patient/"+pat.getId()));
}
if (enc != null) {
prc.setEncounter(new Reference("Encounter/"+enc.getId()));
}
prc.getPerformedPeriod().setStartElement(readDateTime(csv.cell("starttime")));
prc.getPerformedPeriod().setEndElement(readDateTime(csv.cell("endtime")));
Item spec = items.get(csv.cell("itemid"));
if (spec != null)
prc.setCode(new CodeableConcept(new Coding().setSystem("http://mimic.physionet.org/fhir/procedures").setCode(csv.cell("itemid")).setDisplay(spec.label)));
if (csv.has("location"))
prc.addBodySite().setText(csv.cell("location"));
bnd.addEntry().setResource(prc);
}
System.out.println(Integer.toString(t)+" found");
csv.close();
new JsonParser().setOutputStyle(OutputStyle.PRETTY).compose(new FileOutputStream(dest), bnd);
}
private void processOutputEvents(String src, String dest) throws FileNotFoundException, IOException {
System.out.print("Processing Output Events... ");
CSVReader csv = new CSVReader(new FileInputStream(src));
Bundle bnd = new Bundle();
bnd.setId("output-events");
bnd.setType(BundleType.COLLECTION);
bnd.setTimestamp(date);
csv.readHeaders();
int t = 0;
while (csv.line()) {
t++;
Patient pat = patients.get(csv.cell("subject_id"));
Encounter enc = encounters.get(csv.cell("hadm_id"));
Item spec = items.get(csv.cell("itemid"));
String loinc = ini.getStringProperty("outputs", csv.cell("itemid"));
if (loinc != null) {
if (!loinc.equals("n/a")) {
String value = null;
if (loinc.contains(";")) {
String[] p = loinc.split("\\;");
value=p[1].trim();
loinc = p[0];
}
Observation obs = new Observation();
obs.setId(csv.cell("row_id"));
obs.setStatus(ObservationStatus.FINAL);
obs.addCategory().addCoding().setSystem("http://mimic.physionet.org/fhir/categories").setCode("output");
if (pat != null) {
obs.setSubject(new Reference("Patient/"+pat.getId()));
}
if (enc != null) {
obs.setEncounter(new Reference("Encounter/"+enc.getId()));
}
obs.setEffective(readDateTime(csv.cell("charttime")));
if (spec != null) {
obs.setCode(new CodeableConcept(loincCoding(loinc)).setText(spec.label));
obs.getCode().addCoding().setSystem("http://mimic.physionet.org/fhir/outputs").setCode(csv.cell("itemid"));
}
if (value != null) {
obs.setValue(new CodeableConcept().setText(value));
} else {
Quantity qty = parseQuantity(csv.cell("value"), "valueuom");
obs.setValue(qty);
}
obs.setIssuedElement(readInstant(csv.cell("storetime")));
PractitionerRole prr = careGivers.get(csv.cell("cgid"));
if (prr != null)
obs.addPerformer().setReference("PractitionerRole/"+prr.getId());
bnd.addEntry().setResource(obs);
}
} else {
throw new Error("No LOINC code for output event "+csv.cell("itemid")+" ("+(spec == null ? "n/a" : spec.label)+"="+csv.cell("value")+")");
}
}
System.out.println(Integer.toString(t)+" found");
csv.close();
new JsonParser().setOutputStyle(OutputStyle.PRETTY).compose(new FileOutputStream(dest), bnd);
}
private void processChartEvents(String src, String dest) throws FileNotFoundException, IOException {
System.out.print("Processing Chart Events... ");
CSVReader csv = new CSVReader(new FileInputStream(src));
Bundle bnd = new Bundle();
bnd.setId("chart-events");
bnd.setType(BundleType.COLLECTION);
bnd.setTimestamp(date);
csv.readHeaders();
int t = 0;
while (csv.line()) {
t++;
Patient pat = patients.get(csv.cell("subject_id"));
Encounter enc = encounters.get(csv.cell("hadm_id"));
Item spec = items.get(csv.cell("itemid"));
if (spec != null) {
Observation obs = new Observation();
obs.setId(csv.cell("row_id"));
obs.setStatus(ObservationStatus.FINAL);
obs.addCategory().addCoding().setSystem("http://mimic.physionet.org/fhir/categories").setCode("chart");
if (pat != null) {
obs.setSubject(new Reference("Patient/"+pat.getId()));
}
if (enc != null) {
obs.setEncounter(new Reference("Encounter/"+enc.getId()));
}
obs.setEffective(readDateTime(csv.cell("charttime")));
obs.getCode().setText(spec.label).addCoding().setSystem("http://mimic.physionet.org/fhir/outputs").setCode(csv.cell("itemid"));
String loinc = ini.getStringProperty("chartevents", csv.cell("itemid"));
String value = null;
if (!Utilities.noString(loinc)) {
if (loinc.contains(";")) {
String[] p = loinc.split("\\;");
value=p[1].trim();
loinc = p[0];
}
obs.getCode().addCoding(loincCoding(loinc));
}
if (value != null) {
obs.setValue(new CodeableConcept().setText(value));
} else if (csv.has("valuenum")) {
Quantity qty = parseQuantity(csv.cell("valuenum"), "valueuom");
obs.setValue(qty);
} else {
obs.setValue(new CodeableConcept().setText(csv.cell("value")));
}
obs.setIssuedElement(readInstant(csv.cell("storetime")));
PractitionerRole prr = careGivers.get(csv.cell("cgid"));
if (prr != null)
obs.addPerformer().setReference("PractitionerRole/"+prr.getId());
bnd.addEntry().setResource(obs);
}
}
System.out.println(Integer.toString(t)+" found");
csv.close();
new JsonParser().setOutputStyle(OutputStyle.PRETTY).compose(new FileOutputStream(dest), bnd);
}
private Coding loincCoding(String loinc) {
Coding c = new Coding();
String[] p = loinc.split("\\#");
c.setSystem(p[0]);
p = p[1].split("\\:");
c.setCode(p[0]);
c.setDisplay(p[1].trim());
return c;
}
private Type parseQuantityRange(String cell, String uom) {
if (!Utilities.noString(cell) && cell.contains("-")) {
String[] p = cell.split("\\-");
Range rng = new Range();
rng.setLow(parseQuantity(p[0], uom));
rng.setHigh(parseQuantity(p[1], uom));
return rng;
} else
return parseQuantity(cell, uom);
}
private Quantity parseQuantity(String cell, String uom) {
if (Utilities.noString(cell))
return null;
Quantity qty = parseQuantity(cell);
if (!Utilities.noString(uom)) {
qty.setUnit(uom);
if (ucum.validate(uom) == null) {
qty.setCode(uom);
qty.setSystem("http://unitsofmeasure.org");
}
}
return qty;
}
private Quantity parseQuantity(String cell) {
if (cell.startsWith("<=")) { if (cell.startsWith("<=")) {
return new Quantity().setComparator(QuantityComparator.LESS_OR_EQUAL).setValue(new BigDecimal(cell.substring(2))); return new Quantity().setComparator(QuantityComparator.LESS_OR_EQUAL).setValue(new BigDecimal(cell.substring(2)));
} }
@ -645,7 +908,7 @@ public class Mimic14Importer {
return new Quantity().setComparator(QuantityComparator.GREATER_THAN).setValue(new BigDecimal(cell.substring(2))); return new Quantity().setComparator(QuantityComparator.GREATER_THAN).setValue(new BigDecimal(cell.substring(2)));
} }
if (!Utilities.isDecimal(cell, true)) { if (!Utilities.isDecimal(cell, true)) {
throw new Error("Not a valid decimal: "+cell); throw new FHIRException("Not a valid decimal: "+cell);
} }
return new Quantity().setValue(new BigDecimal(cell)); return new Quantity().setValue(new BigDecimal(cell));
@ -734,15 +997,26 @@ public class Mimic14Importer {
private DateType readDate(String cell) { private DateType readDate(String cell) {
if (Utilities.noString(cell))
return null;
String src = cell.substring(0, 10); String src = cell.substring(0, 10);
return new DateType(src); return new DateType(src);
} }
private DateTimeType readDateTime(String cell) { private DateTimeType readDateTime(String cell) {
if (Utilities.noString(cell))
return null;
String src = cell.replace(" ", "T"); String src = cell.replace(" ", "T");
if (src.endsWith("00:00:00")) if (src.endsWith("00:00:00"))
src = cell.substring(0, 10); src = cell.substring(0, 10);
return new DateTimeType(src); return new DateTimeType(src);
} }
private InstantType readInstant(String cell) {
if (Utilities.noString(cell))
return null;
String src = cell.replace(" ", "T");
return new InstantType(src);
}
} }

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r5.test; package org.hl7.fhir.r5.test.utils;
/*- /*-
* #%L * #%L

View File

@ -17,6 +17,7 @@ import org.hl7.fhir.r5.elementmodel.Element;
import org.hl7.fhir.r5.elementmodel.Manager; import org.hl7.fhir.r5.elementmodel.Manager;
import org.hl7.fhir.r5.elementmodel.Manager.FhirFormat; import org.hl7.fhir.r5.elementmodel.Manager.FhirFormat;
import org.hl7.fhir.r5.formats.IParser.OutputStyle; import org.hl7.fhir.r5.formats.IParser.OutputStyle;
import org.hl7.fhir.r5.test.utils.TestingUtilities;
import org.hl7.fhir.r5.utils.FHIRPathEngine; import org.hl7.fhir.r5.utils.FHIRPathEngine;
import org.hl7.fhir.utilities.cache.PackageCacheManager; import org.hl7.fhir.utilities.cache.PackageCacheManager;
import org.hl7.fhir.utilities.cache.ToolsVersion; import org.hl7.fhir.utilities.cache.ToolsVersion;

View File

@ -26,6 +26,7 @@ import org.hl7.fhir.r5.model.StructureDefinition;
import org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind; import org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind;
import org.hl7.fhir.r5.model.StructureMap; import org.hl7.fhir.r5.model.StructureMap;
import org.hl7.fhir.r5.terminologies.ConceptMapEngine; import org.hl7.fhir.r5.terminologies.ConceptMapEngine;
import org.hl7.fhir.r5.test.utils.TestingUtilities;
import org.hl7.fhir.r5.utils.StructureMapUtilities; import org.hl7.fhir.r5.utils.StructureMapUtilities;
import org.hl7.fhir.r5.utils.StructureMapUtilities.ITransformerServices; import org.hl7.fhir.r5.utils.StructureMapUtilities.ITransformerServices;
import org.hl7.fhir.utilities.TextFile; import org.hl7.fhir.utilities.TextFile;

View File

@ -25,6 +25,7 @@ import org.hl7.fhir.r5.model.Quantity;
import org.hl7.fhir.r5.model.Resource; import org.hl7.fhir.r5.model.Resource;
import org.hl7.fhir.r5.model.TypeDetails; import org.hl7.fhir.r5.model.TypeDetails;
import org.hl7.fhir.r5.model.ValueSet; import org.hl7.fhir.r5.model.ValueSet;
import org.hl7.fhir.r5.test.utils.TestingUtilities;
import org.hl7.fhir.r5.utils.FHIRPathEngine; import org.hl7.fhir.r5.utils.FHIRPathEngine;
import org.hl7.fhir.r5.utils.FHIRPathEngine.IEvaluationContext; import org.hl7.fhir.r5.utils.FHIRPathEngine.IEvaluationContext;
import org.hl7.fhir.utilities.Utilities; import org.hl7.fhir.utilities.Utilities;

View File

@ -9,6 +9,7 @@ import org.hl7.fhir.r5.model.Bundle;
import org.hl7.fhir.r5.model.Bundle.BundleEntryComponent; import org.hl7.fhir.r5.model.Bundle.BundleEntryComponent;
import org.hl7.fhir.r5.model.Bundle.BundleLinkComponent; import org.hl7.fhir.r5.model.Bundle.BundleLinkComponent;
import org.hl7.fhir.r5.model.Bundle.SearchEntryMode; import org.hl7.fhir.r5.model.Bundle.SearchEntryMode;
import org.hl7.fhir.r5.test.utils.TestingUtilities;
import org.hl7.fhir.r5.model.DomainResource; import org.hl7.fhir.r5.model.DomainResource;
import org.hl7.fhir.r5.model.Resource; import org.hl7.fhir.r5.model.Resource;
import org.hl7.fhir.r5.utils.GraphQLEngine; import org.hl7.fhir.r5.utils.GraphQLEngine;

View File

@ -7,6 +7,7 @@ import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.hl7.fhir.r5.test.utils.TestingUtilities;
import org.hl7.fhir.utilities.TextFile; import org.hl7.fhir.utilities.TextFile;
import org.hl7.fhir.utilities.Utilities; import org.hl7.fhir.utilities.Utilities;
import org.hl7.fhir.utilities.graphql.EGraphEngine; import org.hl7.fhir.utilities.graphql.EGraphEngine;

View File

@ -14,6 +14,7 @@ import org.hl7.fhir.exceptions.FHIRFormatError;
import org.hl7.fhir.r5.context.SimpleWorkerContext; import org.hl7.fhir.r5.context.SimpleWorkerContext;
import org.hl7.fhir.r5.formats.XmlParser; import org.hl7.fhir.r5.formats.XmlParser;
import org.hl7.fhir.r5.model.Resource; import org.hl7.fhir.r5.model.Resource;
import org.hl7.fhir.r5.test.utils.TestingUtilities;
import org.hl7.fhir.r5.utils.LiquidEngine; import org.hl7.fhir.r5.utils.LiquidEngine;
import org.hl7.fhir.r5.utils.LiquidEngine.ILiquidEngineIcludeResolver; import org.hl7.fhir.r5.utils.LiquidEngine.ILiquidEngineIcludeResolver;
import org.hl7.fhir.r5.utils.LiquidEngine.LiquidDocument; import org.hl7.fhir.r5.utils.LiquidEngine.LiquidDocument;

View File

@ -11,6 +11,7 @@ import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.r5.context.SimpleWorkerContext; import org.hl7.fhir.r5.context.SimpleWorkerContext;
import org.hl7.fhir.r5.formats.XmlParser; import org.hl7.fhir.r5.formats.XmlParser;
import org.hl7.fhir.r5.model.DomainResource; import org.hl7.fhir.r5.model.DomainResource;
import org.hl7.fhir.r5.test.utils.TestingUtilities;
import org.hl7.fhir.r5.utils.EOperationOutcome; import org.hl7.fhir.r5.utils.EOperationOutcome;
import org.hl7.fhir.r5.utils.NarrativeGenerator; import org.hl7.fhir.r5.utils.NarrativeGenerator;
import org.hl7.fhir.utilities.Utilities; import org.hl7.fhir.utilities.Utilities;

View File

@ -11,6 +11,7 @@ import org.hl7.fhir.r5.formats.JsonParser;
import org.hl7.fhir.r5.model.CapabilityStatement; import org.hl7.fhir.r5.model.CapabilityStatement;
import org.hl7.fhir.r5.openapi.OpenApiGenerator; import org.hl7.fhir.r5.openapi.OpenApiGenerator;
import org.hl7.fhir.r5.openapi.Writer; import org.hl7.fhir.r5.openapi.Writer;
import org.hl7.fhir.r5.test.utils.TestingUtilities;
import org.hl7.fhir.utilities.xml.XMLUtil; import org.hl7.fhir.utilities.xml.XMLUtil;
import org.junit.Test; import org.junit.Test;
import org.w3c.dom.Document; import org.w3c.dom.Document;

View File

@ -16,6 +16,7 @@ import org.hl7.fhir.r5.model.Base;
import org.hl7.fhir.r5.model.ElementDefinition; import org.hl7.fhir.r5.model.ElementDefinition;
import org.hl7.fhir.r5.model.StructureDefinition; import org.hl7.fhir.r5.model.StructureDefinition;
import org.hl7.fhir.r5.model.StructureDefinition.TypeDerivationRule; import org.hl7.fhir.r5.model.StructureDefinition.TypeDerivationRule;
import org.hl7.fhir.r5.test.utils.TestingUtilities;
import org.hl7.fhir.r5.utils.EOperationOutcome; import org.hl7.fhir.r5.utils.EOperationOutcome;
import org.hl7.fhir.utilities.CSFile; import org.hl7.fhir.utilities.CSFile;
import org.hl7.fhir.utilities.Utilities; import org.hl7.fhir.utilities.Utilities;

View File

@ -19,6 +19,7 @@ import org.hl7.fhir.r5.formats.XmlParser;
import org.hl7.fhir.r5.model.Bundle; import org.hl7.fhir.r5.model.Bundle;
import org.hl7.fhir.r5.model.DomainResource; import org.hl7.fhir.r5.model.DomainResource;
import org.hl7.fhir.r5.model.Resource; import org.hl7.fhir.r5.model.Resource;
import org.hl7.fhir.r5.test.utils.TestingUtilities;
import org.hl7.fhir.r5.utils.EOperationOutcome; import org.hl7.fhir.r5.utils.EOperationOutcome;
import org.hl7.fhir.r5.utils.NarrativeGenerator; import org.hl7.fhir.r5.utils.NarrativeGenerator;
import org.hl7.fhir.utilities.Utilities; import org.hl7.fhir.utilities.Utilities;

View File

@ -12,6 +12,7 @@ import org.hl7.fhir.r5.conformance.ShExGenerator;
import org.hl7.fhir.r5.conformance.ShExGenerator.HTMLLinkPolicy; import org.hl7.fhir.r5.conformance.ShExGenerator.HTMLLinkPolicy;
import org.hl7.fhir.r5.context.SimpleWorkerContext; import org.hl7.fhir.r5.context.SimpleWorkerContext;
import org.hl7.fhir.r5.model.StructureDefinition; import org.hl7.fhir.r5.model.StructureDefinition;
import org.hl7.fhir.r5.test.utils.TestingUtilities;
import org.hl7.fhir.utilities.TextFile; import org.hl7.fhir.utilities.TextFile;
import org.junit.Test; import org.junit.Test;

View File

@ -43,6 +43,7 @@ import org.hl7.fhir.r5.model.TestScript.TestActionComponent;
import org.hl7.fhir.r5.model.TestScript.TestScriptFixtureComponent; import org.hl7.fhir.r5.model.TestScript.TestScriptFixtureComponent;
import org.hl7.fhir.r5.model.TestScript.TestScriptTestComponent; import org.hl7.fhir.r5.model.TestScript.TestScriptTestComponent;
import org.hl7.fhir.r5.test.SnapShotGenerationTests.TestFetchMode; import org.hl7.fhir.r5.test.SnapShotGenerationTests.TestFetchMode;
import org.hl7.fhir.r5.test.utils.TestingUtilities;
import org.hl7.fhir.r5.model.TypeDetails; import org.hl7.fhir.r5.model.TypeDetails;
import org.hl7.fhir.r5.model.ValueSet; import org.hl7.fhir.r5.model.ValueSet;
import org.hl7.fhir.r5.utils.CodingUtilities; import org.hl7.fhir.r5.utils.CodingUtilities;

View File

@ -12,6 +12,7 @@ import org.hl7.fhir.r5.context.SimpleWorkerContext;
import org.hl7.fhir.r5.model.Base; import org.hl7.fhir.r5.model.Base;
import org.hl7.fhir.r5.model.Coding; import org.hl7.fhir.r5.model.Coding;
import org.hl7.fhir.r5.model.StructureMap; import org.hl7.fhir.r5.model.StructureMap;
import org.hl7.fhir.r5.test.utils.TestingUtilities;
import org.hl7.fhir.r5.utils.EOperationOutcome; import org.hl7.fhir.r5.utils.EOperationOutcome;
import org.hl7.fhir.r5.utils.StructureMapUtilities; import org.hl7.fhir.r5.utils.StructureMapUtilities;
import org.hl7.fhir.r5.utils.StructureMapUtilities.ITransformerServices; import org.hl7.fhir.r5.utils.StructureMapUtilities.ITransformerServices;

View File

@ -3,6 +3,7 @@ package org.hl7.fhir.r5.test;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.io.IOException; import java.io.IOException;
import org.hl7.fhir.r5.test.utils.TestingUtilities;
import org.hl7.fhir.r5.utils.formats.Turtle; import org.hl7.fhir.r5.utils.formats.Turtle;
import org.hl7.fhir.utilities.TextFile; import org.hl7.fhir.utilities.TextFile;
import org.hl7.fhir.utilities.Utilities; import org.hl7.fhir.utilities.Utilities;

View File

@ -44,7 +44,7 @@ import org.hl7.fhir.r5.formats.IParser.OutputStyle;
import org.hl7.fhir.r5.formats.JsonParser; import org.hl7.fhir.r5.formats.JsonParser;
import org.hl7.fhir.r5.formats.XmlParser; import org.hl7.fhir.r5.formats.XmlParser;
import org.hl7.fhir.r5.model.Resource; import org.hl7.fhir.r5.model.Resource;
import org.hl7.fhir.r5.test.TestingUtilities; import org.hl7.fhir.r5.test.utils.TestingUtilities;
public class ResourceTest { public class ResourceTest {

View File

@ -12,7 +12,7 @@ import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.exceptions.FHIRFormatError; import org.hl7.fhir.exceptions.FHIRFormatError;
import org.hl7.fhir.r5.context.SimpleWorkerContext; import org.hl7.fhir.r5.context.SimpleWorkerContext;
import org.hl7.fhir.r5.model.StructureMap; import org.hl7.fhir.r5.model.StructureMap;
import org.hl7.fhir.r5.test.TestingUtilities; import org.hl7.fhir.r5.test.utils.TestingUtilities;
import org.hl7.fhir.r5.utils.StructureMapUtilities; import org.hl7.fhir.r5.utils.StructureMapUtilities;
import org.hl7.fhir.utilities.TextFile; import org.hl7.fhir.utilities.TextFile;
import org.hl7.fhir.utilities.Utilities; import org.hl7.fhir.utilities.Utilities;

View File

@ -22,7 +22,7 @@ import com.google.gson.JsonObject;
public class PackageHacker { public class PackageHacker {
public static void main(String[] args) throws FileNotFoundException, IOException { public static void main(String[] args) throws FileNotFoundException, IOException {
new PackageHacker().edit("C:\\web\\hl7.org\\fhir\\us\\qicore\\STU2\\package.tgz"); new PackageHacker().edit("C:\\work\\fhir.org\\web-source\\source\\guides\\argonaut\\questionnaire\\package.tgz");
} }
private void edit(String name) throws FileNotFoundException, IOException { private void edit(String name) throws FileNotFoundException, IOException {
@ -54,8 +54,8 @@ public class PackageHacker {
} }
private void change(JsonObject npm, Map<String, byte[]> content) { private void change(JsonObject npm, Map<String, byte[]> content) {
npm.remove("version"); npm.remove("name");
npm.addProperty("version", "2.0.0"); npm.addProperty("name", "fhir.argonaut.questionnaire");
// JsonArray fhirVersions = new JsonArray(); // JsonArray fhirVersions = new JsonArray();
// fhirVersions.add("1.9.0"); // fhirVersions.add("1.9.0");
// npm.add("fhirVersions", fhirVersions); // npm.add("fhirVersions", fhirVersions);

View File

@ -1,7 +1,7 @@
package org.hl7.fhir.validation.tests; package org.hl7.fhir.validation.tests;
import org.hl7.fhir.r4.context.SimpleWorkerContext; import org.hl7.fhir.r4.context.SimpleWorkerContext;
import org.hl7.fhir.r5.test.TestingUtilities; import org.hl7.fhir.r5.test.utils.TestingUtilities;
import org.hl7.fhir.r5.validation.Validator; import org.hl7.fhir.r5.validation.Validator;
import org.hl7.fhir.validation.tests.utilities.TestUtilities; import org.hl7.fhir.validation.tests.utilities.TestUtilities;
import org.junit.Test; import org.junit.Test;

View File

@ -1,6 +1,6 @@
package org.hl7.fhir.validation.tests; package org.hl7.fhir.validation.tests;
import org.hl7.fhir.r5.test.TestingUtilities; import org.hl7.fhir.r5.test.utils.TestingUtilities;
import org.hl7.fhir.r5.validation.NativeHostServices; import org.hl7.fhir.r5.validation.NativeHostServices;
import org.hl7.fhir.utilities.TextFile; import org.hl7.fhir.utilities.TextFile;
import org.hl7.fhir.validation.tests.utilities.TestUtilities; import org.hl7.fhir.validation.tests.utilities.TestUtilities;

View File

@ -10,7 +10,7 @@ import org.hl7.fhir.r5.model.OperationOutcome;
import org.hl7.fhir.r5.model.StructureDefinition; import org.hl7.fhir.r5.model.StructureDefinition;
import org.hl7.fhir.r5.utils.KeyGenerator; import org.hl7.fhir.r5.utils.KeyGenerator;
import org.hl7.fhir.r5.model.OperationOutcome.OperationOutcomeIssueComponent; import org.hl7.fhir.r5.model.OperationOutcome.OperationOutcomeIssueComponent;
import org.hl7.fhir.r5.test.TestingUtilities; import org.hl7.fhir.r5.test.utils.TestingUtilities;
import org.hl7.fhir.r5.validation.ValidationEngine; import org.hl7.fhir.r5.validation.ValidationEngine;
import org.hl7.fhir.validation.tests.utilities.TestUtilities; import org.hl7.fhir.validation.tests.utilities.TestUtilities;
import org.junit.Assert; import org.junit.Assert;

View File

@ -9,7 +9,7 @@ import org.hl7.fhir.r5.model.FhirPublication;
import org.hl7.fhir.r5.model.OperationOutcome; import org.hl7.fhir.r5.model.OperationOutcome;
import org.hl7.fhir.r5.model.OperationOutcome.IssueSeverity; import org.hl7.fhir.r5.model.OperationOutcome.IssueSeverity;
import org.hl7.fhir.r5.model.OperationOutcome.OperationOutcomeIssueComponent; import org.hl7.fhir.r5.model.OperationOutcome.OperationOutcomeIssueComponent;
import org.hl7.fhir.r5.test.TestingUtilities; import org.hl7.fhir.r5.test.utils.TestingUtilities;
import org.hl7.fhir.r5.validation.ValidationEngine; import org.hl7.fhir.r5.validation.ValidationEngine;
import org.hl7.fhir.utilities.Utilities; import org.hl7.fhir.utilities.Utilities;
import org.hl7.fhir.validation.tests.utilities.TestUtilities; import org.hl7.fhir.validation.tests.utilities.TestUtilities;

View File

@ -21,7 +21,7 @@ import org.hl7.fhir.r5.elementmodel.ObjectConverter;
import org.hl7.fhir.r5.formats.JsonParser; import org.hl7.fhir.r5.formats.JsonParser;
import org.hl7.fhir.r5.formats.XmlParser; import org.hl7.fhir.r5.formats.XmlParser;
import org.hl7.fhir.r5.model.*; import org.hl7.fhir.r5.model.*;
import org.hl7.fhir.r5.test.TestingUtilities; import org.hl7.fhir.r5.test.utils.TestingUtilities;
import org.hl7.fhir.r5.utils.FHIRPathEngine.IEvaluationContext; import org.hl7.fhir.r5.utils.FHIRPathEngine.IEvaluationContext;
import org.hl7.fhir.r5.utils.IResourceValidator; import org.hl7.fhir.r5.utils.IResourceValidator;
import org.hl7.fhir.r5.utils.IResourceValidator.IValidatorResourceFetcher; import org.hl7.fhir.r5.utils.IResourceValidator.IValidatorResourceFetcher;