From fef2f68109ca3cef3432dde14d2b9232d361bae4 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Tue, 25 Jul 2023 15:43:01 -0400 Subject: [PATCH 01/78] bump gradle wrapper version to 8.2.1 --- README.md | 2 +- build.gradle | 4 ++-- gradle/wrapper/gradle-wrapper.properties | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ef51acf8e9..1ef3859678 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ These instructions are intended for those wishing to examine the Synthea source ### Installation **System Requirements:** -SyntheaTM requires Java 11 or newer. +SyntheaTM requires Java JDK 11 or newer, and is tested to work with up to Java 19. To clone the SyntheaTM repo, then build and run the test suite: ``` diff --git a/build.gradle b/build.gradle index 302a51c1d9..0079a6ae0b 100644 --- a/build.gradle +++ b/build.gradle @@ -325,12 +325,12 @@ run { } task sourceJar(type: Jar) { - classifier "sources" + archiveClassifier = "sources" from sourceSets.main.allJava } task javadocJar(type: Jar, dependsOn: javadoc) { - classifier "javadoc" + archiveClassifier = "javadoc" from javadoc.destinationDir } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 2e6e5897b5..84a0b92f9a 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From 1c051befd3847d2355c73f70871efd269c9a218f Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Tue, 7 Jun 2022 12:09:20 -0400 Subject: [PATCH 02/78] initial public commit of 'flexible exporter' aka flexporter --- build.gradle | 23 +- run_flexporter | 18 + src/main/java/RunFlexporter.java | 147 + .../org/mitre/synthea/export/Exporter.java | 20 +- .../synthea/export/flexporter/Actions.java | 353 + .../CustomFHIRPathResourceGeneratorR4.java | 685 + .../export/flexporter/FhirPathUtils.java | 81 + .../synthea/export/flexporter/Mapping.java | 28 + .../export/flexporter/ValueTransforms.java | 110 + .../export/flexporter/ActionsTest.java | 340 + ...CustomFHIRPathResourceGeneratorR4Test.java | 188 + .../export/flexporter/FhirPathUtilsTest.java | 103 + .../flexporter/sample_complete_patient.json | 24158 ++++++++++++++++ .../resources/flexporter/test_mapping.yaml | 135 + 14 files changed, 26381 insertions(+), 8 deletions(-) create mode 100755 run_flexporter create mode 100644 src/main/java/RunFlexporter.java create mode 100644 src/main/java/org/mitre/synthea/export/flexporter/Actions.java create mode 100644 src/main/java/org/mitre/synthea/export/flexporter/CustomFHIRPathResourceGeneratorR4.java create mode 100644 src/main/java/org/mitre/synthea/export/flexporter/FhirPathUtils.java create mode 100644 src/main/java/org/mitre/synthea/export/flexporter/Mapping.java create mode 100644 src/main/java/org/mitre/synthea/export/flexporter/ValueTransforms.java create mode 100644 src/test/java/org/mitre/synthea/export/flexporter/ActionsTest.java create mode 100644 src/test/java/org/mitre/synthea/export/flexporter/CustomFHIRPathResourceGeneratorR4Test.java create mode 100644 src/test/java/org/mitre/synthea/export/flexporter/FhirPathUtilsTest.java create mode 100644 src/test/resources/flexporter/sample_complete_patient.json create mode 100644 src/test/resources/flexporter/test_mapping.yaml diff --git a/build.gradle b/build.gradle index 302a51c1d9..d2826621e9 100644 --- a/build.gradle +++ b/build.gradle @@ -58,6 +58,11 @@ dependencies { implementation 'ca.uhn.hapi.fhir:hapi-fhir-structures-dstu2:6.1.0' implementation 'ca.uhn.hapi.fhir:hapi-fhir-structures-r4:6.1.0' implementation 'ca.uhn.hapi.fhir:hapi-fhir-client:6.1.0' + + implementation 'ca.uhn.hapi.fhir:hapi-fhir-validation:6.1.0' + implementation 'ca.uhn.hapi.fhir:hapi-fhir-validation-resources-r4:6.1.0' + implementation 'ca.uhn.hapi.fhir:hapi-fhir-validation-resources-dstu3:6.1.0' + implementation 'ca.uhn.hapi.fhir:hapi-fhir-validation-resources-dstu2:6.1.0' // C-CDA export uses Apache FreeMarker templates implementation 'org.freemarker:freemarker:2.3.31' @@ -123,10 +128,6 @@ dependencies { testImplementation 'org.powermock:powermock-module-junit4:2.0.9' testImplementation 'org.powermock:powermock-api-mockito2:2.0.9' testImplementation 'com.github.tomakehurst:wiremock-jre8:2.33.2' - testImplementation 'ca.uhn.hapi.fhir:hapi-fhir-validation:6.1.0' - testImplementation 'ca.uhn.hapi.fhir:hapi-fhir-validation-resources-r4:6.1.0' - testImplementation 'ca.uhn.hapi.fhir:hapi-fhir-validation-resources-dstu3:6.1.0' - testImplementation 'ca.uhn.hapi.fhir:hapi-fhir-validation-resources-dstu2:6.1.0' testImplementation 'com.helger:ph-schematron:5.6.5' testImplementation 'com.helger:ph-commons:9.5.5' testImplementation 'com.squareup.okhttp3:mockwebserver:4.10.0' @@ -178,6 +179,7 @@ task graphviz(type: JavaExec) { mainClass = "Graphviz" } + task rifMinimize(type: JavaExec) { group 'Application' description 'Filter exported RIF files to produce minimal set that covers all claim types' @@ -229,6 +231,19 @@ shadowJar { task uberJar() { } +task flexporter(type: JavaExec) { + group 'Application' + description 'Apply transformations to FHIR' + classpath sourceSets.main.runtimeClasspath + mainClass = "RunFlexporter" + // args are called "arams" because they are called with -P, + // ex. gradle run -Params="['arg1', 'args2']" + // see https://stackoverflow.com/questions/27604283/gradle-task-pass-arguments-to-java-application + if (project.hasProperty("arams")) { + args Eval.me(arams) + } +} + task concepts(type: JavaExec) { group 'Application' description 'Create a list of simulated concepts' diff --git a/run_flexporter b/run_flexporter new file mode 100755 index 0000000000..015c5d137f --- /dev/null +++ b/run_flexporter @@ -0,0 +1,18 @@ +#!/usr/bin/env sh + +############################################################################## +## +## Flexporter launcher for UN*X +## +############################################################################## + +ARGS= + +for arg in "$@" +do + ARGS=$ARGS\'$arg\', + # Trailing comma ok, don't need to remove it +done + +./gradlew flexporter -Params="[$ARGS]" + diff --git a/src/main/java/RunFlexporter.java b/src/main/java/RunFlexporter.java new file mode 100644 index 0000000000..74d07ab503 --- /dev/null +++ b/src/main/java/RunFlexporter.java @@ -0,0 +1,147 @@ +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.nio.file.DirectoryStream; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.StandardOpenOption; +import java.util.Arrays; +import java.util.LinkedList; +import java.util.Queue; + +import org.hl7.fhir.r4.model.Bundle; +import org.hl7.fhir.r4.model.Bundle.BundleEntryComponent; +import org.hl7.fhir.r4.model.Resource; +import org.mitre.synthea.export.flexporter.Actions; +import org.mitre.synthea.export.flexporter.FhirPathUtils; +import org.mitre.synthea.export.flexporter.Mapping; + +import ca.uhn.fhir.parser.IParser; + + +public class RunFlexporter { + public static void main(String[] args) throws Exception { + Queue argsQ = new LinkedList(Arrays.asList(args)); + + File igDirectory = null; + File sourceFile = null; + File mappingFile = null; + + while (!argsQ.isEmpty()) { + String currArg = argsQ.poll(); + + if (currArg.equals("-ig")) { + String value = argsQ.poll(); + + if (value == null) { + throw new FileNotFoundException("No implementation guide directory provided"); + } + + igDirectory = new File(value); + + if (!igDirectory.isDirectory()) { + throw new FileNotFoundException(String.format( + "Specified implementation guide directory (%s) does not exist or is not a directory", + value)); + } else if (isDirEmpty(igDirectory.toPath())) { + throw new FileNotFoundException( + String.format("Specified implementation guide directory (%s) is empty", value)); + } + } + + else if (currArg.equals("-m")) { + String value = argsQ.poll(); + + if (value == null) { + throw new FileNotFoundException("No mapping file provided"); + } + + mappingFile = new File(value); + + if (!mappingFile.exists()) { + throw new FileNotFoundException( + String.format("Specified mapping file (%s) does not exist", value)); + } + } + + else if (currArg.equals("-s")) { + String value = argsQ.poll(); + sourceFile = new File(value); + + if (value == null) { + throw new FileNotFoundException("No Synthea source FHIR provided"); + } + + if (!sourceFile.exists()) { + throw new FileNotFoundException( + String.format("Specified Synthea source FHIR (%s) does not exist", value)); + } + } + } + + if (mappingFile == null || sourceFile == null) { + usage(); + System.exit(1); + } + + convertFhir(mappingFile, igDirectory, sourceFile); + } + + public static void convertFhir(File mappingFile, File igDirectory, File sourceFhir) + throws IOException { + + Mapping mapping = Mapping.parseMapping(mappingFile); + + IParser parser = FhirPathUtils.FHIR_CTX.newJsonParser().setPrettyPrint(true); + + if (sourceFhir.isDirectory()) { + + // TODO + + } else { + String fhirJson = new String(Files.readAllBytes(sourceFhir.toPath())); + Bundle bundle = parser.parseResource(Bundle.class, fhirJson); + + for (BundleEntryComponent bec : bundle.getEntry()) { + Resource r = bec.getResource(); + if (r.getId().startsWith("urn:uuid:")) { + // HAPI does some weird stuff with IDs + // by default in Synthea they are just plain UUIDs + // and the entry.fullUrl is urn:uuid:(id) + // but somehow when they get parsed back in, the id is urn:uuid:etc + // which then doesn't get written back out at the end + // so this removes the "urn:uuid:" bit if it got added + r.setId(r.getId().substring(9)); + } + } + + // bundle is modified in-place + convertFhir(bundle, mapping); + + String bundleJson = parser.encodeResourceToString(bundle); + + File outFile = + new File("./output/" + System.currentTimeMillis() + "_" + sourceFhir.getName()); + + Files.write(outFile.toPath(), bundleJson.getBytes(), StandardOpenOption.CREATE_NEW); + + System.out.println("Wrote " + outFile); + } + } + + public static Bundle convertFhir(Bundle bundle, Mapping mapping) { + Actions.applyMapping(bundle, mapping, null); + + return bundle; + } + + private static boolean isDirEmpty(final Path directory) throws IOException { + try (DirectoryStream dirStream = Files.newDirectoryStream(directory)) { + return !dirStream.iterator().hasNext(); + } + } + + private static void usage() { + System.out.println("Usage: run_flexporter -m MAPPING_FILE -s SOURCE_FHIR [-i IG_FOLDER]"); + } +} diff --git a/src/main/java/org/mitre/synthea/export/Exporter.java b/src/main/java/org/mitre/synthea/export/Exporter.java index ca3e9f8852..7e35107317 100644 --- a/src/main/java/org/mitre/synthea/export/Exporter.java +++ b/src/main/java/org/mitre/synthea/export/Exporter.java @@ -1,7 +1,6 @@ package org.mitre.synthea.export; import ca.uhn.fhir.parser.IParser; - import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; @@ -24,6 +23,8 @@ import org.apache.commons.lang3.tuple.Pair; import org.mitre.synthea.engine.Generator; +import org.mitre.synthea.export.flexporter.Actions; +import org.mitre.synthea.export.flexporter.Mapping; import org.mitre.synthea.export.rif.BB2RIFExporter; import org.mitre.synthea.helpers.Config; import org.mitre.synthea.helpers.Utilities; @@ -68,6 +69,7 @@ public static class ExporterRuntimeOptions { !Config.get("generate.terminology_service_url", "").isEmpty(); private BlockingQueue recordQueue; private SupportedFhirVersion fhirVersion; + private List flexporterMappings; public ExporterRuntimeOptions() { yearsOfHistory = Integer.parseInt(Config.get("exporter.years_of_history")); @@ -227,9 +229,18 @@ private static boolean exportRecord(Person person, String fileTag, long stopTime } if (Config.getAsBoolean("exporter.fhir.export")) { File outDirectory = getOutputFolder("fhir", person); + org.hl7.fhir.r4.model.Bundle bundle = FhirR4.convertToFHIR(person, stopTime); + + if (options.flexporterMappings != null) { + for (Mapping mapping : options.flexporterMappings) { + // flexport on the bundle here + Actions.applyMapping(bundle, mapping, person); + } + } + + IParser parser = FhirR4.getContext().newJsonParser(); if (Config.getAsBoolean("exporter.fhir.bulk_data")) { - org.hl7.fhir.r4.model.Bundle bundle = FhirR4.convertToFHIR(person, stopTime); - IParser parser = FhirR4.getContext().newJsonParser().setPrettyPrint(false); + parser.setPrettyPrint(false); for (org.hl7.fhir.r4.model.Bundle.BundleEntryComponent entry : bundle.getEntry()) { String filename = entry.getResource().getResourceType().toString() + ".ndjson"; Path outFilePath = outDirectory.toPath().resolve(filename); @@ -237,7 +248,8 @@ private static boolean exportRecord(Person person, String fileTag, long stopTime appendToFile(outFilePath, entryJson); } } else { - String bundleJson = FhirR4.convertToFHIRJson(person, stopTime); + parser.setPrettyPrint(true); + String bundleJson = parser.encodeResourceToString(bundle); Path outFilePath = outDirectory.toPath().resolve(filename(person, fileTag, "json")); writeNewFile(outFilePath, bundleJson); } diff --git a/src/main/java/org/mitre/synthea/export/flexporter/Actions.java b/src/main/java/org/mitre/synthea/export/flexporter/Actions.java new file mode 100644 index 0000000000..bc07cd36d5 --- /dev/null +++ b/src/main/java/org/mitre/synthea/export/flexporter/Actions.java @@ -0,0 +1,353 @@ +package org.mitre.synthea.export.flexporter; + +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.UUID; + +import org.apache.commons.lang3.StringUtils; +import org.hl7.fhir.r4.model.Base; +import org.hl7.fhir.r4.model.Bundle; +import org.hl7.fhir.r4.model.Bundle.BundleEntryComponent; +import org.hl7.fhir.r4.model.Bundle.BundleEntryRequestComponent; +import org.hl7.fhir.r4.model.Bundle.BundleType; +import org.hl7.fhir.r4.model.Bundle.HTTPVerb; +import org.hl7.fhir.r4.model.Meta; +import org.hl7.fhir.r4.model.Resource; +import org.mitre.synthea.world.agents.Person; + +// For now +@SuppressWarnings("unchecked") +public abstract class Actions { + + public static void applyMapping(Bundle bundle, Mapping mapping, Person person) { + mapping.actions.forEach(action -> applyAction(bundle, action, person)); + } + + public static void applyAction(Bundle bundle, Map action, Person person) { + // TODO: this could be handled better but for now just key off a specific field in the action + + if (action.containsKey("profiles")) { + applyProfiles(bundle, (List>) action.get("profiles")); + } else if (action.containsKey("set_values")) { + setValues(bundle, (List>) action.get("set_values"), person); + } else if (action.containsKey("keep_resources")) { + keepResources(bundle, (List) action.get("keep_resources")); + } else if (action.containsKey("delete_resources")) { + deleteResources(bundle, (List) action.get("delete_resources")); + } else if (action.containsKey("create_resource")) { + createResource(bundle, (List>) action.get("create_resource"), person); + } + } + + + public static void applyProfiles(Bundle bundle, List> items) { + // TODO: might it be faster to loop over all the resources + // and check applicability for each item only once? + for (Map item : items) { + String applicability = item.get("applicability"); + String profile = item.get("profile"); + + List matchingResources = FhirPathUtils.evaluateBundle(bundle, applicability, true); + + for (Base match : matchingResources) { + if (match instanceof Resource) { + applyProfile((Resource) match, profile); + } + } + } + } + + private static void applyProfile(Resource resource, String profileURL) { + Meta meta = resource.getMeta(); + if (meta == null) { + meta = new Meta(); + resource.setMeta(meta); + } + if (!meta.hasProfile(profileURL)) { + meta.addProfile(profileURL); + } + } + + public static void setValues(Bundle bundle, List> items, Person person) { + for (Map entry : items) { + String applicability = (String) entry.get("applicability"); + List> fields = (List>) entry.get("fields"); + + List matchingResources = FhirPathUtils.evaluateBundle(bundle, applicability, true); + + for (Base match : matchingResources) { + if (match instanceof Resource) { + Map fhirPathMapping = + createFhirPathMapping(fields, bundle, (Resource) match, person); + + CustomFHIRPathResourceGeneratorR4 fhirPathgenerator = + new CustomFHIRPathResourceGeneratorR4<>(FhirPathUtils.FHIR_CTX); + fhirPathgenerator.setMapping(fhirPathMapping); + fhirPathgenerator.setResource((Resource) match); + + fhirPathgenerator.generateResource((Class) match.getClass()); + } + } + } + } + + + public static void createResource(Bundle bundle, List> resourcesToCreate, + Person person) { + // TODO: this is fundamentally similar to setValues, so extract common logic + + for (Map newResourceDef : resourcesToCreate) { + + String resourceType = (String) newResourceDef.get("resourceType"); + String basedOnPath = (String) newResourceDef.get("based_on"); + List profiles = (List) newResourceDef.get("profiles"); + + List basedOnResources; + List> writeback; + + if (basedOnPath == null) { + basedOnResources = Collections.singletonList(null); + writeback = null; + } else { + basedOnResources = FhirPathUtils.evaluateBundle(bundle, basedOnPath, true); + // this may return empty list, in which no new resources will be created + + writeback = (List>) newResourceDef.get("writeback"); + } + + List> fields = (List>) newResourceDef.get("fields"); + + for (Base basedOnItem : basedOnResources) { + // IMPORTANT: basedOnItem may be null + + Map fhirPathMapping = + createFhirPathMapping(fields, bundle, (Resource) basedOnItem, person); + + CustomFHIRPathResourceGeneratorR4 fhirPathgenerator = + new CustomFHIRPathResourceGeneratorR4<>(FhirPathUtils.FHIR_CTX); + fhirPathgenerator.setMapping(fhirPathMapping); + + try { + Class resourceClass = + (Class) Class.forName("org.hl7.fhir.r4.model." + resourceType); + + Resource createdResource = fhirPathgenerator.generateResource(resourceClass); + + // ensure the new resource has an ID + // seems like this should work as part of the fhirpathgenerator, but it didn't + // this might be easier anyway + createdResource.setId(UUID.randomUUID().toString()); + if (profiles != null) { + profiles.forEach(p -> applyProfile(createdResource, p)); + } + + // TODO: see if there's a good way to add the resource after the based-on resource + BundleEntryComponent newEntry = bundle.addEntry(); + + newEntry.setResource(createdResource); + + if (bundle.getType().equals(BundleType.TRANSACTION)) { + BundleEntryRequestComponent request = newEntry.getRequest(); + // as of now everything in synthea is POST to resourceType. + request.setMethod(HTTPVerb.POST); + request.setUrl(resourceType); + } + + if (writeback != null && !writeback.isEmpty()) { + Map writebackMapping = + createFhirPathMapping(writeback, bundle, createdResource, person); + + CustomFHIRPathResourceGeneratorR4 writebackGenerator = + new CustomFHIRPathResourceGeneratorR4<>(FhirPathUtils.FHIR_CTX); + writebackGenerator.setMapping(writebackMapping); + writebackGenerator.setResource((Resource) basedOnItem); + + writebackGenerator.generateResource((Class) basedOnItem.getClass()); + } + + } catch (ClassNotFoundException e) { + e.printStackTrace(); + } + } + } + } + + + private static Map createFhirPathMapping(List> fields, + Bundle sourceBundle, Resource sourceResource, Person person) { + Map fhirPathMapping = new HashMap<>(); + + for (Map field : fields) { + String location = field.get("location"); + String valueDef = field.get("value"); + String transform = field.get("transform"); + + if (valueDef == null || valueDef.isEmpty() || valueDef.equals("null")) { + valueDef = null; + } else if (valueDef.startsWith("$")) { + valueDef = getValue(sourceBundle, valueDef, sourceResource, person); + } // else - assume it's a raw value + + // TODO: consider a "skip-resource-if-null" kind of thing + // or "don't create this resource if the referenced field on the source resource is missing" + + if (transform != null) { + valueDef = ValueTransforms.apply(valueDef, transform); + } + + // TODO: the $getField option allows copying a single primitive value + // do we want to allow copying an entire object somehow? + + fhirPathMapping.put(location, valueDef); + } + + return fhirPathMapping; + } + + public static void keepResources(Bundle bundle, List list) { + // TODO: make this FHIRPath instead of just straight resource types + + Set resourceTypesToKeep = new HashSet<>(list); + + Set deletedResourceIDs = new HashSet<>(); + + Iterator itr = bundle.getEntry().iterator(); + + while (itr.hasNext()) { + BundleEntryComponent entry = itr.next(); + + Resource resource = entry.getResource(); + String resourceType = resource.getResourceType().toString(); + if (!resourceTypesToKeep.contains(resourceType)) { + deletedResourceIDs.add(resource.getId()); + itr.remove(); + } + } + + // TODO: additional passes for deleted resource IDs + } + + + public static void deleteResources(Bundle bundle, List list) { + // TODO: make this FHIRPath instead of just straight resource types + + Set resourceTypesToDelete = new HashSet<>(list); + + Set deletedResourceIDs = new HashSet<>(); + + Iterator itr = bundle.getEntry().iterator(); + + while (itr.hasNext()) { + BundleEntryComponent entry = itr.next(); + + Resource resource = entry.getResource(); + String resourceType = resource.getResourceType().toString(); + if (resourceTypesToDelete.contains(resourceType)) { + deletedResourceIDs.add(resource.getId()); + itr.remove(); + } + } + + // TODO: additional passes for deleted resource IDs + } + + + private static String getValue(Bundle bundle, String valueDef, Resource currentResource, + Person person) { + // The flag has the format of $flagName([flagValue1, flagValue2, ..., flagValueN]) + + String flag = StringUtils.substringBetween(valueDef, "$", "("); + String flagValue = StringUtils.substringBetween(valueDef, "([", "])"); + String[] flagValues = flagValue.split(","); + + + // basic naming scheme here is "set" and "get" refer to a particular resource + // (ie, the current one, or the resource a new one is being based on) + // and "find" refers to searching the entire bundle + if (flag.equals("setRef")) { + return setReference(currentResource, flagValues); + } else if (flag.equals("getField")) { + return getField(currentResource, flagValues); + } else if (flag.equals("findRef")) { + return findReference(bundle, flagValues); + } else if (flag.equals("findValue")) { + return findValues(bundle, flagValues); + } else if (flag.equals("getAttribute")) { + return getAttribute(person, flagValues); + } + + return null; + } + + private static String getAttribute(Person person, String... flagValues) { + // flagValues[0] = attribute name + // TODO: how to handle types that aren't just strings? + + // TODO: helpful error message if person == null + Object attribute = person.attributes.get(flagValues[0]); + + if (attribute == null) { + return null; + } + + return String.valueOf(attribute); + } + + private static String setReference(Resource currentResource, String... args) { + return createReference(currentResource); + } + + private static String createReference(Resource resource) { + // ids in FHIR are a little weird + // from some testing, ids in HAPI also seem to be a little flaky + String id = resource.getId(); + + if (id.startsWith("urn:uuid:")) + return id; + + return resource.getResourceType().toString() + "/" + id; + } + + private static String getField(Resource currentResource, String... args) { + // args[0] = FHIRPath, from this resource + // args[1] = how to disambiguate if there are multiple? TODO + + List fieldValues = FhirPathUtils.evaluateResource(currentResource, args[0]); + + if (fieldValues.isEmpty()) + return null; + + return fieldValues.get(0).primitiveValue(); + } + + + private static String findReference(Bundle bundle, String... flagValues) { + // args[0] = FHIRPath, find a resource in the bundle + // args[1] = how to disambiguate. ex "same-encounter" TODO + // note the challenge will be how to pick the "encounter" field on arbitrary resources + // when in doubt, use more fhirpath? + + List matchingResources = FhirPathUtils.evaluateBundle(bundle, flagValues[0], true); + + if (matchingResources.isEmpty()) + return null; + + return createReference((Resource) matchingResources.get(0)); + } + + private static String findValues(Bundle bundle, String... args) { + // args[0] = FHIRPath, from this resource + // args[1] = how to disambiguate if there are multiple? TODO + List fieldValues = FhirPathUtils.evaluateBundle(bundle, args[0], false); + + if (fieldValues.isEmpty()) + return null; + + return fieldValues.get(0).primitiveValue(); + } +} diff --git a/src/main/java/org/mitre/synthea/export/flexporter/CustomFHIRPathResourceGeneratorR4.java b/src/main/java/org/mitre/synthea/export/flexporter/CustomFHIRPathResourceGeneratorR4.java new file mode 100644 index 0000000000..220608116f --- /dev/null +++ b/src/main/java/org/mitre/synthea/export/flexporter/CustomFHIRPathResourceGeneratorR4.java @@ -0,0 +1,685 @@ +package org.mitre.synthea.export.flexporter; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Stack; + +import org.hl7.fhir.r4.utils.FHIRPathEngine; +import org.hl7.fhir.instance.model.api.IBase; +import org.hl7.fhir.instance.model.api.ICompositeType; +import org.hl7.fhir.instance.model.api.IPrimitiveType; +import org.hl7.fhir.r4.hapi.ctx.HapiWorkerContext; +import org.hl7.fhir.r4.model.ExpressionNode; +import org.hl7.fhir.r4.model.ExpressionNode.Kind; +import org.hl7.fhir.r4.model.Resource; + +import ca.uhn.fhir.context.BaseRuntimeChildDefinition; +import ca.uhn.fhir.context.BaseRuntimeElementDefinition; +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.context.RuntimeCompositeDatatypeDefinition; +import ca.uhn.fhir.context.RuntimePrimitiveDatatypeDefinition; +import ca.uhn.fhir.context.RuntimeResourceBlockDefinition; + +/** + * This class can be used to generate resources using FHIRPath expressions. + * + * Note that this is an experimental feature and the API is expected to change. Ideally this will be + * made version independent and moved out of the validation module in a future release. + * + * Modified for the Flexporter: + * -- allow adding to an existing resource + * -- add support for BackboneElements + * -- swapped constructors, pass in a FhirContext to avoid recreating it for each resource + * -- add support for extensions on primitives + * -- more advanced java generics (some functions now take in Class instead of just T + * -- reformatted per Synthea style guidelines + * + * Original: + * https://github.com/hapifhir/hapi-fhir/blob/master/hapi-fhir-validation/src/main/java/org/hl7/fhir/common/hapi/validation/validator/FHIRPathResourceGeneratorR4.java + * + * + * @author Marcel Parciak + * + */ +public class CustomFHIRPathResourceGeneratorR4 { + + private FhirContext ctx; + private FHIRPathEngine engine; + private Map pathMapping; + private T resource = null; + + private String valueToSet = null; + private Stack nodeStack = null; + + /** + * The GenerationTier summarizes some variables that are needed to create FHIR elements later on. + */ + class GenerationTier { + // The RuntimeDefinition of nodes + public BaseRuntimeElementDefinition nodeDefinition = null; + // The actual nodes, i.e. the instances that hold the values + public List nodes = new ArrayList<>(); + // The ChildDefinition applied to the parent (i.e. one of the nodes from a lower + // GenerationTier) to create nodes + public BaseRuntimeChildDefinition childDefinition = null; + // The path segment name of nodes + public String fhirPathName = null; + + public GenerationTier() {} + + public GenerationTier(BaseRuntimeElementDefinition nodeDef, IBase firstNode) { + this.nodeDefinition = nodeDef; + this.nodes.add(firstNode); + } + } + + /** + * Constructor without parameters, needs a call to `setMapping` later on in order to generate any + * Resources. + */ + public CustomFHIRPathResourceGeneratorR4() { + this(FhirContext.forR4()); + } + + public CustomFHIRPathResourceGeneratorR4(FhirContext fhirCtx) { + this.ctx = fhirCtx; + this.pathMapping = new HashMap(); + this.engine = new FHIRPathEngine(new HapiWorkerContext(ctx, ctx.getValidationSupport())); + } + + /** + * Setter for the FHIRPath mapping Map instance. + * + * @param mapping Map a mapping of FHIRPath to value Strings that will be used to + * create a Resource. + */ + public void setMapping(Map mapping) { + this.pathMapping = mapping; + } + + /** + * Getter for a generated Resource. null if no Resource has been generated yet. + * + * @return T the generated Resource or null. + */ + public T getResource() { + return this.resource; + } + + /** + * Getter for a generated Resource. null if no Resource has been generated yet. + * + * @return T the generated Resource or null. + */ + public void setResource(T resource) { + this.resource = resource; + } + + /** + * Prepares the internal state prior to generating a FHIR Resource. Called once upon generation at + * the start. + * + * @param resourceClass Class The class of the Resource that shall be created (an empty + * Resource will be created in this method). + */ + @SuppressWarnings("unchecked") + private void prepareInternalState(Class resourceClass) { + if (this.resource == null) { + this.resource = (T) this.ctx.getResourceDefinition(resourceClass).newInstance(); + } + } + + /** + * The generation method that yields a new instance of class `resourceClass` with every value set + * in the FHIRPath mapping. + * + * @param resourceClass Class The class of the Resource that shall be created. + * @return T a new FHIR Resource instance of class `resourceClass`. + */ + public T generateResource(Class resourceClass) { + this.prepareInternalState(resourceClass); + + for (String fhirPath : this.sortedPaths()) { + // prepare the next fhirPath iteration: create a new nodeStack and set the value + this.nodeStack = new Stack<>(); + this.nodeStack + .push(new GenerationTier(this.ctx.getResourceDefinition(this.resource), this.resource)); + this.valueToSet = this.pathMapping.get(fhirPath); + + // pathNode is the part of the FHIRPath we are processing + ExpressionNode pathNode = this.engine.parse(fhirPath); + while (pathNode != null) { + switch (pathNode.getKind()) { + case Name: + this.handleNameNode(pathNode); + break; + case Function: + this.handleFunctionNode(pathNode); + break; + case Constant: + case Group: + case Unary: + // TODO: unimplmemented, what to do? + break; + } + pathNode = pathNode.getInner(); + } + } + + this.nodeStack = null; + return this.resource; + } + + /* + * Handling Named nodes + */ + + /** + * Handles a named node, either adding a new layer to the `nodeStack` when reaching a Composite + * Node or adding the value for Primitive Nodes. + * + * @param fhirPath String the FHIRPath section for the next GenerationTier. + * @param value String the value that shall be set upon reaching a PrimitiveNode. + */ + private void handleNameNode(ExpressionNode fhirPath) { + BaseRuntimeChildDefinition childDef = + this.nodeStack.peek().nodeDefinition.getChildByName(fhirPath.getName()); + if (childDef == null) { + // nothing to do + return; + } + + // identify the type of named node we need to handle here by getting the runtime + // definition type + switch (childDef.getChildByName(fhirPath.getName()).getChildType()) { + case COMPOSITE_DATATYPE: + handleCompositeNode(fhirPath); + break; + + case PRIMITIVE_DATATYPE: + handlePrimitiveNode(fhirPath); + break; + + case RESOURCE_BLOCK: + // TODO: this appears to be where BackboneElements get handled + handleResourceBlock(fhirPath); + break; + + case ID_DATATYPE: + case RESOURCE: + case CONTAINED_RESOURCE_LIST: + case CONTAINED_RESOURCES: + case EXTENSION_DECLARED: + case PRIMITIVE_XHTML: + case PRIMITIVE_XHTML_HL7ORG: + case UNDECL_EXT: + // TODO: not implemented. What to do? + } + } + + /** + * Handles primitive nodes with regards to the current latest tier of the nodeStack. Sets a + * primitive value to all nodes. + * + * @param fhirPath ExpressionNode segment of the fhirPath that specifies the primitive value to + * set. + */ + private void handlePrimitiveNode(ExpressionNode fhirPath) { + // Flexporter modification: check if the fhirPath is just the primitive, in which case just set + // it but if there is more (ie, an extension) then don't set a value and push a generation tier + GenerationTier nextTier = new GenerationTier(); + // get the name of the FHIRPath for the next tier + nextTier.fhirPathName = fhirPath.getName(); + // get the child definition from the parent nodePefinition + nextTier.childDefinition = + this.nodeStack.peek().nodeDefinition.getChildByName(fhirPath.getName()); + // create a nodeDefinition for the next tier + nextTier.nodeDefinition = nextTier.childDefinition.getChildByName(nextTier.fhirPathName); + + + + // Get the primitive type definition from the childDeftinion + RuntimePrimitiveDatatypeDefinition primitiveTarget = + (RuntimePrimitiveDatatypeDefinition) nextTier.childDefinition + .getChildByName(fhirPath.getName()); + for (IBase nodeElement : this.nodeStack.peek().nodes) { + // add the primitive value to each parent node + + IPrimitiveType primitive; + + List existingValues = nextTier.childDefinition.getAccessor().getValues(nodeElement); + + if (fhirPath.getInner() != null && fhirPath.getInner().getKind() == Kind.Name + && !existingValues.isEmpty()) { + // there is an extension on this (possibly other scenarios too?) + // and already a value set, so don't set a new one + primitive = (IPrimitiveType) existingValues.get(0); + + } else { + primitive = + primitiveTarget.newInstance(nextTier.childDefinition.getInstanceConstructorArguments()); + primitive.setValueAsString(this.valueToSet); + nextTier.childDefinition.getMutator().addValue(nodeElement, primitive); + } + + + nextTier.nodes.add(primitive); + } + + // push the created nextTier to the nodeStack + this.nodeStack.push(nextTier); + } + + /** + * Handles a composite node with regards to the current latest tier of the nodeStack. Creates a + * new node based on fhirPath if none are available. + * + * @param fhirPath ExpressionNode the segment of the FHIRPath that is being handled right now. + */ + private void handleCompositeNode(ExpressionNode fhirPath) { + GenerationTier nextTier = new GenerationTier(); + // get the name of the FHIRPath for the next tier + nextTier.fhirPathName = fhirPath.getName(); + // get the child definition from the parent nodePefinition + nextTier.childDefinition = + this.nodeStack.peek().nodeDefinition.getChildByName(fhirPath.getName()); + // create a nodeDefinition for the next tier + nextTier.nodeDefinition = nextTier.childDefinition.getChildByName(nextTier.fhirPathName); + + RuntimeCompositeDatatypeDefinition compositeTarget = + (RuntimeCompositeDatatypeDefinition) nextTier.nodeDefinition; + // iterate through all parent nodes + for (IBase nodeElement : this.nodeStack.peek().nodes) { + List containedNodes = nextTier.childDefinition.getAccessor().getValues(nodeElement); + if (containedNodes.size() > 0) { + // check if sister nodes are already available + nextTier.nodes.addAll(containedNodes); + } else { + // if not nodes are available, create a new node + ICompositeType compositeNode = + compositeTarget.newInstance(nextTier.childDefinition.getInstanceConstructorArguments()); + nextTier.childDefinition.getMutator().addValue(nodeElement, compositeNode); + nextTier.nodes.add(compositeNode); + } + } + // push the created nextTier to the nodeStack + this.nodeStack.push(nextTier); + } + + private void handleResourceBlock(ExpressionNode fhirPath) { + GenerationTier nextTier = new GenerationTier(); + // get the name of the FHIRPath for the next tier + nextTier.fhirPathName = fhirPath.getName(); + // get the child definition from the parent nodePefinition + nextTier.childDefinition = + this.nodeStack.peek().nodeDefinition.getChildByName(fhirPath.getName()); + // create a nodeDefinition for the next tier + nextTier.nodeDefinition = nextTier.childDefinition.getChildByName(nextTier.fhirPathName); + + RuntimeResourceBlockDefinition compositeTarget = + (RuntimeResourceBlockDefinition) nextTier.nodeDefinition; + // iterate through all parent nodes + for (IBase nodeElement : this.nodeStack.peek().nodes) { + List containedNodes = nextTier.childDefinition.getAccessor().getValues(nodeElement); + if (containedNodes.size() > 0) { + // check if sister nodes are already available + nextTier.nodes.addAll(containedNodes); + } else { + // if not nodes are available, create a new node + IBase compositeNode = + compositeTarget.newInstance(nextTier.childDefinition.getInstanceConstructorArguments()); + nextTier.childDefinition.getMutator().addValue(nodeElement, compositeNode); + nextTier.nodes.add(compositeNode); + } + } + // push the created nextTier to the nodeStack + this.nodeStack.push(nextTier); + } + + /* + * Handling Function Nodes + */ + + /** + * Handles a function node of a FHIRPath. + * + * @param fhirPath ExpressionNode the segment of the FHIRPath that is being handled right now. + */ + private void handleFunctionNode(ExpressionNode fhirPath) { + switch (fhirPath.getFunction()) { + case Where: + this.handleWhereFunctionNode(fhirPath); + case Aggregate: + case Alias: + case AliasAs: + case All: + case AllFalse: + case AllTrue: + case AnyFalse: + case AnyTrue: + case As: + case Check: + case Children: + case Combine: + case ConformsTo: + case Contains: + case ConvertsToBoolean: + case ConvertsToDateTime: + case ConvertsToDecimal: + case ConvertsToInteger: + case ConvertsToQuantity: + case ConvertsToString: + case ConvertsToTime: + case Count: + case Custom: + case Descendants: + case Distinct: + case Empty: + case EndsWith: + case Exclude: + case Exists: + case Extension: + case First: + case HasValue: + case HtmlChecks: + case Iif: + case IndexOf: + case Intersect: + case Is: + case IsDistinct: + case Item: + case Last: + case Length: + case Lower: + case Matches: + case MemberOf: + case Not: + case Now: + case OfType: + case Repeat: + case Replace: + case ReplaceMatches: + case Resolve: + case Select: + case Single: + case Skip: + case StartsWith: + case SubsetOf: + case Substring: + case SupersetOf: + case Tail: + case Take: + case ToBoolean: + case ToChars: + case ToDateTime: + case ToDecimal: + case ToInteger: + case ToQuantity: + case ToString: + case ToTime: + case Today: + case Trace: + case Type: + case Union: + case Upper: + default: + // TODO: unimplemented, what to do? + } + } + + /** + * Handles a function node of a `where`-function. Iterates through all params and handle where + * functions for primitive datatypes (others are not implemented and yield errors.) + * + * @param fhirPath ExpressionNode the segment of the FHIRPath that contains the where function + */ + private void handleWhereFunctionNode(ExpressionNode fhirPath) { + // iterate through all where parameters + for (ExpressionNode param : fhirPath.getParameters()) { + BaseRuntimeChildDefinition wherePropertyChild = + this.nodeStack.peek().nodeDefinition.getChildByName(param.getName()); + BaseRuntimeElementDefinition wherePropertyDefinition = + wherePropertyChild.getChildByName(param.getName()); + + // only primitive nodes can be checked using the where function + switch (wherePropertyDefinition.getChildType()) { + case PRIMITIVE_DATATYPE: + this.handleWhereFunctionParam(param); + break; + case COMPOSITE_DATATYPE: + case CONTAINED_RESOURCES: + case CONTAINED_RESOURCE_LIST: + case EXTENSION_DECLARED: + case ID_DATATYPE: + case PRIMITIVE_XHTML: + case PRIMITIVE_XHTML_HL7ORG: + case RESOURCE: + case RESOURCE_BLOCK: + case UNDECL_EXT: + default: + // TODO: unimplemented. What to do? + } + } + } + + /** + * Filter the latest nodeStack tier using `param`. + * + * @param param ExpressionNode parameter type ExpressionNode that provides the where clause that + * is used to filter nodes from the nodeStack. + */ + private void handleWhereFunctionParam(ExpressionNode param) { + BaseRuntimeChildDefinition wherePropertyChild = + this.nodeStack.peek().nodeDefinition.getChildByName(param.getName()); + BaseRuntimeElementDefinition wherePropertyDefinition = + wherePropertyChild.getChildByName(param.getName()); + + String matchingValue = param.getOpNext().getConstant().toString(); + List matchingNodes = new ArrayList<>(); + List unlabeledNodes = new ArrayList<>(); + // sort all nodes from the nodeStack into matching nodes and unlabeled nodes + for (IBase node : this.nodeStack.peek().nodes) { + List operationValues = wherePropertyChild.getAccessor().getValues(node); + if (operationValues.size() == 0) { + unlabeledNodes.add(node); + } else { + for (IBase operationValue : operationValues) { + IPrimitiveType primitive = (IPrimitiveType) operationValue; + switch (param.getOperation()) { + case Equals: + if (primitive.getValueAsString().equals(matchingValue)) { + matchingNodes.add(node); + } + break; + case NotEquals: + if (!primitive.getValueAsString().equals(matchingValue)) { + matchingNodes.add(node); + } + break; + case And: + case As: + case Concatenate: + case Contains: + case Div: + case DivideBy: + case Equivalent: + case Greater: + case GreaterOrEqual: + case Implies: + case In: + case Is: + case LessOrEqual: + case LessThan: + case MemberOf: + case Minus: + case Mod: + case NotEquivalent: + case Or: + case Plus: + case Times: + case Union: + case Xor: + // TODO: unimplemented, what to do? + } + } + } + } + + if (matchingNodes.size() == 0) { + if (unlabeledNodes.size() == 0) { + // no nodes were matched and no unlabeled nodes are available. We need to add a + // sister node to the nodeStack + GenerationTier latestTier = this.nodeStack.pop(); + GenerationTier previousTier = this.nodeStack.peek(); + this.nodeStack.push(latestTier); + + RuntimeCompositeDatatypeDefinition compositeTarget = + (RuntimeCompositeDatatypeDefinition) latestTier.nodeDefinition; + ICompositeType compositeNode = compositeTarget + .newInstance(latestTier.childDefinition.getInstanceConstructorArguments()); + latestTier.childDefinition.getMutator().addValue(previousTier.nodes.get(0), compositeNode); + unlabeledNodes.add(compositeNode); + } + + switch (param.getOperation()) { + case Equals: + // if we are checking for equality, we need to set the property we looked for on + // the unlabeled node(s) + RuntimePrimitiveDatatypeDefinition equalsPrimitive = + (RuntimePrimitiveDatatypeDefinition) wherePropertyDefinition; + IPrimitiveType primitive = + equalsPrimitive.newInstance(wherePropertyChild.getInstanceConstructorArguments()); + primitive.setValueAsString(param.getOpNext().getConstant().toString()); + for (IBase node : unlabeledNodes) { + wherePropertyChild.getMutator().addValue(node, primitive); + matchingNodes.add(node); + } + break; + case NotEquals: + // if we are checking for inequality, we need to pass all unlabeled (or created + // if none were available) + matchingNodes.addAll(unlabeledNodes); + break; + case And: + case As: + case Concatenate: + case Contains: + case Div: + case DivideBy: + case Equivalent: + case Greater: + case GreaterOrEqual: + case Implies: + case In: + case Is: + case LessOrEqual: + case LessThan: + case MemberOf: + case Minus: + case Mod: + case NotEquivalent: + case Or: + case Plus: + case Times: + case Union: + case Xor: + // TODO: need to implement above first + } + } + + // set the nodes to the filtered ones + this.nodeStack.peek().nodes = matchingNodes; + } + + /** + * Creates a list all FHIRPaths from the mapping ordered by paths with where equals, where + * unequals and the rest. + * + * @return List a List of FHIRPaths ordered by the type. + */ + private List sortedPaths() { + List whereEquals = new ArrayList(); + List whereUnequals = new ArrayList(); + List withoutWhere = new ArrayList(); + + for (String fhirPath : this.pathMapping.keySet()) { + switch (this.getTypeOfFhirPath(fhirPath)) { + case WHERE_EQUALS: + whereEquals.add(fhirPath); + break; + case WHERE_UNEQUALS: + whereUnequals.add(fhirPath); + break; + case WITHOUT_WHERE: + withoutWhere.add(fhirPath); + break; + } + } + + List ret = new ArrayList(); + ret.addAll(whereEquals); + ret.addAll(whereUnequals); + ret.addAll(withoutWhere); + return ret; + } + + /** + * Returns the type of path based on the FHIRPath String. + * + * @param fhirPath String representation of a FHIRPath. + * @return PathType the type of path supplied as `fhirPath`. + */ + private PathType getTypeOfFhirPath(String fhirPath) { + ExpressionNode fhirPathExpression = this.engine.parse(fhirPath); + while (fhirPathExpression != null) { + if (fhirPathExpression.getKind() == ExpressionNode.Kind.Function) { + if (fhirPathExpression.getFunction() == ExpressionNode.Function.Where) { + for (ExpressionNode params : fhirPathExpression.getParameters()) { + switch (params.getOperation()) { + case Equals: + return PathType.WHERE_EQUALS; + case NotEquals: + return PathType.WHERE_UNEQUALS; + case And: + case As: + case Concatenate: + case Contains: + case Div: + case DivideBy: + case Equivalent: + case Greater: + case GreaterOrEqual: + case Implies: + case In: + case Is: + case LessOrEqual: + case LessThan: + case MemberOf: + case Minus: + case Mod: + case NotEquivalent: + case Or: + case Plus: + case Times: + case Union: + case Xor: + // TODO: need to implement above first + } + } + } + } + fhirPathExpression = fhirPathExpression.getInner(); + } + return PathType.WITHOUT_WHERE; + } + + /** + * A simple enum to diffirentiate between types of FHIRPaths in the special use case of generating + * FHIR Resources. + */ + public enum PathType { + WHERE_EQUALS, WHERE_UNEQUALS, WITHOUT_WHERE + } +} diff --git a/src/main/java/org/mitre/synthea/export/flexporter/FhirPathUtils.java b/src/main/java/org/mitre/synthea/export/flexporter/FhirPathUtils.java new file mode 100644 index 0000000000..c112efc1bc --- /dev/null +++ b/src/main/java/org/mitre/synthea/export/flexporter/FhirPathUtils.java @@ -0,0 +1,81 @@ +package org.mitre.synthea.export.flexporter; + +import java.util.ArrayList; +import java.util.List; + +import org.hl7.fhir.r4.hapi.fluentpath.FhirPathR4; +import org.hl7.fhir.r4.model.Base; +import org.hl7.fhir.r4.model.BooleanType; +import org.hl7.fhir.r4.model.Bundle; +import org.hl7.fhir.r4.model.Bundle.BundleEntryComponent; +import org.hl7.fhir.r4.model.Resource; +import org.hl7.fhir.r4.model.StringType; + +import ca.uhn.fhir.context.FhirContext; + +public abstract class FhirPathUtils { + public static final FhirContext FHIR_CTX = FhirContext.forR4(); + + private static final FhirPathR4 FHIRPATH = new FhirPathR4(FHIR_CTX); + + public static List evaluateResource(Resource resource, String fhirpath) { + return FHIRPATH.evaluate(resource, fhirpath, Base.class); + } + + public static List evaluateBundle(Bundle bundle, String fhirpath, boolean returnResources) { + if (fhirpath.startsWith("Bundle")) { + // run it on the entire bundle + + // NOTE: this doesn't check returnResources -- would that be useful here? + return evaluateResource(bundle, fhirpath); + } else { + // the fhirpath doesn't start with "Bundle" + // so we'll apply it to each resource within the bundle + List results = new ArrayList<>(); + + for (BundleEntryComponent entry : bundle.getEntry()) { + List resourceResults = evaluateResource(entry.getResource(), fhirpath); + + if (returnResources) { + if (isTruthy(resourceResults)) { + results.add(entry.getResource()); + } + } else { + results.addAll(resourceResults); + } + } + + return results; + } + } + + public static boolean appliesToResource(Resource resource, String fhirpath) { + return isTruthy(evaluateResource(resource, fhirpath)); + } + + public static boolean appliesToBundle(Bundle bundle, String fhirpath) { + return isTruthy(evaluateBundle(bundle, fhirpath, false)); + } + + static boolean isTruthy(Base result) { + if (result == null) { + return false; + } else if (result instanceof StringType) { + StringType str = ((StringType) result); + return !str.isEmpty() && !str.getValue().isEmpty(); + } else if (result instanceof BooleanType) { + BooleanType bool = ((BooleanType) result); + return !bool.isEmpty() && bool.booleanValue(); + } + + return true; + } + + static boolean isTruthy(List result) { + if (result == null || result.isEmpty()) { + return false; + } + + return result.stream().anyMatch(i -> isTruthy(i)); + } +} diff --git a/src/main/java/org/mitre/synthea/export/flexporter/Mapping.java b/src/main/java/org/mitre/synthea/export/flexporter/Mapping.java new file mode 100644 index 0000000000..490165d66e --- /dev/null +++ b/src/main/java/org/mitre/synthea/export/flexporter/Mapping.java @@ -0,0 +1,28 @@ +package org.mitre.synthea.export.flexporter; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.InputStream; +import java.util.List; +import java.util.Map; + +import org.yaml.snakeyaml.Yaml; + +public class Mapping { + public String name; + public String applicability; + + /** + * Each action is a Map. Nested fields within the YAML become ArrayLists and + * LinkedHashMaps. + */ + public List> actions; + + public static Mapping parseMapping(File mappingFile) throws FileNotFoundException { + InputStream selectorInputSteam = new FileInputStream(mappingFile); + Yaml yaml = new Yaml(new org.yaml.snakeyaml.constructor.Constructor(Mapping.class)); + + return yaml.loadAs(selectorInputSteam, Mapping.class); + } +} diff --git a/src/main/java/org/mitre/synthea/export/flexporter/ValueTransforms.java b/src/main/java/org/mitre/synthea/export/flexporter/ValueTransforms.java new file mode 100644 index 0000000000..1156238af9 --- /dev/null +++ b/src/main/java/org/mitre/synthea/export/flexporter/ValueTransforms.java @@ -0,0 +1,110 @@ +package org.mitre.synthea.export.flexporter; + +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.time.ZonedDateTime; +import java.time.format.DateTimeFormatter; + +public abstract class ValueTransforms { + + public static String apply(String originalValue, String transformName) { + if (transformName == null) { + return originalValue; + } + + String newValue; + + switch (transformName) { + case "toInstant": + newValue = toInstant(originalValue); + break; + + case "toDateTime": + newValue = toDateTime(originalValue); + break; + + case "toDate": + newValue = toDate(originalValue); + break; + + case "toTime": + newValue = toTime(originalValue); + break; + + default: + throw new IllegalArgumentException("Unrecognized transform name: " + transformName); + } + + return newValue; + } + + + public static String toInstant(String src) { + if (src == null) { + return null; + } + + ZonedDateTime dateTime = parse(src); + + return dateTime.toInstant().toString(); + } + + public static String toDateTime(String src) { + ZonedDateTime dateTime = parse(src); + + return dateTime.toInstant().toString(); + } + + public static String toDate(String src) { + if (src == null) { + return null; + } + + ZonedDateTime dateTime = parse(src); + + return DateTimeFormatter.ISO_LOCAL_DATE.format(dateTime); + } + + public static String toTime(String src) { + if (src == null) + return null; + ZonedDateTime dateTime = parse(src); + + return DateTimeFormatter.ISO_LOCAL_TIME.format(dateTime); + } + + private static DateTimeFormatter YEAR = DateTimeFormatter.ofPattern("yyyy"); + + private static DateTimeFormatter YEAR_MONTH = DateTimeFormatter.ofPattern("yyyy-MM"); + + private static ZonedDateTime parse(String src) { + // assume src is one of the four formats already + + // instant: YYYY-MM-DDThh:mm:ss.sss+zz:zz + // date: YYYY, YYYY-MM, or YYYY-MM-DD + // dateTime: YYYY, YYYY-MM, YYYY-MM-DD or YYYY-MM-DDThh:mm:ss+zz:zz + // time: hh:mm:ss + + switch (src.length()) { + case 4: + // YYYY + return LocalDate.parse(src, YEAR).atStartOfDay(ZoneId.systemDefault()); + case 7: + // YYYY-MM + return LocalDate.parse(src, YEAR_MONTH).atStartOfDay(ZoneId.systemDefault()); + case 8: + // hh:mm:ss + return LocalDateTime.parse(src, DateTimeFormatter.ISO_LOCAL_TIME) + .atZone(ZoneId.systemDefault()); + case 10: + // YYYY-MM-DD + return LocalDate.parse(src, DateTimeFormatter.ISO_LOCAL_DATE) + .atStartOfDay(ZoneId.systemDefault()); + default: + // TODO: make sure this actually works -- the docs are weird + return ZonedDateTime.parse(src, DateTimeFormatter.ISO_ZONED_DATE_TIME); + } + } + +} diff --git a/src/test/java/org/mitre/synthea/export/flexporter/ActionsTest.java b/src/test/java/org/mitre/synthea/export/flexporter/ActionsTest.java new file mode 100644 index 0000000000..da7c4b255a --- /dev/null +++ b/src/test/java/org/mitre/synthea/export/flexporter/ActionsTest.java @@ -0,0 +1,340 @@ +package org.mitre.synthea.export.flexporter; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +import ca.uhn.fhir.parser.IParser; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.nio.file.Files; +import java.util.Arrays; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; + +import org.hl7.fhir.r4.model.BooleanType; +import org.hl7.fhir.r4.model.Bundle; +import org.hl7.fhir.r4.model.Bundle.BundleEntryComponent; +import org.hl7.fhir.r4.model.Bundle.BundleType; +import org.hl7.fhir.r4.model.DateTimeType; +import org.hl7.fhir.r4.model.DateType; +import org.hl7.fhir.r4.model.HumanName; +import org.hl7.fhir.r4.model.Immunization; +import org.hl7.fhir.r4.model.InstantType; +import org.hl7.fhir.r4.model.Observation; +import org.hl7.fhir.r4.model.Patient; +import org.hl7.fhir.r4.model.Resource; +import org.hl7.fhir.r4.model.ResourceType; +import org.hl7.fhir.r4.model.ServiceRequest; +import org.hl7.fhir.r4.model.Type; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; +import org.mitre.synthea.world.agents.Person; + +public class ActionsTest { + + private static Map buildApplyProfileAction(String profile, String applicability) { + Map map = new HashMap<>(); + map.put("profile", profile); + map.put("applicability", applicability); + return map; + } + + private static Mapping testMapping; + + @BeforeClass + public static void setupClass() throws FileNotFoundException { + ClassLoader classLoader = ActionsTest.class.getClassLoader(); + File file = new File(classLoader.getResource("flexporter/test_mapping.yaml").getFile()); + + testMapping = Mapping.parseMapping(file); + } + + @AfterClass + public static void tearDown() { + testMapping = null; + } + + private static Map getActionByName(String name) { + return testMapping.actions.stream().filter(a -> a.get("name").equals(name)).findFirst().get(); + } + + private static Bundle loadFixtureBundle(String filename) throws IOException { + IParser parser = FhirPathUtils.FHIR_CTX.newJsonParser().setPrettyPrint(true); + ClassLoader classLoader = ActionsTest.class.getClassLoader(); + File file = new File(classLoader.getResource("flexporter/" + filename).getFile()); + + String fhirJson = new String(Files.readAllBytes(file.toPath())); + return parser.parseResource(Bundle.class, fhirJson); + } + + + + @Test + public void testApplyProfiles() { + Patient p = new Patient(); + p.addName().addGiven("Bobby").setFamily("Brown"); + + Bundle b = new Bundle(); + b.addEntry().setResource(p); + + List> actions = + Arrays.asList(buildApplyProfileAction("http://example.com/Patient", "Patient"), + buildApplyProfileAction("http://example.com/Observation", "Observation")); + + Actions.applyProfiles(b, actions); + + assertNotNull(p.getMeta()); + assertNotNull(p.getMeta().getProfile()); + assertEquals(1, p.getMeta().getProfile().size()); + assertEquals("http://example.com/Patient", p.getMeta().getProfile().get(0).getValueAsString()); + } + + + @Test + public void testApplyProfilesNoMatch() { + Patient p = new Patient(); + p.addName().addGiven("Willie").setFamily("White"); + + Bundle b = new Bundle(); + b.addEntry().setResource(p); + + List> actions = + Arrays.asList(buildApplyProfileAction("http://example.com/Observation", "Observation")); + + Actions.applyProfiles(b, actions); + + assertTrue(p.getMeta() == null || p.getMeta().getProfile() == null + || p.getMeta().getProfile().size() == 0); + } + + + @Test + public void testApplyProfilesComplexFhirPath() { + Patient p = new Patient(); + p.addName().addGiven("Barry").setFamily("Black"); + p.setDeceased(new BooleanType(true)); + + Bundle b = new Bundle(); + b.addEntry().setResource(p); + + List> actions = + Arrays.asList(buildApplyProfileAction("http://example.com/Patient", "Patient"), + buildApplyProfileAction("http://example.com/DeceasedPatient", + "(Patient.deceased as boolean) = true")); + + Actions.applyProfiles(b, actions); + + assertNotNull(p.getMeta()); + assertNotNull(p.getMeta().getProfile()); + assertEquals(2, p.getMeta().getProfile().size()); + assertEquals("http://example.com/Patient", p.getMeta().getProfile().get(0).getValueAsString()); + assertEquals("http://example.com/DeceasedPatient", + p.getMeta().getProfile().get(1).getValueAsString()); + } + + + @Test + public void testSetValues() { + Patient p = new Patient(); + p.addName().addGiven("Gary").setFamily("Green"); + + Bundle b = new Bundle(); + b.addEntry().setResource(p); + + Map action = getActionByName("testSetValues"); + + Actions.applyAction(b, action, null); + + assertEquals("1987-06-05", p.getBirthDateElement().getValueAsString()); + } + + + @Test + public void testSetValues_getField() { + Immunization i = new Immunization(); + + DateTimeType date = new DateTimeType(); + date.fromStringValue("2022-02-22"); + i.setOccurrence(date); + + Bundle b = new Bundle(); + b.addEntry().setResource(i); + + Map action = getActionByName("testSetValues_getField"); + + Actions.applyAction(b, action, null); + + assertEquals("2022-02-22", i.getRecordedElement().getValueAsString()); + } + + @Test + public void testSetValues_overwrite() { + Observation o = new Observation(); + + DateTimeType date = new DateTimeType(); + date.fromStringValue("2009-10-26T06:44:52-04:00"); + o.setEffective(date); + + Bundle b = new Bundle(); + b.addEntry().setResource(o); + + Map action = getActionByName("testSetValues_overwrite"); + + Actions.applyAction(b, action, null); + + Type effective = o.getEffective(); + + assertTrue(effective instanceof InstantType); + + InstantType effectiveInstant = (InstantType) effective; + + assertEquals("2009-10-26T06:44:52-04:00", effectiveInstant.getValueAsString()); + } + + @Test + public void testSetValues_transform() { + Patient p = new Patient(); + p.addName().addGiven("Cristina").setFamily("Crimson"); + DateType date = new DateType(); + date.fromStringValue("1999-09-29"); + p.setBirthDateElement(date); + + Bundle b = new Bundle(); + b.addEntry().setResource(p); + + Map action = getActionByName("testSetValues_transform"); + + Actions.applyAction(b, action, null); + + // NOTE: this expected value may change if we ever add randomness to the date -> dateTime + // transform + assertEquals("1999-09-29T04:00:00Z", + ((DateTimeType) date.getExtension().get(0).getValue()).getValueAsString()); + } + + @Test + public void testKeepResources() throws Exception { + Bundle b = loadFixtureBundle("sample_complete_patient.json"); + + + Map action = getActionByName("testKeepResources"); + + Actions.applyAction(b, action, null); + + Set expectedResourceTypes = + new HashSet<>(Arrays.asList("Patient", "Encounter", "Condition")); + + for (BundleEntryComponent bec : b.getEntry()) { + Resource resource = bec.getResource(); + String resourceType = resource.getResourceType().toString(); + assertTrue(resourceType, expectedResourceTypes.contains(resourceType)); + } + } + + @Test + public void testDeleteResources() throws Exception { + Bundle b = loadFixtureBundle("sample_complete_patient.json"); + + long countProvenance = b.getEntry().stream() + .filter(bec -> bec.getResource().getResourceType() == ResourceType.Provenance).count(); + + // this is just making sure the fixture actually contains the thing we want to delete + assertEquals(1, countProvenance); + Map action = getActionByName("testDeleteResources"); + + Actions.applyAction(b, action, null); + + countProvenance = b.getEntry().stream() + .filter(bec -> bec.getResource().getResourceType() == ResourceType.Provenance).count(); + + assertEquals(0, countProvenance); + + } + + @Test + public void testCreateResources_createSingle() throws Exception { + Bundle b = loadFixtureBundle("sample_complete_patient.json"); + + long countSR = b.getEntry().stream() + .filter(bec -> bec.getResource().getResourceType() == ResourceType.ServiceRequest).count(); + assertEquals(0, countSR); + + + Map action = getActionByName("testCreateResources_createSingle"); + + Actions.applyAction(b, action, null); + + List serviceRequests = b.getEntry().stream() + .filter(bec -> bec.getResource().getResourceType() == ResourceType.ServiceRequest) + .map(bec -> bec.getResource()).collect(Collectors.toList()); + + assertEquals(1, serviceRequests.size()); + + ServiceRequest createdSR = (ServiceRequest) serviceRequests.get(0); + + assertEquals("http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-servicerequest", + createdSR.getMeta().getProfile().get(0).getValue()); + + assertEquals("active", createdSR.getStatus().toCode()); + + Patient p = (Patient) b.getEntryFirstRep().getResource(); + assertEquals(p.getId(), createdSR.getSubject().getReference()); + } + + @Test + public void testCreateResources_createBasedOn() throws Exception { + Bundle b = loadFixtureBundle("sample_complete_patient.json"); + + long countSR = b.getEntry().stream() + .filter(bec -> bec.getResource().getResourceType() == ResourceType.ServiceRequest).count(); + assertEquals(0, countSR); + + long countProc = b.getEntry().stream() + .filter(bec -> bec.getResource().getResourceType() == ResourceType.Procedure).count(); + assertTrue(countProc > 0); + + Map action = getActionByName("testCreateResources_createBasedOn"); + + Actions.applyAction(b, action, null); + + // there should now be one ServiceRequest per Procedure + countSR = b.getEntry().stream() + .filter(bec -> bec.getResource().getResourceType() == ResourceType.ServiceRequest).count(); + assertEquals(countProc, countSR); + + // TODO: fill out the rest of this test, check the "writeback" + + } + + @Test + public void testGetAttribute() throws Exception { + Bundle b = new Bundle(); + b.setType(BundleType.COLLECTION); + Person p = new Person(0L); + + String firstName = "Robert"; + String lastName = "Rainbow"; + p.attributes.put(Person.FIRST_NAME, firstName); + p.attributes.put(Person.LAST_NAME, lastName); + p.attributes.put(Person.NAME, firstName + " " + lastName); + Map action = getActionByName("testCreateResources_getAttribute"); + + Actions.applyAction(b, action, p); + + Patient patient = (Patient) b.getEntryFirstRep().getResource(); + HumanName name = patient.getNameFirstRep(); + + assertEquals("Robert", name.getGivenAsSingleString()); + assertEquals("Rainbow", name.getFamily()); + assertEquals("Robert Rainbow", name.getText()); + } + +} diff --git a/src/test/java/org/mitre/synthea/export/flexporter/CustomFHIRPathResourceGeneratorR4Test.java b/src/test/java/org/mitre/synthea/export/flexporter/CustomFHIRPathResourceGeneratorR4Test.java new file mode 100644 index 0000000000..0638985935 --- /dev/null +++ b/src/test/java/org/mitre/synthea/export/flexporter/CustomFHIRPathResourceGeneratorR4Test.java @@ -0,0 +1,188 @@ +package org.mitre.synthea.export.flexporter; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; + +import ca.uhn.fhir.context.FhirContext; + +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.hl7.fhir.r4.model.Address; +import org.hl7.fhir.r4.model.DateType; +import org.hl7.fhir.r4.model.Extension; +import org.hl7.fhir.r4.model.HumanName; +import org.hl7.fhir.r4.model.HumanName.NameUse; +import org.hl7.fhir.r4.model.Patient; +import org.hl7.fhir.r4.model.StringType; +import org.junit.Ignore; +import org.junit.Test; + + +public class CustomFHIRPathResourceGeneratorR4Test { + + // share a context because these are slow to create + private static final FhirContext CTX = FhirContext.forR4(); + + private static void logPatientJson(Patient p) { + String patientJson = CTX.newJsonParser().setPrettyPrint(true).encodeResourceToString(p); + + System.out.println(patientJson); + } + + private Patient createPatient(Map fhirPathMapping) { + CustomFHIRPathResourceGeneratorR4 fhirPathGenerator = + new CustomFHIRPathResourceGeneratorR4<>(CTX); + fhirPathGenerator.setMapping(fhirPathMapping); + return fhirPathGenerator.generateResource(Patient.class); + } + + private void updatePatient(Patient p, Map fhirPathMapping) { + CustomFHIRPathResourceGeneratorR4 fhirPathGenerator = + new CustomFHIRPathResourceGeneratorR4<>(CTX); + fhirPathGenerator.setResource(p); + fhirPathGenerator.setMapping(fhirPathMapping); + fhirPathGenerator.generateResource(Patient.class); + } + + @Test + public void testSimpleField() { + Map fhirPathMapping = new HashMap<>(); + fhirPathMapping.put("Patient.deceasedBoolean", "false"); + Patient patient = createPatient(fhirPathMapping); + + assertFalse(patient.getDeceasedBooleanType().booleanValue()); + } + + @Test + public void testArray1() { + Map fhirPathMapping = new HashMap<>(); + + fhirPathMapping.put("Patient.name.given[0]", "Billy"); + fhirPathMapping.put("Patient.name.given[1]", "Bob"); + + Patient patient = createPatient(fhirPathMapping); + + List given = patient.getNameFirstRep().getGiven(); + + assertEquals(2, given.size()); + assertEquals("Billy", given.get(0).getValueAsString()); + assertEquals("Bob", given.get(1).getValueAsString()); + } + + + @Ignore + @Test + public void testArray2() { + Map fhirPathMapping = new HashMap<>(); + + fhirPathMapping.put("Patient.name[0].given", "Billy"); + fhirPathMapping.put("Patient.name[1].given", "Bob"); + + // TODO: for some reason Patient.name.given[0] and given[1] work as expected (2 name strings in + // the 'given' array) + // but Patient.name[0].given and .name[1].given do not (same result, expected was 2 HumanName + // objects in the name array) + + Patient patient = createPatient(fhirPathMapping); + + List name = patient.getName(); + assertEquals(2, name.size()); + + assertEquals("Billy", name.get(0).getGivenAsSingleString()); + assertEquals("Bob", name.get(1).getGivenAsSingleString()); + } + + @Test + public void testArray3() { + Map fhirPathMapping = new HashMap<>(); + + fhirPathMapping.put("Patient.name.where(use='official').given", "Billy"); + fhirPathMapping.put("Patient.name.where(use='usual').given", "Bob"); + + Patient patient = createPatient(fhirPathMapping); + List name = patient.getName(); + assertEquals(2, name.size()); + + // we don't necessarily know which order these will be in + HumanName first = name.get(0); + HumanName second = name.get(1); + + HumanName official; + HumanName usual; + + if (first.getUse() == NameUse.OFFICIAL) { + official = first; + usual = second; + } else { + usual = first; + official = second; + } + + assertEquals("Billy", official.getGivenAsSingleString()); + assertEquals("Bob", usual.getGivenAsSingleString()); + } + + @Test + public void testExtension() { + Map fhirPathMapping = new HashMap<>(); + fhirPathMapping.put( + "Patient.extension.where(url='http://hl7.org/fhir/StructureDefinition/patient-mothersMaidenName').valueString", + "Donita707 Langosh790"); + + fhirPathMapping.put( + "Patient.extension.where(url='http://hl7.org/fhir/StructureDefinition/patient-birthPlace').valueAddress.city", + "Watertown"); + fhirPathMapping.put( + "Patient.extension.where(url='http://hl7.org/fhir/StructureDefinition/patient-birthPlace').valueAddress.state", + "Massachusetts"); + fhirPathMapping.put( + "Patient.extension.where(url='http://hl7.org/fhir/StructureDefinition/patient-birthPlace').valueAddress.country", + "US"); + + Patient patient = createPatient(fhirPathMapping); + + assertEquals(2, patient.getExtension().size()); + + Extension mothersMaidenName = patient + .getExtensionByUrl("http://hl7.org/fhir/StructureDefinition/patient-mothersMaidenName"); + assertEquals("Donita707 Langosh790", + mothersMaidenName.getValueAsPrimitive().getValueAsString()); + + + Extension birthPlace = + patient.getExtensionByUrl("http://hl7.org/fhir/StructureDefinition/patient-birthPlace"); + + Address address = (Address) birthPlace.getValue(); + + assertEquals("Watertown", address.getCity()); + assertEquals("Massachusetts", address.getState()); + assertEquals("US", address.getCountry()); + } + + @Test + public void testExtensionOnPrimitive() { + Map fhirPathMapping = new HashMap<>(); + + // fhirPathMapping.put("Patient.birthDate", "2021-12-15"); + fhirPathMapping.put( + "Patient.birthDate.extension.where(url='http://hl7.org/fhir/StructureDefinition/patient-birthTime').valueDateTime", + "2021-12-15T17:57:28-05:00"); + + Patient patient = new Patient(); + patient.setBirthDate(new Date(123456789L)); // translates into 1970-01-02 + + updatePatient(patient, fhirPathMapping); + + assertEquals(0, patient.getExtension().size()); + + DateType birthdate = patient.getBirthDateElement(); + assertEquals("1970-01-02", birthdate.getValueAsString()); + + Extension birthTime = + birthdate.getExtensionByUrl("http://hl7.org/fhir/StructureDefinition/patient-birthTime"); + assertEquals("2021-12-15T17:57:28-05:00", birthTime.getValueAsPrimitive().getValueAsString()); + } +} diff --git a/src/test/java/org/mitre/synthea/export/flexporter/FhirPathUtilsTest.java b/src/test/java/org/mitre/synthea/export/flexporter/FhirPathUtilsTest.java new file mode 100644 index 0000000000..c6eefb0d19 --- /dev/null +++ b/src/test/java/org/mitre/synthea/export/flexporter/FhirPathUtilsTest.java @@ -0,0 +1,103 @@ +package org.mitre.synthea.export.flexporter; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +import java.util.List; + +import org.hl7.fhir.r4.model.Base; +import org.hl7.fhir.r4.model.BooleanType; +import org.hl7.fhir.r4.model.Bundle; +import org.hl7.fhir.r4.model.Patient; +import org.hl7.fhir.r4.model.StringType; +import org.junit.Test; + + +public class FhirPathUtilsTest { + + @Test + public void testEvaluateResource() { + Patient p = new Patient(); + p.addName().addGiven("John").setFamily("Smith"); + + List result = FhirPathUtils.evaluateResource(p, "Patient.name.given"); + assertEquals(1, result.size()); + assertTrue(result.get(0) instanceof StringType); + assertEquals("John", ((StringType) result.get(0)).getValue()); + + result = FhirPathUtils.evaluateResource(p, "Patient.name.suffix"); + assertEquals(0, result.size()); + } + + @Test + public void testEvaluateBundle() { + Patient p = new Patient(); + p.addName().addGiven("Jessica").setFamily("Jones"); + + Bundle b = new Bundle(); + b.addEntry().setResource(p); + + List result = FhirPathUtils.evaluateBundle(b, "Patient.name.given", false); + assertEquals(1, result.size()); + assertTrue(result.get(0) instanceof StringType); + assertEquals("Jessica", ((StringType) result.get(0)).getValue()); + + // now do the same thing with returnResource = true, + // so we expect the resource that this was true for + result = FhirPathUtils.evaluateBundle(b, "Patient.name.given", true); + assertEquals(1, result.size()); + assertEquals(p, result.get(0)); + + // now try some bundle-specific fhirpath + result = FhirPathUtils.evaluateBundle(b, + "Bundle.entry.resource.ofType(Patient).first().name.given = 'Jessica'", false); + assertEquals(1, result.size()); + assertTrue(result.get(0) instanceof BooleanType); + assertTrue(((BooleanType) result.get(0)).booleanValue()); + + result = FhirPathUtils.evaluateBundle(b, + "Bundle.entry.resource.ofType(Patient).first().name.given = 'Julianna'", false); + assertEquals(1, result.size()); + assertTrue(result.get(0) instanceof BooleanType); + assertFalse(((BooleanType) result.get(0)).booleanValue()); + } + + @Test + public void testAppliesToResource() { + Patient p = new Patient(); + p.addName().addGiven("Jane").setFamily("Shepard"); + + assertTrue(FhirPathUtils.appliesToResource(p, "Patient.name.given")); + assertTrue(FhirPathUtils.appliesToResource(p, "Patient.name.given = 'Jane'")); + assertFalse(FhirPathUtils.appliesToResource(p, "Patient.name.given = 'John'")); + assertFalse(FhirPathUtils.appliesToResource(p, "Patient.name.suffix")); + } + + @Test + public void testAppliesToBundle() { + Patient p = new Patient(); + p.addName().addGiven("Jack").setFamily("Black"); + + Bundle b = new Bundle(); + b.addEntry().setResource(p); + + // fhirpath not starting with "Bundle" implies + // "is there any resource in the bundle that this applies to" + assertTrue(FhirPathUtils.appliesToBundle(b, "Patient.name.given")); + assertTrue(FhirPathUtils.appliesToBundle(b, "Patient.name.given = 'Jack'")); + assertFalse(FhirPathUtils.appliesToBundle(b, "Patient.name.given = 'Jerametrius'")); + assertFalse(FhirPathUtils.appliesToBundle(b, "Patient.name.suffix")); + + // fhirpath starting with "Bundle" implies + // "is this truthy in the context of the bundle resource itself" + assertTrue(FhirPathUtils.appliesToBundle(b, + "Bundle.entry.resource.ofType(Patient).first().name.given")); + assertTrue(FhirPathUtils.appliesToBundle(b, + "Bundle.entry.resource.ofType(Patient).first().name.given = 'Jack'")); + assertFalse(FhirPathUtils.appliesToBundle(b, + "Bundle.entry.resource.ofType(Patient).first().name.given = 'Jerametrius'")); + assertFalse( + FhirPathUtils.appliesToBundle(b, "Bundle.entry.resource.ofType(Patient).name.suffix")); + } +} diff --git a/src/test/resources/flexporter/sample_complete_patient.json b/src/test/resources/flexporter/sample_complete_patient.json new file mode 100644 index 0000000000..b17bc0a071 --- /dev/null +++ b/src/test/resources/flexporter/sample_complete_patient.json @@ -0,0 +1,24158 @@ +{ + "resourceType": "Bundle", + "type": "transaction", + "entry": [ { + "fullUrl": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "resource": { + "resourceType": "Patient", + "id": "d5582579-7193-4866-5560-a01e723b6552", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient", "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient" ] + }, + "text": { + "status": "generated", + "div": "
Generated by Synthea.Version identifier: master-branch-latest-108-g7542338a\n . Person seed: 3457288435413077439 Population seed: 1625926618830
" + }, + "extension": [ { + "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-race", + "extension": [ { + "url": "ombCategory", + "valueCoding": { + "system": "urn:oid:2.16.840.1.113883.6.238", + "code": "2106-3", + "display": "White" + } + }, { + "url": "text", + "valueString": "White" + } ] + }, { + "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity", + "extension": [ { + "url": "ombCategory", + "valueCoding": { + "system": "urn:oid:2.16.840.1.113883.6.238", + "code": "2186-5", + "display": "Non Hispanic or Latino" + } + }, { + "url": "text", + "valueString": "Non Hispanic or Latino" + } ] + }, { + "url": "http://hl7.org/fhir/StructureDefinition/patient-mothersMaidenName", + "valueString": "Kittie678 Doyle959" + }, { + "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex", + "valueCode": "M" + }, { + "url": "http://hl7.org/fhir/StructureDefinition/patient-birthPlace", + "valueAddress": { + "city": "Wayland", + "state": "Massachusetts", + "country": "US" + } + }, { + "url": "http://synthetichealth.github.io/synthea/disability-adjusted-life-years", + "valueDecimal": 2.0028929627142285 + }, { + "url": "http://synthetichealth.github.io/synthea/quality-adjusted-life-years", + "valueDecimal": 67.99710703728577 + } ], + "identifier": [ { + "system": "https://github.com/synthetichealth/synthea", + "value": "d5582579-7193-4866-5560-a01e723b6552" + }, { + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/v2-0203", + "code": "MR", + "display": "Medical Record Number" + } ], + "text": "Medical Record Number" + }, + "system": "http://hospital.smarthealthit.org", + "value": "d5582579-7193-4866-5560-a01e723b6552" + }, { + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/v2-0203", + "code": "SS", + "display": "Social Security Number" + } ], + "text": "Social Security Number" + }, + "system": "http://hl7.org/fhir/sid/us-ssn", + "value": "999-34-2070" + }, { + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/v2-0203", + "code": "DL", + "display": "Driver's License" + } ], + "text": "Driver's License" + }, + "system": "urn:oid:2.16.840.1.113883.4.3.25", + "value": "S99966502" + }, { + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/v2-0203", + "code": "PPN", + "display": "Passport Number" + } ], + "text": "Passport Number" + }, + "system": "http://standardhealthrecord.org/fhir/StructureDefinition/passportNumber", + "value": "X89909962X" + } ], + "name": [ { + "use": "official", + "family": "Gerlach374", + "given": [ "Lindsay928" ], + "prefix": [ "Mr." ] + } ], + "telecom": [ { + "system": "phone", + "value": "555-450-5873", + "use": "home" + } ], + "gender": "male", + "birthDate": "1950-10-24", + "address": [ { + "extension": [ { + "url": "http://hl7.org/fhir/StructureDefinition/geolocation", + "extension": [ { + "url": "latitude", + "valueDecimal": 42.167344139459686 + }, { + "url": "longitude", + "valueDecimal": -71.07262371813607 + } ] + } ], + "line": [ "690 Raynor Overpass" ], + "city": "Randolph", + "state": "MA", + "country": "US" + } ], + "maritalStatus": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/v3-MaritalStatus", + "code": "M", + "display": "M" + } ], + "text": "M" + }, + "multipleBirthBoolean": false, + "communication": [ { + "language": { + "coding": [ { + "system": "urn:ietf:bcp:47", + "code": "en-US", + "display": "English" + } ], + "text": "English" + } + } ] + }, + "request": { + "method": "POST", + "url": "Patient" + } + }, { + "fullUrl": "urn:uuid:3699e7e7-8b1b-4a68-8011-e7a166598566", + "resource": { + "resourceType": "Encounter", + "id": "3699e7e7-8b1b-4a68-8011-e7a166598566", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter", "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter" ] + }, + "identifier": [ { + "use": "official", + "system": "https://github.com/synthetichealth/synthea", + "value": "3699e7e7-8b1b-4a68-8011-e7a166598566" + } ], + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB" + }, + "type": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "162673000", + "display": "General examination of patient (procedure)" + } ], + "text": "General examination of patient (procedure)" + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Mr. Lindsay928 Gerlach374" + }, + "participant": [ { + "type": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType", + "code": "PPRF", + "display": "primary performer" + } ], + "text": "primary performer" + } ], + "period": { + "start": "1979-01-02T11:44:52-05:00", + "end": "1979-01-02T11:59:52-05:00" + }, + "individual": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999962229", + "display": "Dr. Alphonso102 Nienow652" + } + } ], + "period": { + "start": "1979-01-02T11:44:52-05:00", + "end": "1979-01-02T11:59:52-05:00" + }, + "location": [ { + "location": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|cb6521ac-69d9-3b02-b34a-15e5d2ed50ea", + "display": "PCP74147" + } + } ], + "serviceProvider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|dd406540-fa97-3a90-858e-0a0ea61cf07b", + "display": "PCP74147" + } + }, + "request": { + "method": "POST", + "url": "Encounter" + } + }, { + "fullUrl": "urn:uuid:9a01d04d-86de-75e6-5c07-a4ba74966e68", + "resource": { + "resourceType": "Condition", + "id": "9a01d04d-86de-75e6-5c07-a4ba74966e68", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-condition" ] + }, + "clinicalStatus": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/condition-clinical", + "code": "active" + } ] + }, + "verificationStatus": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status", + "code": "confirmed" + } ] + }, + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/condition-category", + "code": "encounter-diagnosis", + "display": "Encounter Diagnosis" + } ] + } ], + "code": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "15777000", + "display": "Prediabetes" + } ], + "text": "Prediabetes" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:3699e7e7-8b1b-4a68-8011-e7a166598566" + }, + "onsetDateTime": "1979-01-02T11:44:52-05:00", + "recordedDate": "1979-01-02T11:44:52-05:00" + }, + "request": { + "method": "POST", + "url": "Condition" + } + }, { + "fullUrl": "urn:uuid:585cb148-8912-c5f6-d96e-e3d5105e6c03", + "resource": { + "resourceType": "CareTeam", + "id": "585cb148-8912-c5f6-d96e-e3d5105e6c03", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-careteam" ] + }, + "status": "active", + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:3699e7e7-8b1b-4a68-8011-e7a166598566" + }, + "period": { + "start": "1979-01-02T11:44:52-05:00" + }, + "participant": [ { + "role": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "116154003", + "display": "Patient" + } ], + "text": "Patient" + } ], + "member": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Mr. Lindsay928 Gerlach374" + } + }, { + "role": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "223366009", + "display": "Healthcare professional (occupation)" + } ], + "text": "Healthcare professional (occupation)" + } ], + "member": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999962229", + "display": "Dr. Alphonso102 Nienow652" + } + }, { + "role": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "224891009", + "display": "Healthcare services (qualifier value)" + } ], + "text": "Healthcare services (qualifier value)" + } ], + "member": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|dd406540-fa97-3a90-858e-0a0ea61cf07b", + "display": "PCP74147" + } + } ], + "reasonCode": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "15777000", + "display": "Prediabetes" + } ], + "text": "Prediabetes" + } ], + "managingOrganization": [ { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|dd406540-fa97-3a90-858e-0a0ea61cf07b", + "display": "PCP74147" + } ] + }, + "request": { + "method": "POST", + "url": "CareTeam" + } + }, { + "fullUrl": "urn:uuid:50a0789d-acf1-9448-58f3-5edce8b59e73", + "resource": { + "resourceType": "CarePlan", + "id": "50a0789d-acf1-9448-58f3-5edce8b59e73", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-careplan" ] + }, + "text": { + "status": "generated", + "div": "
Care Plan for Diabetes self management plan.
Activities:
  • Diabetes self management plan
  • Diabetes self management plan

Care plan is meant to treat Prediabetes.
" + }, + "status": "active", + "intent": "order", + "category": [ { + "coding": [ { + "system": "http://hl7.org/fhir/us/core/CodeSystem/careplan-category", + "code": "assess-plan" + } ] + }, { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "698360004", + "display": "Diabetes self management plan" + } ], + "text": "Diabetes self management plan" + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:3699e7e7-8b1b-4a68-8011-e7a166598566" + }, + "period": { + "start": "1979-01-02T11:44:52-05:00" + }, + "careTeam": [ { + "reference": "urn:uuid:585cb148-8912-c5f6-d96e-e3d5105e6c03" + } ], + "addresses": [ { + "reference": "urn:uuid:9a01d04d-86de-75e6-5c07-a4ba74966e68" + } ], + "activity": [ { + "detail": { + "code": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "160670007", + "display": "Diabetic diet" + } ], + "text": "Diabetic diet" + }, + "status": "in-progress", + "location": { + "display": "PCP74147" + } + } + }, { + "detail": { + "code": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "229065009", + "display": "Exercise therapy" + } ], + "text": "Exercise therapy" + }, + "status": "in-progress", + "location": { + "display": "PCP74147" + } + } + } ] + }, + "request": { + "method": "POST", + "url": "CarePlan" + } + }, { + "fullUrl": "urn:uuid:d96f0eb1-e968-03d9-fd4c-d38d5192c590", + "resource": { + "resourceType": "DiagnosticReport", + "id": "d96f0eb1-e968-03d9-fd4c-d38d5192c590", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-note" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:3699e7e7-8b1b-4a68-8011-e7a166598566" + }, + "effectiveDateTime": "1979-01-02T11:44:52-05:00", + "issued": "1979-01-02T11:44:52.558-05:00", + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999962229", + "display": "Dr. Alphonso102 Nienow652" + } ], + "presentedForm": [ { + "contentType": "text/plain; charset=utf-8", + "data": "CjE5NzktMDEtMDIKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgMjggeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuCgojIFNvY2lhbCBIaXN0b3J5ClBhdGllbnQgaXMgbWFycmllZC4gUGF0aWVudCBpcyBhbiBhY3RpdmUgc21va2VyIGFuZCBpcyBhbiBhbGNvaG9saWMuCiBQYXRpZW50IGlkZW50aWZpZXMgYXMgaGV0ZXJvc2V4dWFsLgoKUGF0aWVudCBjb21lcyBmcm9tIGEgbWlkZGxlIHNvY2lvZWNvbm9taWMgYmFja2dyb3VuZC4KIFBhdGllbnQgaGFzIGNvbXBsZXRlZCBzb21lIGNvbGxlZ2UgY291cnNlcy4KUGF0aWVudCBjdXJyZW50bHkgaGFzIEh1bWFuYS4KCiMgQWxsZXJnaWVzCk5vIEtub3duIEFsbGVyZ2llcy4KCiMgTWVkaWNhdGlvbnMKTm8gQWN0aXZlIE1lZGljYXRpb25zLgoKIyBBc3Nlc3NtZW50IGFuZCBQbGFuClBhdGllbnQgaXMgcHJlc2VudGluZyB3aXRoIHByZWRpYWJldGVzLiAKCiMjIFBsYW4KClRoZSBwYXRpZW50IHdhcyBwbGFjZWQgb24gYSBjYXJlcGxhbjoKLSBkaWFiZXRlcyBzZWxmIG1hbmFnZW1lbnQgcGxhbgo=" + } ] + }, + "request": { + "method": "POST", + "url": "DiagnosticReport" + } + }, { + "fullUrl": "urn:uuid:e7f6193d-3d3a-9f9a-ee20-e746902dba0b", + "resource": { + "resourceType": "DocumentReference", + "id": "e7f6193d-3d3a-9f9a-ee20-e746902dba0b", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-documentreference" ] + }, + "identifier": [ { + "system": "urn:ietf:rfc:3986", + "value": "urn:uuid:d96f0eb1-e968-03d9-fd4c-d38d5192c590" + } ], + "status": "superseded", + "type": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "category": [ { + "coding": [ { + "system": "http://hl7.org/fhir/us/core/CodeSystem/us-core-documentreference-category", + "code": "clinical-note", + "display": "Clinical Note" + } ] + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "date": "1979-01-02T11:44:52.558-05:00", + "author": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999962229", + "display": "Dr. Alphonso102 Nienow652" + } ], + "custodian": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|dd406540-fa97-3a90-858e-0a0ea61cf07b", + "display": "PCP74147" + }, + "content": [ { + "attachment": { + "contentType": "text/plain; charset=utf-8", + "data": "CjE5NzktMDEtMDIKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgMjggeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuCgojIFNvY2lhbCBIaXN0b3J5ClBhdGllbnQgaXMgbWFycmllZC4gUGF0aWVudCBpcyBhbiBhY3RpdmUgc21va2VyIGFuZCBpcyBhbiBhbGNvaG9saWMuCiBQYXRpZW50IGlkZW50aWZpZXMgYXMgaGV0ZXJvc2V4dWFsLgoKUGF0aWVudCBjb21lcyBmcm9tIGEgbWlkZGxlIHNvY2lvZWNvbm9taWMgYmFja2dyb3VuZC4KIFBhdGllbnQgaGFzIGNvbXBsZXRlZCBzb21lIGNvbGxlZ2UgY291cnNlcy4KUGF0aWVudCBjdXJyZW50bHkgaGFzIEh1bWFuYS4KCiMgQWxsZXJnaWVzCk5vIEtub3duIEFsbGVyZ2llcy4KCiMgTWVkaWNhdGlvbnMKTm8gQWN0aXZlIE1lZGljYXRpb25zLgoKIyBBc3Nlc3NtZW50IGFuZCBQbGFuClBhdGllbnQgaXMgcHJlc2VudGluZyB3aXRoIHByZWRpYWJldGVzLiAKCiMjIFBsYW4KClRoZSBwYXRpZW50IHdhcyBwbGFjZWQgb24gYSBjYXJlcGxhbjoKLSBkaWFiZXRlcyBzZWxmIG1hbmFnZW1lbnQgcGxhbgo=" + }, + "format": { + "system": "http://ihe.net/fhir/ValueSet/IHE.FormatCode.codesystem", + "code": "urn:ihe:iti:xds:2017:mimeTypeSufficient", + "display": "mimeType Sufficient" + } + } ], + "context": { + "encounter": [ { + "reference": "urn:uuid:3699e7e7-8b1b-4a68-8011-e7a166598566" + } ], + "period": { + "start": "1979-01-02T11:44:52-05:00", + "end": "1979-01-02T11:59:52-05:00" + } + } + }, + "request": { + "method": "POST", + "url": "DocumentReference" + } + }, { + "fullUrl": "urn:uuid:d0fbb53e-5571-bf4f-50fe-f4257ee5b6f7", + "resource": { + "resourceType": "Claim", + "id": "d0fbb53e-5571-bf4f-50fe-f4257ee5b6f7", + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Lindsay928 Gerlach374" + }, + "billablePeriod": { + "start": "1979-01-02T11:44:52-05:00", + "end": "1979-01-02T11:59:52-05:00" + }, + "created": "1979-01-02T11:59:52-05:00", + "provider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|dd406540-fa97-3a90-858e-0a0ea61cf07b", + "display": "PCP74147" + }, + "priority": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } ] + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|cb6521ac-69d9-3b02-b34a-15e5d2ed50ea", + "display": "PCP74147" + }, + "diagnosis": [ { + "sequence": 1, + "diagnosisReference": { + "reference": "urn:uuid:9a01d04d-86de-75e6-5c07-a4ba74966e68" + } + } ], + "insurance": [ { + "sequence": 1, + "focal": true, + "coverage": { + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "162673000", + "display": "General examination of patient (procedure)" + } ], + "text": "General examination of patient (procedure)" + }, + "encounter": [ { + "reference": "urn:uuid:3699e7e7-8b1b-4a68-8011-e7a166598566" + } ] + }, { + "sequence": 2, + "diagnosisSequence": [ 1 ], + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "15777000", + "display": "Prediabetes" + } ], + "text": "Prediabetes" + } + } ], + "total": { + "value": 129.16, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, { + "fullUrl": "urn:uuid:35a85c2e-272c-d6ba-cea3-134ce384378b", + "resource": { + "resourceType": "ExplanationOfBenefit", + "id": "35a85c2e-272c-d6ba-cea3-134ce384378b", + "contained": [ { + "resourceType": "ServiceRequest", + "id": "referral", + "status": "completed", + "intent": "order", + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "requester": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999962229" + }, + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999962229" + } ] + }, { + "resourceType": "Coverage", + "id": "coverage", + "status": "active", + "type": { + "text": "Humana" + }, + "beneficiary": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "payor": [ { + "display": "Humana" + } ] + } ], + "identifier": [ { + "system": "https://bluebutton.cms.gov/resources/variables/clm_id", + "value": "d0fbb53e-5571-bf4f-50fe-f4257ee5b6f7" + }, { + "system": "https://bluebutton.cms.gov/resources/identifier/claim-group", + "value": "99999999999" + } ], + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "billablePeriod": { + "start": "1979-01-02T11:59:52-05:00", + "end": "1980-01-02T11:59:52-05:00" + }, + "created": "1979-01-02T11:59:52-05:00", + "insurer": { + "display": "Humana" + }, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999962229" + }, + "referral": { + "reference": "#referral" + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|cb6521ac-69d9-3b02-b34a-15e5d2ed50ea", + "display": "PCP74147" + }, + "claim": { + "reference": "urn:uuid:d0fbb53e-5571-bf4f-50fe-f4257ee5b6f7" + }, + "outcome": "complete", + "careTeam": [ { + "sequence": 1, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999962229" + }, + "role": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", + "code": "primary", + "display": "Primary Care Practitioner" + } ] + } + } ], + "diagnosis": [ { + "sequence": 1, + "diagnosisReference": { + "reference": "urn:uuid:9a01d04d-86de-75e6-5c07-a4ba74966e68" + }, + "type": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-diagnosistype", + "code": "principal" + } ] + } ] + } ], + "insurance": [ { + "focal": true, + "coverage": { + "reference": "#coverage", + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } ] + }, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "162673000", + "display": "General examination of patient (procedure)" + } ], + "text": "General examination of patient (procedure)" + }, + "servicedPeriod": { + "start": "1979-01-02T11:44:52-05:00", + "end": "1979-01-02T11:59:52-05:00" + }, + "locationCodeableConcept": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "19", + "display": "Off Campus-Outpatient Hospital" + } ] + }, + "encounter": [ { + "reference": "urn:uuid:3699e7e7-8b1b-4a68-8011-e7a166598566" + } ] + }, { + "sequence": 2, + "diagnosisSequence": [ 1 ], + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } ] + }, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "15777000", + "display": "Prediabetes" + } ], + "text": "Prediabetes" + }, + "servicedPeriod": { + "start": "1979-01-02T11:44:52-05:00", + "end": "1979-01-02T11:59:52-05:00" + }, + "locationCodeableConcept": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "19", + "display": "Off Campus-Outpatient Hospital" + } ] + } + } ], + "total": [ { + "category": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/adjudication", + "code": "submitted", + "display": "Submitted Amount" + } ], + "text": "Submitted Amount" + }, + "amount": { + "value": 129.16, + "currency": "USD" + } + } ], + "payment": { + "amount": { + "value": 0.0, + "currency": "USD" + } + } + }, + "request": { + "method": "POST", + "url": "ExplanationOfBenefit" + } + }, { + "fullUrl": "urn:uuid:39ed6877-e739-12f8-1fae-f88933a96d26", + "resource": { + "resourceType": "Encounter", + "id": "39ed6877-e739-12f8-1fae-f88933a96d26", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter", "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter" ] + }, + "identifier": [ { + "use": "official", + "system": "https://github.com/synthetichealth/synthea", + "value": "39ed6877-e739-12f8-1fae-f88933a96d26" + } ], + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB" + }, + "type": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "162673000", + "display": "General examination of patient (procedure)" + } ], + "text": "General examination of patient (procedure)" + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Mr. Lindsay928 Gerlach374" + }, + "participant": [ { + "type": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType", + "code": "PPRF", + "display": "primary performer" + } ], + "text": "primary performer" + } ], + "period": { + "start": "1985-01-08T11:44:52-05:00", + "end": "1985-01-08T11:59:52-05:00" + }, + "individual": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999962229", + "display": "Dr. Alphonso102 Nienow652" + } + } ], + "period": { + "start": "1985-01-08T11:44:52-05:00", + "end": "1985-01-08T11:59:52-05:00" + }, + "location": [ { + "location": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|cb6521ac-69d9-3b02-b34a-15e5d2ed50ea", + "display": "PCP74147" + } + } ], + "serviceProvider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|dd406540-fa97-3a90-858e-0a0ea61cf07b", + "display": "PCP74147" + } + }, + "request": { + "method": "POST", + "url": "Encounter" + } + }, { + "fullUrl": "urn:uuid:dc6aed26-e8a9-ea2a-87dc-7317047b9192", + "resource": { + "resourceType": "Condition", + "id": "dc6aed26-e8a9-ea2a-87dc-7317047b9192", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-condition" ] + }, + "clinicalStatus": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/condition-clinical", + "code": "active" + } ] + }, + "verificationStatus": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status", + "code": "confirmed" + } ] + }, + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/condition-category", + "code": "encounter-diagnosis", + "display": "Encounter Diagnosis" + } ] + } ], + "code": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "271737000", + "display": "Anemia (disorder)" + } ], + "text": "Anemia (disorder)" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:39ed6877-e739-12f8-1fae-f88933a96d26" + }, + "onsetDateTime": "1985-01-08T11:44:52-05:00", + "recordedDate": "1985-01-08T11:44:52-05:00" + }, + "request": { + "method": "POST", + "url": "Condition" + } + }, { + "fullUrl": "urn:uuid:d6aed4e0-ee78-8156-7296-a7bc4482998c", + "resource": { + "resourceType": "DiagnosticReport", + "id": "d6aed4e0-ee78-8156-7296-a7bc4482998c", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-note" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:39ed6877-e739-12f8-1fae-f88933a96d26" + }, + "effectiveDateTime": "1985-01-08T11:44:52-05:00", + "issued": "1985-01-08T11:44:52.558-05:00", + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999962229", + "display": "Dr. Alphonso102 Nienow652" + } ], + "presentedForm": [ { + "contentType": "text/plain; charset=utf-8", + "data": "CjE5ODUtMDEtMDgKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgMzQgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuCgojIFNvY2lhbCBIaXN0b3J5ClBhdGllbnQgaXMgbWFycmllZC4gUGF0aWVudCBpcyBhbiBhY3RpdmUgc21va2VyIGFuZCBpcyBhbiBhbGNvaG9saWMuCiBQYXRpZW50IGlkZW50aWZpZXMgYXMgaGV0ZXJvc2V4dWFsLgoKUGF0aWVudCBjb21lcyBmcm9tIGEgbWlkZGxlIHNvY2lvZWNvbm9taWMgYmFja2dyb3VuZC4KIFBhdGllbnQgaGFzIGNvbXBsZXRlZCBzb21lIGNvbGxlZ2UgY291cnNlcy4KUGF0aWVudCBjdXJyZW50bHkgaGFzIEh1bWFuYS4KCiMgQWxsZXJnaWVzCk5vIEtub3duIEFsbGVyZ2llcy4KCiMgTWVkaWNhdGlvbnMKTm8gQWN0aXZlIE1lZGljYXRpb25zLgoKIyBBc3Nlc3NtZW50IGFuZCBQbGFuClBhdGllbnQgaXMgcHJlc2VudGluZyB3aXRoIGFuZW1pYSAoZGlzb3JkZXIpLiAKCiMjIFBsYW4KCg==" + } ] + }, + "request": { + "method": "POST", + "url": "DiagnosticReport" + } + }, { + "fullUrl": "urn:uuid:abd27c13-3d19-0c90-fd24-581ea52e0b84", + "resource": { + "resourceType": "DocumentReference", + "id": "abd27c13-3d19-0c90-fd24-581ea52e0b84", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-documentreference" ] + }, + "identifier": [ { + "system": "urn:ietf:rfc:3986", + "value": "urn:uuid:d6aed4e0-ee78-8156-7296-a7bc4482998c" + } ], + "status": "superseded", + "type": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "category": [ { + "coding": [ { + "system": "http://hl7.org/fhir/us/core/CodeSystem/us-core-documentreference-category", + "code": "clinical-note", + "display": "Clinical Note" + } ] + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "date": "1985-01-08T11:44:52.558-05:00", + "author": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999962229", + "display": "Dr. Alphonso102 Nienow652" + } ], + "custodian": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|dd406540-fa97-3a90-858e-0a0ea61cf07b", + "display": "PCP74147" + }, + "content": [ { + "attachment": { + "contentType": "text/plain; charset=utf-8", + "data": "CjE5ODUtMDEtMDgKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgMzQgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuCgojIFNvY2lhbCBIaXN0b3J5ClBhdGllbnQgaXMgbWFycmllZC4gUGF0aWVudCBpcyBhbiBhY3RpdmUgc21va2VyIGFuZCBpcyBhbiBhbGNvaG9saWMuCiBQYXRpZW50IGlkZW50aWZpZXMgYXMgaGV0ZXJvc2V4dWFsLgoKUGF0aWVudCBjb21lcyBmcm9tIGEgbWlkZGxlIHNvY2lvZWNvbm9taWMgYmFja2dyb3VuZC4KIFBhdGllbnQgaGFzIGNvbXBsZXRlZCBzb21lIGNvbGxlZ2UgY291cnNlcy4KUGF0aWVudCBjdXJyZW50bHkgaGFzIEh1bWFuYS4KCiMgQWxsZXJnaWVzCk5vIEtub3duIEFsbGVyZ2llcy4KCiMgTWVkaWNhdGlvbnMKTm8gQWN0aXZlIE1lZGljYXRpb25zLgoKIyBBc3Nlc3NtZW50IGFuZCBQbGFuClBhdGllbnQgaXMgcHJlc2VudGluZyB3aXRoIGFuZW1pYSAoZGlzb3JkZXIpLiAKCiMjIFBsYW4KCg==" + }, + "format": { + "system": "http://ihe.net/fhir/ValueSet/IHE.FormatCode.codesystem", + "code": "urn:ihe:iti:xds:2017:mimeTypeSufficient", + "display": "mimeType Sufficient" + } + } ], + "context": { + "encounter": [ { + "reference": "urn:uuid:39ed6877-e739-12f8-1fae-f88933a96d26" + } ], + "period": { + "start": "1985-01-08T11:44:52-05:00", + "end": "1985-01-08T11:59:52-05:00" + } + } + }, + "request": { + "method": "POST", + "url": "DocumentReference" + } + }, { + "fullUrl": "urn:uuid:ca1b3a6d-7643-8d54-225e-cb534d1afea0", + "resource": { + "resourceType": "Claim", + "id": "ca1b3a6d-7643-8d54-225e-cb534d1afea0", + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Lindsay928 Gerlach374" + }, + "billablePeriod": { + "start": "1985-01-08T11:44:52-05:00", + "end": "1985-01-08T11:59:52-05:00" + }, + "created": "1985-01-08T11:59:52-05:00", + "provider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|dd406540-fa97-3a90-858e-0a0ea61cf07b", + "display": "PCP74147" + }, + "priority": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } ] + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|cb6521ac-69d9-3b02-b34a-15e5d2ed50ea", + "display": "PCP74147" + }, + "diagnosis": [ { + "sequence": 1, + "diagnosisReference": { + "reference": "urn:uuid:dc6aed26-e8a9-ea2a-87dc-7317047b9192" + } + } ], + "insurance": [ { + "sequence": 1, + "focal": true, + "coverage": { + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "162673000", + "display": "General examination of patient (procedure)" + } ], + "text": "General examination of patient (procedure)" + }, + "encounter": [ { + "reference": "urn:uuid:39ed6877-e739-12f8-1fae-f88933a96d26" + } ] + }, { + "sequence": 2, + "diagnosisSequence": [ 1 ], + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "271737000", + "display": "Anemia (disorder)" + } ], + "text": "Anemia (disorder)" + } + } ], + "total": { + "value": 129.16, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, { + "fullUrl": "urn:uuid:e5958f8f-e51f-9336-4796-2bb5590c8606", + "resource": { + "resourceType": "ExplanationOfBenefit", + "id": "e5958f8f-e51f-9336-4796-2bb5590c8606", + "contained": [ { + "resourceType": "ServiceRequest", + "id": "referral", + "status": "completed", + "intent": "order", + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "requester": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999962229" + }, + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999962229" + } ] + }, { + "resourceType": "Coverage", + "id": "coverage", + "status": "active", + "type": { + "text": "Humana" + }, + "beneficiary": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "payor": [ { + "display": "Humana" + } ] + } ], + "identifier": [ { + "system": "https://bluebutton.cms.gov/resources/variables/clm_id", + "value": "ca1b3a6d-7643-8d54-225e-cb534d1afea0" + }, { + "system": "https://bluebutton.cms.gov/resources/identifier/claim-group", + "value": "99999999999" + } ], + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "billablePeriod": { + "start": "1985-01-08T11:59:52-05:00", + "end": "1986-01-08T11:59:52-05:00" + }, + "created": "1985-01-08T11:59:52-05:00", + "insurer": { + "display": "Humana" + }, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999962229" + }, + "referral": { + "reference": "#referral" + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|cb6521ac-69d9-3b02-b34a-15e5d2ed50ea", + "display": "PCP74147" + }, + "claim": { + "reference": "urn:uuid:ca1b3a6d-7643-8d54-225e-cb534d1afea0" + }, + "outcome": "complete", + "careTeam": [ { + "sequence": 1, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999962229" + }, + "role": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", + "code": "primary", + "display": "Primary Care Practitioner" + } ] + } + } ], + "diagnosis": [ { + "sequence": 1, + "diagnosisReference": { + "reference": "urn:uuid:dc6aed26-e8a9-ea2a-87dc-7317047b9192" + }, + "type": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-diagnosistype", + "code": "principal" + } ] + } ] + } ], + "insurance": [ { + "focal": true, + "coverage": { + "reference": "#coverage", + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } ] + }, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "162673000", + "display": "General examination of patient (procedure)" + } ], + "text": "General examination of patient (procedure)" + }, + "servicedPeriod": { + "start": "1985-01-08T11:44:52-05:00", + "end": "1985-01-08T11:59:52-05:00" + }, + "locationCodeableConcept": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "19", + "display": "Off Campus-Outpatient Hospital" + } ] + }, + "encounter": [ { + "reference": "urn:uuid:39ed6877-e739-12f8-1fae-f88933a96d26" + } ] + }, { + "sequence": 2, + "diagnosisSequence": [ 1 ], + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } ] + }, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "271737000", + "display": "Anemia (disorder)" + } ], + "text": "Anemia (disorder)" + }, + "servicedPeriod": { + "start": "1985-01-08T11:44:52-05:00", + "end": "1985-01-08T11:59:52-05:00" + }, + "locationCodeableConcept": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "19", + "display": "Off Campus-Outpatient Hospital" + } ] + } + } ], + "total": [ { + "category": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/adjudication", + "code": "submitted", + "display": "Submitted Amount" + } ], + "text": "Submitted Amount" + }, + "amount": { + "value": 129.16, + "currency": "USD" + } + } ], + "payment": { + "amount": { + "value": 0.0, + "currency": "USD" + } + } + }, + "request": { + "method": "POST", + "url": "ExplanationOfBenefit" + } + }, { + "fullUrl": "urn:uuid:ece9e706-21d8-e2bc-02fd-6df6a7e90c5a", + "resource": { + "resourceType": "Encounter", + "id": "ece9e706-21d8-e2bc-02fd-6df6a7e90c5a", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter", "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter" ] + }, + "identifier": [ { + "use": "official", + "system": "https://github.com/synthetichealth/synthea", + "value": "ece9e706-21d8-e2bc-02fd-6df6a7e90c5a" + } ], + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB" + }, + "type": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "185347001", + "display": "Encounter for problem" + } ], + "text": "Encounter for problem" + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Mr. Lindsay928 Gerlach374" + }, + "participant": [ { + "type": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType", + "code": "PPRF", + "display": "primary performer" + } ], + "text": "primary performer" + } ], + "period": { + "start": "1985-01-09T14:59:56-05:00", + "end": "1985-01-09T15:14:56-05:00" + }, + "individual": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } + } ], + "period": { + "start": "1985-01-09T14:59:56-05:00", + "end": "1985-01-09T15:14:56-05:00" + }, + "reasonCode": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "271737000", + "display": "Anemia (disorder)" + } ] + } ], + "location": [ { + "location": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + } ], + "serviceProvider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + }, + "request": { + "method": "POST", + "url": "Encounter" + } + }, { + "fullUrl": "urn:uuid:5a252771-c39d-268a-5705-157c82336385", + "resource": { + "resourceType": "MedicationRequest", + "id": "5a252771-c39d-268a-5705-157c82336385", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-medicationrequest" ] + }, + "status": "active", + "intent": "order", + "medicationCodeableConcept": { + "coding": [ { + "system": "http://www.nlm.nih.gov/research/umls/rxnorm", + "code": "2001499", + "display": "Vitamin B 12 5 MG/ML Injectable Solution" + } ], + "text": "Vitamin B 12 5 MG/ML Injectable Solution" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:ece9e706-21d8-e2bc-02fd-6df6a7e90c5a" + }, + "authoredOn": "1985-01-09T14:59:56-05:00", + "requester": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } + }, + "request": { + "method": "POST", + "url": "MedicationRequest" + } + }, { + "fullUrl": "urn:uuid:1cad69e7-779e-8cb8-e1c7-2f3dbecd829f", + "resource": { + "resourceType": "Claim", + "id": "1cad69e7-779e-8cb8-e1c7-2f3dbecd829f", + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "pharmacy" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "billablePeriod": { + "start": "1985-01-09T14:59:56-05:00", + "end": "1985-01-09T15:14:56-05:00" + }, + "created": "1985-01-09T15:14:56-05:00", + "provider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "priority": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } ] + }, + "prescription": { + "reference": "urn:uuid:5a252771-c39d-268a-5705-157c82336385" + }, + "insurance": [ { + "sequence": 1, + "focal": true, + "coverage": { + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "185347001", + "display": "Encounter for problem" + } ], + "text": "Encounter for problem" + }, + "encounter": [ { + "reference": "urn:uuid:ece9e706-21d8-e2bc-02fd-6df6a7e90c5a" + } ] + } ], + "total": { + "value": 5.28, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, { + "fullUrl": "urn:uuid:964df1ee-29c7-7cb0-9448-21c3359bc872", + "resource": { + "resourceType": "DiagnosticReport", + "id": "964df1ee-29c7-7cb0-9448-21c3359bc872", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-note" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:ece9e706-21d8-e2bc-02fd-6df6a7e90c5a" + }, + "effectiveDateTime": "1985-01-09T14:59:56-05:00", + "issued": "1985-01-09T14:59:56.558-05:00", + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } ], + "presentedForm": [ { + "contentType": "text/plain; charset=utf-8", + "data": "CjE5ODUtMDEtMDkKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgMzQgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuCgojIFNvY2lhbCBIaXN0b3J5ClBhdGllbnQgaXMgbWFycmllZC4gUGF0aWVudCBpcyBhbiBhY3RpdmUgc21va2VyIGFuZCBpcyBhbiBhbGNvaG9saWMuCiBQYXRpZW50IGlkZW50aWZpZXMgYXMgaGV0ZXJvc2V4dWFsLgoKUGF0aWVudCBjb21lcyBmcm9tIGEgbWlkZGxlIHNvY2lvZWNvbm9taWMgYmFja2dyb3VuZC4KIFBhdGllbnQgaGFzIGNvbXBsZXRlZCBzb21lIGNvbGxlZ2UgY291cnNlcy4KUGF0aWVudCBjdXJyZW50bHkgaGFzIEh1bWFuYS4KCiMgQWxsZXJnaWVzCk5vIEtub3duIEFsbGVyZ2llcy4KCiMgTWVkaWNhdGlvbnMKTm8gQWN0aXZlIE1lZGljYXRpb25zLgoKIyBBc3Nlc3NtZW50IGFuZCBQbGFuCgoKIyMgUGxhbgoKVGhlIHBhdGllbnQgd2FzIHByZXNjcmliZWQgdGhlIGZvbGxvd2luZyBtZWRpY2F0aW9uczoKLSB2aXRhbWluIGIgMTIgNSBtZy9tbCBpbmplY3RhYmxlIHNvbHV0aW9uCg==" + } ] + }, + "request": { + "method": "POST", + "url": "DiagnosticReport" + } + }, { + "fullUrl": "urn:uuid:ddd94773-0a10-603b-729c-c0b00eb1c7ab", + "resource": { + "resourceType": "DocumentReference", + "id": "ddd94773-0a10-603b-729c-c0b00eb1c7ab", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-documentreference" ] + }, + "identifier": [ { + "system": "urn:ietf:rfc:3986", + "value": "urn:uuid:964df1ee-29c7-7cb0-9448-21c3359bc872" + } ], + "status": "superseded", + "type": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "category": [ { + "coding": [ { + "system": "http://hl7.org/fhir/us/core/CodeSystem/us-core-documentreference-category", + "code": "clinical-note", + "display": "Clinical Note" + } ] + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "date": "1985-01-09T14:59:56.558-05:00", + "author": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } ], + "custodian": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "content": [ { + "attachment": { + "contentType": "text/plain; charset=utf-8", + "data": "CjE5ODUtMDEtMDkKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgMzQgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuCgojIFNvY2lhbCBIaXN0b3J5ClBhdGllbnQgaXMgbWFycmllZC4gUGF0aWVudCBpcyBhbiBhY3RpdmUgc21va2VyIGFuZCBpcyBhbiBhbGNvaG9saWMuCiBQYXRpZW50IGlkZW50aWZpZXMgYXMgaGV0ZXJvc2V4dWFsLgoKUGF0aWVudCBjb21lcyBmcm9tIGEgbWlkZGxlIHNvY2lvZWNvbm9taWMgYmFja2dyb3VuZC4KIFBhdGllbnQgaGFzIGNvbXBsZXRlZCBzb21lIGNvbGxlZ2UgY291cnNlcy4KUGF0aWVudCBjdXJyZW50bHkgaGFzIEh1bWFuYS4KCiMgQWxsZXJnaWVzCk5vIEtub3duIEFsbGVyZ2llcy4KCiMgTWVkaWNhdGlvbnMKTm8gQWN0aXZlIE1lZGljYXRpb25zLgoKIyBBc3Nlc3NtZW50IGFuZCBQbGFuCgoKIyMgUGxhbgoKVGhlIHBhdGllbnQgd2FzIHByZXNjcmliZWQgdGhlIGZvbGxvd2luZyBtZWRpY2F0aW9uczoKLSB2aXRhbWluIGIgMTIgNSBtZy9tbCBpbmplY3RhYmxlIHNvbHV0aW9uCg==" + }, + "format": { + "system": "http://ihe.net/fhir/ValueSet/IHE.FormatCode.codesystem", + "code": "urn:ihe:iti:xds:2017:mimeTypeSufficient", + "display": "mimeType Sufficient" + } + } ], + "context": { + "encounter": [ { + "reference": "urn:uuid:ece9e706-21d8-e2bc-02fd-6df6a7e90c5a" + } ], + "period": { + "start": "1985-01-09T14:59:56-05:00", + "end": "1985-01-09T15:14:56-05:00" + } + } + }, + "request": { + "method": "POST", + "url": "DocumentReference" + } + }, { + "fullUrl": "urn:uuid:228198d5-764d-24fa-0499-3ffd67bdc94b", + "resource": { + "resourceType": "Claim", + "id": "228198d5-764d-24fa-0499-3ffd67bdc94b", + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Lindsay928 Gerlach374" + }, + "billablePeriod": { + "start": "1985-01-09T14:59:56-05:00", + "end": "1985-01-09T15:14:56-05:00" + }, + "created": "1985-01-09T15:14:56-05:00", + "provider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "priority": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } ] + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "insurance": [ { + "sequence": 1, + "focal": true, + "coverage": { + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "185347001", + "display": "Encounter for problem" + } ], + "text": "Encounter for problem" + }, + "encounter": [ { + "reference": "urn:uuid:ece9e706-21d8-e2bc-02fd-6df6a7e90c5a" + } ] + } ], + "total": { + "value": 77.49, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, { + "fullUrl": "urn:uuid:13136b82-44a9-4a67-f73e-3634e4235a87", + "resource": { + "resourceType": "ExplanationOfBenefit", + "id": "13136b82-44a9-4a67-f73e-3634e4235a87", + "contained": [ { + "resourceType": "ServiceRequest", + "id": "referral", + "status": "completed", + "intent": "order", + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "requester": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + } ] + }, { + "resourceType": "Coverage", + "id": "coverage", + "status": "active", + "type": { + "text": "Humana" + }, + "beneficiary": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "payor": [ { + "display": "Humana" + } ] + } ], + "identifier": [ { + "system": "https://bluebutton.cms.gov/resources/variables/clm_id", + "value": "228198d5-764d-24fa-0499-3ffd67bdc94b" + }, { + "system": "https://bluebutton.cms.gov/resources/identifier/claim-group", + "value": "99999999999" + } ], + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "billablePeriod": { + "start": "1985-01-09T15:14:56-05:00", + "end": "1986-01-09T15:14:56-05:00" + }, + "created": "1985-01-09T15:14:56-05:00", + "insurer": { + "display": "Humana" + }, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "referral": { + "reference": "#referral" + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "claim": { + "reference": "urn:uuid:228198d5-764d-24fa-0499-3ffd67bdc94b" + }, + "outcome": "complete", + "careTeam": [ { + "sequence": 1, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "role": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", + "code": "primary", + "display": "Primary Care Practitioner" + } ] + } + } ], + "insurance": [ { + "focal": true, + "coverage": { + "reference": "#coverage", + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } ] + }, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "185347001", + "display": "Encounter for problem" + } ], + "text": "Encounter for problem" + }, + "servicedPeriod": { + "start": "1985-01-09T14:59:56-05:00", + "end": "1985-01-09T15:14:56-05:00" + }, + "locationCodeableConcept": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "21", + "display": "Inpatient Hospital" + } ] + }, + "encounter": [ { + "reference": "urn:uuid:ece9e706-21d8-e2bc-02fd-6df6a7e90c5a" + } ] + } ], + "total": [ { + "category": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/adjudication", + "code": "submitted", + "display": "Submitted Amount" + } ], + "text": "Submitted Amount" + }, + "amount": { + "value": 77.49, + "currency": "USD" + } + } ], + "payment": { + "amount": { + "value": 0.0, + "currency": "USD" + } + } + }, + "request": { + "method": "POST", + "url": "ExplanationOfBenefit" + } + }, { + "fullUrl": "urn:uuid:d9a173d0-1f2b-3f19-0c22-6a6d210135a8", + "resource": { + "resourceType": "Encounter", + "id": "d9a173d0-1f2b-3f19-0c22-6a6d210135a8", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter", "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter" ] + }, + "identifier": [ { + "use": "official", + "system": "https://github.com/synthetichealth/synthea", + "value": "d9a173d0-1f2b-3f19-0c22-6a6d210135a8" + } ], + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB" + }, + "type": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "162673000", + "display": "General examination of patient (procedure)" + } ], + "text": "General examination of patient (procedure)" + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Mr. Lindsay928 Gerlach374" + }, + "participant": [ { + "type": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType", + "code": "PPRF", + "display": "primary performer" + } ], + "text": "primary performer" + } ], + "period": { + "start": "1990-10-30T11:44:52-05:00", + "end": "1990-10-30T11:59:52-05:00" + }, + "individual": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999962229", + "display": "Dr. Alphonso102 Nienow652" + } + } ], + "period": { + "start": "1990-10-30T11:44:52-05:00", + "end": "1990-10-30T11:59:52-05:00" + }, + "location": [ { + "location": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|cb6521ac-69d9-3b02-b34a-15e5d2ed50ea", + "display": "PCP74147" + } + } ], + "serviceProvider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|dd406540-fa97-3a90-858e-0a0ea61cf07b", + "display": "PCP74147" + } + }, + "request": { + "method": "POST", + "url": "Encounter" + } + }, { + "fullUrl": "urn:uuid:3b75960c-fab9-ce46-14d7-0d719e325532", + "resource": { + "resourceType": "Condition", + "id": "3b75960c-fab9-ce46-14d7-0d719e325532", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-condition" ] + }, + "clinicalStatus": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/condition-clinical", + "code": "active" + } ] + }, + "verificationStatus": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status", + "code": "confirmed" + } ] + }, + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/condition-category", + "code": "encounter-diagnosis", + "display": "Encounter Diagnosis" + } ] + } ], + "code": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "162864005", + "display": "Body mass index 30+ - obesity (finding)" + } ], + "text": "Body mass index 30+ - obesity (finding)" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:d9a173d0-1f2b-3f19-0c22-6a6d210135a8" + }, + "onsetDateTime": "1990-10-30T11:44:52-05:00", + "recordedDate": "1990-10-30T11:44:52-05:00" + }, + "request": { + "method": "POST", + "url": "Condition" + } + }, { + "fullUrl": "urn:uuid:a2e864d4-30cc-618a-d6b9-d240a3aa9548", + "resource": { + "resourceType": "DiagnosticReport", + "id": "a2e864d4-30cc-618a-d6b9-d240a3aa9548", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-note" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:d9a173d0-1f2b-3f19-0c22-6a6d210135a8" + }, + "effectiveDateTime": "1990-10-30T11:44:52-05:00", + "issued": "1990-10-30T11:44:52.558-05:00", + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999962229", + "display": "Dr. Alphonso102 Nienow652" + } ], + "presentedForm": [ { + "contentType": "text/plain; charset=utf-8", + "data": "CjE5OTAtMTAtMzAKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgNDAgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuCgojIFNvY2lhbCBIaXN0b3J5ClBhdGllbnQgaXMgbWFycmllZC4gUGF0aWVudCBpcyBhbiBhY3RpdmUgc21va2VyIGFuZCBpcyBhbiBhbGNvaG9saWMuCiBQYXRpZW50IGlkZW50aWZpZXMgYXMgaGV0ZXJvc2V4dWFsLgoKUGF0aWVudCBjb21lcyBmcm9tIGEgbWlkZGxlIHNvY2lvZWNvbm9taWMgYmFja2dyb3VuZC4KIFBhdGllbnQgaGFzIGNvbXBsZXRlZCBzb21lIGNvbGxlZ2UgY291cnNlcy4KUGF0aWVudCBjdXJyZW50bHkgaGFzIEh1bWFuYS4KCiMgQWxsZXJnaWVzCk5vIEtub3duIEFsbGVyZ2llcy4KCiMgTWVkaWNhdGlvbnMKTm8gQWN0aXZlIE1lZGljYXRpb25zLgoKIyBBc3Nlc3NtZW50IGFuZCBQbGFuClBhdGllbnQgaXMgcHJlc2VudGluZyB3aXRoIGJvZHkgbWFzcyBpbmRleCAzMCsgLSBvYmVzaXR5IChmaW5kaW5nKS4gCgojIyBQbGFuCgo=" + } ] + }, + "request": { + "method": "POST", + "url": "DiagnosticReport" + } + }, { + "fullUrl": "urn:uuid:8101b0a2-0637-1ae6-42eb-99bb15b1874e", + "resource": { + "resourceType": "DocumentReference", + "id": "8101b0a2-0637-1ae6-42eb-99bb15b1874e", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-documentreference" ] + }, + "identifier": [ { + "system": "urn:ietf:rfc:3986", + "value": "urn:uuid:a2e864d4-30cc-618a-d6b9-d240a3aa9548" + } ], + "status": "superseded", + "type": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "category": [ { + "coding": [ { + "system": "http://hl7.org/fhir/us/core/CodeSystem/us-core-documentreference-category", + "code": "clinical-note", + "display": "Clinical Note" + } ] + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "date": "1990-10-30T11:44:52.558-05:00", + "author": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999962229", + "display": "Dr. Alphonso102 Nienow652" + } ], + "custodian": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|dd406540-fa97-3a90-858e-0a0ea61cf07b", + "display": "PCP74147" + }, + "content": [ { + "attachment": { + "contentType": "text/plain; charset=utf-8", + "data": "CjE5OTAtMTAtMzAKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgNDAgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuCgojIFNvY2lhbCBIaXN0b3J5ClBhdGllbnQgaXMgbWFycmllZC4gUGF0aWVudCBpcyBhbiBhY3RpdmUgc21va2VyIGFuZCBpcyBhbiBhbGNvaG9saWMuCiBQYXRpZW50IGlkZW50aWZpZXMgYXMgaGV0ZXJvc2V4dWFsLgoKUGF0aWVudCBjb21lcyBmcm9tIGEgbWlkZGxlIHNvY2lvZWNvbm9taWMgYmFja2dyb3VuZC4KIFBhdGllbnQgaGFzIGNvbXBsZXRlZCBzb21lIGNvbGxlZ2UgY291cnNlcy4KUGF0aWVudCBjdXJyZW50bHkgaGFzIEh1bWFuYS4KCiMgQWxsZXJnaWVzCk5vIEtub3duIEFsbGVyZ2llcy4KCiMgTWVkaWNhdGlvbnMKTm8gQWN0aXZlIE1lZGljYXRpb25zLgoKIyBBc3Nlc3NtZW50IGFuZCBQbGFuClBhdGllbnQgaXMgcHJlc2VudGluZyB3aXRoIGJvZHkgbWFzcyBpbmRleCAzMCsgLSBvYmVzaXR5IChmaW5kaW5nKS4gCgojIyBQbGFuCgo=" + }, + "format": { + "system": "http://ihe.net/fhir/ValueSet/IHE.FormatCode.codesystem", + "code": "urn:ihe:iti:xds:2017:mimeTypeSufficient", + "display": "mimeType Sufficient" + } + } ], + "context": { + "encounter": [ { + "reference": "urn:uuid:d9a173d0-1f2b-3f19-0c22-6a6d210135a8" + } ], + "period": { + "start": "1990-10-30T11:44:52-05:00", + "end": "1990-10-30T11:59:52-05:00" + } + } + }, + "request": { + "method": "POST", + "url": "DocumentReference" + } + }, { + "fullUrl": "urn:uuid:d7d9fca7-b110-0b0a-e659-a598fd845bd0", + "resource": { + "resourceType": "Claim", + "id": "d7d9fca7-b110-0b0a-e659-a598fd845bd0", + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Lindsay928 Gerlach374" + }, + "billablePeriod": { + "start": "1990-10-30T11:44:52-05:00", + "end": "1990-10-30T11:59:52-05:00" + }, + "created": "1990-10-30T11:59:52-05:00", + "provider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|dd406540-fa97-3a90-858e-0a0ea61cf07b", + "display": "PCP74147" + }, + "priority": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } ] + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|cb6521ac-69d9-3b02-b34a-15e5d2ed50ea", + "display": "PCP74147" + }, + "diagnosis": [ { + "sequence": 1, + "diagnosisReference": { + "reference": "urn:uuid:3b75960c-fab9-ce46-14d7-0d719e325532" + } + } ], + "insurance": [ { + "sequence": 1, + "focal": true, + "coverage": { + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "162673000", + "display": "General examination of patient (procedure)" + } ], + "text": "General examination of patient (procedure)" + }, + "encounter": [ { + "reference": "urn:uuid:d9a173d0-1f2b-3f19-0c22-6a6d210135a8" + } ] + }, { + "sequence": 2, + "diagnosisSequence": [ 1 ], + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "162864005", + "display": "Body mass index 30+ - obesity (finding)" + } ], + "text": "Body mass index 30+ - obesity (finding)" + } + } ], + "total": { + "value": 129.16, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, { + "fullUrl": "urn:uuid:35ddece1-bbbb-07d6-f232-869ce11206a1", + "resource": { + "resourceType": "ExplanationOfBenefit", + "id": "35ddece1-bbbb-07d6-f232-869ce11206a1", + "contained": [ { + "resourceType": "ServiceRequest", + "id": "referral", + "status": "completed", + "intent": "order", + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "requester": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999962229" + }, + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999962229" + } ] + }, { + "resourceType": "Coverage", + "id": "coverage", + "status": "active", + "type": { + "text": "Humana" + }, + "beneficiary": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "payor": [ { + "display": "Humana" + } ] + } ], + "identifier": [ { + "system": "https://bluebutton.cms.gov/resources/variables/clm_id", + "value": "d7d9fca7-b110-0b0a-e659-a598fd845bd0" + }, { + "system": "https://bluebutton.cms.gov/resources/identifier/claim-group", + "value": "99999999999" + } ], + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "billablePeriod": { + "start": "1990-10-30T11:59:52-05:00", + "end": "1991-10-30T11:59:52-05:00" + }, + "created": "1990-10-30T11:59:52-05:00", + "insurer": { + "display": "Humana" + }, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999962229" + }, + "referral": { + "reference": "#referral" + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|cb6521ac-69d9-3b02-b34a-15e5d2ed50ea", + "display": "PCP74147" + }, + "claim": { + "reference": "urn:uuid:d7d9fca7-b110-0b0a-e659-a598fd845bd0" + }, + "outcome": "complete", + "careTeam": [ { + "sequence": 1, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999962229" + }, + "role": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", + "code": "primary", + "display": "Primary Care Practitioner" + } ] + } + } ], + "diagnosis": [ { + "sequence": 1, + "diagnosisReference": { + "reference": "urn:uuid:3b75960c-fab9-ce46-14d7-0d719e325532" + }, + "type": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-diagnosistype", + "code": "principal" + } ] + } ] + } ], + "insurance": [ { + "focal": true, + "coverage": { + "reference": "#coverage", + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } ] + }, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "162673000", + "display": "General examination of patient (procedure)" + } ], + "text": "General examination of patient (procedure)" + }, + "servicedPeriod": { + "start": "1990-10-30T11:44:52-05:00", + "end": "1990-10-30T11:59:52-05:00" + }, + "locationCodeableConcept": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "19", + "display": "Off Campus-Outpatient Hospital" + } ] + }, + "encounter": [ { + "reference": "urn:uuid:d9a173d0-1f2b-3f19-0c22-6a6d210135a8" + } ] + }, { + "sequence": 2, + "diagnosisSequence": [ 1 ], + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } ] + }, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "162864005", + "display": "Body mass index 30+ - obesity (finding)" + } ], + "text": "Body mass index 30+ - obesity (finding)" + }, + "servicedPeriod": { + "start": "1990-10-30T11:44:52-05:00", + "end": "1990-10-30T11:59:52-05:00" + }, + "locationCodeableConcept": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "19", + "display": "Off Campus-Outpatient Hospital" + } ] + } + } ], + "total": [ { + "category": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/adjudication", + "code": "submitted", + "display": "Submitted Amount" + } ], + "text": "Submitted Amount" + }, + "amount": { + "value": 129.16, + "currency": "USD" + } + } ], + "payment": { + "amount": { + "value": 0.0, + "currency": "USD" + } + } + }, + "request": { + "method": "POST", + "url": "ExplanationOfBenefit" + } + }, { + "fullUrl": "urn:uuid:a2920167-37fd-e71e-4cff-3a095a130147", + "resource": { + "resourceType": "Encounter", + "id": "a2920167-37fd-e71e-4cff-3a095a130147", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter", "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter" ] + }, + "identifier": [ { + "use": "official", + "system": "https://github.com/synthetichealth/synthea", + "value": "a2920167-37fd-e71e-4cff-3a095a130147" + } ], + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB" + }, + "type": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "162673000", + "display": "General examination of patient (procedure)" + } ], + "text": "General examination of patient (procedure)" + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Mr. Lindsay928 Gerlach374" + }, + "participant": [ { + "type": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType", + "code": "PPRF", + "display": "primary performer" + } ], + "text": "primary performer" + } ], + "period": { + "start": "2002-11-05T11:44:52-05:00", + "end": "2002-11-05T11:59:52-05:00" + }, + "individual": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999962229", + "display": "Dr. Alphonso102 Nienow652" + } + } ], + "period": { + "start": "2002-11-05T11:44:52-05:00", + "end": "2002-11-05T11:59:52-05:00" + }, + "location": [ { + "location": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|cb6521ac-69d9-3b02-b34a-15e5d2ed50ea", + "display": "PCP74147" + } + } ], + "serviceProvider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|dd406540-fa97-3a90-858e-0a0ea61cf07b", + "display": "PCP74147" + } + }, + "request": { + "method": "POST", + "url": "Encounter" + } + }, { + "fullUrl": "urn:uuid:38863302-dad7-21ad-032c-2a53d4f04f96", + "resource": { + "resourceType": "Condition", + "id": "38863302-dad7-21ad-032c-2a53d4f04f96", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-condition" ] + }, + "clinicalStatus": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/condition-clinical", + "code": "active" + } ] + }, + "verificationStatus": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status", + "code": "confirmed" + } ] + }, + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/condition-category", + "code": "encounter-diagnosis", + "display": "Encounter Diagnosis" + } ] + } ], + "code": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "59621000", + "display": "Hypertension" + } ], + "text": "Hypertension" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:a2920167-37fd-e71e-4cff-3a095a130147" + }, + "onsetDateTime": "2002-11-05T11:44:52-05:00", + "recordedDate": "2002-11-05T11:44:52-05:00" + }, + "request": { + "method": "POST", + "url": "Condition" + } + }, { + "fullUrl": "urn:uuid:7b0e4502-5ced-228c-6255-071b0103aa9a", + "resource": { + "resourceType": "MedicationRequest", + "id": "7b0e4502-5ced-228c-6255-071b0103aa9a", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-medicationrequest" ] + }, + "status": "active", + "intent": "order", + "medicationCodeableConcept": { + "coding": [ { + "system": "http://www.nlm.nih.gov/research/umls/rxnorm", + "code": "310798", + "display": "Hydrochlorothiazide 25 MG Oral Tablet" + } ], + "text": "Hydrochlorothiazide 25 MG Oral Tablet" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:a2920167-37fd-e71e-4cff-3a095a130147" + }, + "authoredOn": "2002-11-05T11:44:52-05:00", + "requester": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999962229", + "display": "Dr. Alphonso102 Nienow652" + }, + "reasonReference": [ { + "reference": "urn:uuid:38863302-dad7-21ad-032c-2a53d4f04f96" + } ], + "dosageInstruction": [ { + "sequence": 1, + "timing": { + "repeat": { + "frequency": 1, + "period": 1.0, + "periodUnit": "d" + } + }, + "asNeededBoolean": false, + "doseAndRate": [ { + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/dose-rate-type", + "code": "ordered", + "display": "Ordered" + } ] + }, + "doseQuantity": { + "value": 1.0 + } + } ] + } ] + }, + "request": { + "method": "POST", + "url": "MedicationRequest" + } + }, { + "fullUrl": "urn:uuid:7861a855-6ff4-f5ba-aa6c-cbbbec91cfe0", + "resource": { + "resourceType": "Claim", + "id": "7861a855-6ff4-f5ba-aa6c-cbbbec91cfe0", + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "pharmacy" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "billablePeriod": { + "start": "2002-11-05T11:44:52-05:00", + "end": "2002-11-05T11:59:52-05:00" + }, + "created": "2002-11-05T11:59:52-05:00", + "provider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|dd406540-fa97-3a90-858e-0a0ea61cf07b", + "display": "PCP74147" + }, + "priority": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } ] + }, + "prescription": { + "reference": "urn:uuid:7b0e4502-5ced-228c-6255-071b0103aa9a" + }, + "insurance": [ { + "sequence": 1, + "focal": true, + "coverage": { + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "162673000", + "display": "General examination of patient (procedure)" + } ], + "text": "General examination of patient (procedure)" + }, + "encounter": [ { + "reference": "urn:uuid:a2920167-37fd-e71e-4cff-3a095a130147" + } ] + } ], + "total": { + "value": 0.01, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, { + "fullUrl": "urn:uuid:75b170ca-b797-6219-b4c4-d5a215fc5276", + "resource": { + "resourceType": "MedicationRequest", + "id": "75b170ca-b797-6219-b4c4-d5a215fc5276", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-medicationrequest" ] + }, + "status": "active", + "intent": "order", + "medicationCodeableConcept": { + "coding": [ { + "system": "http://www.nlm.nih.gov/research/umls/rxnorm", + "code": "314076", + "display": "lisinopril 10 MG Oral Tablet" + } ], + "text": "lisinopril 10 MG Oral Tablet" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:a2920167-37fd-e71e-4cff-3a095a130147" + }, + "authoredOn": "2002-11-05T11:44:52-05:00", + "requester": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999962229", + "display": "Dr. Alphonso102 Nienow652" + }, + "reasonReference": [ { + "reference": "urn:uuid:38863302-dad7-21ad-032c-2a53d4f04f96" + } ], + "dosageInstruction": [ { + "sequence": 1, + "timing": { + "repeat": { + "frequency": 1, + "period": 1.0, + "periodUnit": "d" + } + }, + "asNeededBoolean": false, + "doseAndRate": [ { + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/dose-rate-type", + "code": "ordered", + "display": "Ordered" + } ] + }, + "doseQuantity": { + "value": 1.0 + } + } ] + } ] + }, + "request": { + "method": "POST", + "url": "MedicationRequest" + } + }, { + "fullUrl": "urn:uuid:e05842ac-38a2-5be8-c434-6208920cdff8", + "resource": { + "resourceType": "Claim", + "id": "e05842ac-38a2-5be8-c434-6208920cdff8", + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "pharmacy" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "billablePeriod": { + "start": "2002-11-05T11:44:52-05:00", + "end": "2002-11-05T11:59:52-05:00" + }, + "created": "2002-11-05T11:59:52-05:00", + "provider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|dd406540-fa97-3a90-858e-0a0ea61cf07b", + "display": "PCP74147" + }, + "priority": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } ] + }, + "prescription": { + "reference": "urn:uuid:75b170ca-b797-6219-b4c4-d5a215fc5276" + }, + "insurance": [ { + "sequence": 1, + "focal": true, + "coverage": { + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "162673000", + "display": "General examination of patient (procedure)" + } ], + "text": "General examination of patient (procedure)" + }, + "encounter": [ { + "reference": "urn:uuid:a2920167-37fd-e71e-4cff-3a095a130147" + } ] + } ], + "total": { + "value": 0.02, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, { + "fullUrl": "urn:uuid:d3eed5ef-539d-5c27-0772-4201602d2e7c", + "resource": { + "resourceType": "CareTeam", + "id": "d3eed5ef-539d-5c27-0772-4201602d2e7c", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-careteam" ] + }, + "status": "active", + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:a2920167-37fd-e71e-4cff-3a095a130147" + }, + "period": { + "start": "2002-11-05T11:44:52-05:00" + }, + "participant": [ { + "role": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "116154003", + "display": "Patient" + } ], + "text": "Patient" + } ], + "member": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Mr. Lindsay928 Gerlach374" + } + }, { + "role": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "223366009", + "display": "Healthcare professional (occupation)" + } ], + "text": "Healthcare professional (occupation)" + } ], + "member": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999962229", + "display": "Dr. Alphonso102 Nienow652" + } + }, { + "role": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "224891009", + "display": "Healthcare services (qualifier value)" + } ], + "text": "Healthcare services (qualifier value)" + } ], + "member": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|dd406540-fa97-3a90-858e-0a0ea61cf07b", + "display": "PCP74147" + } + } ], + "reasonCode": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "59621000", + "display": "Hypertension" + } ], + "text": "Hypertension" + } ], + "managingOrganization": [ { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|dd406540-fa97-3a90-858e-0a0ea61cf07b", + "display": "PCP74147" + } ] + }, + "request": { + "method": "POST", + "url": "CareTeam" + } + }, { + "fullUrl": "urn:uuid:741cc63e-7607-1238-6a0d-b73a204ae2cf", + "resource": { + "resourceType": "CarePlan", + "id": "741cc63e-7607-1238-6a0d-b73a204ae2cf", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-careplan" ] + }, + "text": { + "status": "generated", + "div": "
Care Plan for Lifestyle education regarding hypertension.
Activities:
  • Lifestyle education regarding hypertension
  • Lifestyle education regarding hypertension
  • Lifestyle education regarding hypertension
  • Lifestyle education regarding hypertension

Care plan is meant to treat Hypertension.
" + }, + "status": "active", + "intent": "order", + "category": [ { + "coding": [ { + "system": "http://hl7.org/fhir/us/core/CodeSystem/careplan-category", + "code": "assess-plan" + } ] + }, { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "443402002", + "display": "Lifestyle education regarding hypertension" + } ], + "text": "Lifestyle education regarding hypertension" + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:a2920167-37fd-e71e-4cff-3a095a130147" + }, + "period": { + "start": "2002-11-05T11:44:52-05:00" + }, + "careTeam": [ { + "reference": "urn:uuid:d3eed5ef-539d-5c27-0772-4201602d2e7c" + } ], + "addresses": [ { + "reference": "urn:uuid:38863302-dad7-21ad-032c-2a53d4f04f96" + } ], + "activity": [ { + "detail": { + "code": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "386463000", + "display": "Prescribed activity/exercise education" + } ], + "text": "Prescribed activity/exercise education" + }, + "status": "in-progress", + "location": { + "display": "PCP74147" + } + } + }, { + "detail": { + "code": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "413473000", + "display": "Counseling about alcohol consumption" + } ], + "text": "Counseling about alcohol consumption" + }, + "status": "in-progress", + "location": { + "display": "PCP74147" + } + } + }, { + "detail": { + "code": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "1151000175103", + "display": "Dietary approaches to stop hypertension diet" + } ], + "text": "Dietary approaches to stop hypertension diet" + }, + "status": "in-progress", + "location": { + "display": "PCP74147" + } + } + }, { + "detail": { + "code": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "225323000", + "display": "Smoking cessation education" + } ], + "text": "Smoking cessation education" + }, + "status": "in-progress", + "location": { + "display": "PCP74147" + } + } + } ] + }, + "request": { + "method": "POST", + "url": "CarePlan" + } + }, { + "fullUrl": "urn:uuid:3c4434bb-9d92-013a-4df9-3d149fce706a", + "resource": { + "resourceType": "DiagnosticReport", + "id": "3c4434bb-9d92-013a-4df9-3d149fce706a", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-note" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:a2920167-37fd-e71e-4cff-3a095a130147" + }, + "effectiveDateTime": "2002-11-05T11:44:52-05:00", + "issued": "2002-11-05T11:44:52.558-05:00", + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999962229", + "display": "Dr. Alphonso102 Nienow652" + } ], + "presentedForm": [ { + "contentType": "text/plain; charset=utf-8", + "data": "CjIwMDItMTEtMDUKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgNTIgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuCgojIFNvY2lhbCBIaXN0b3J5ClBhdGllbnQgaXMgbWFycmllZC4gUGF0aWVudCBpcyBhbiBhY3RpdmUgc21va2VyIGFuZCBpcyBhbiBhbGNvaG9saWMuCiBQYXRpZW50IGlkZW50aWZpZXMgYXMgaGV0ZXJvc2V4dWFsLgoKUGF0aWVudCBjb21lcyBmcm9tIGEgbWlkZGxlIHNvY2lvZWNvbm9taWMgYmFja2dyb3VuZC4KIFBhdGllbnQgaGFzIGNvbXBsZXRlZCBzb21lIGNvbGxlZ2UgY291cnNlcy4KUGF0aWVudCBjdXJyZW50bHkgaGFzIEh1bWFuYS4KCiMgQWxsZXJnaWVzCk5vIEtub3duIEFsbGVyZ2llcy4KCiMgTWVkaWNhdGlvbnMKTm8gQWN0aXZlIE1lZGljYXRpb25zLgoKIyBBc3Nlc3NtZW50IGFuZCBQbGFuClBhdGllbnQgaXMgcHJlc2VudGluZyB3aXRoIGh5cGVydGVuc2lvbi4gCgojIyBQbGFuCgpUaGUgcGF0aWVudCB3YXMgcHJlc2NyaWJlZCB0aGUgZm9sbG93aW5nIG1lZGljYXRpb25zOgotIGh5ZHJvY2hsb3JvdGhpYXppZGUgMjUgbWcgb3JhbCB0YWJsZXQKLSBsaXNpbm9wcmlsIDEwIG1nIG9yYWwgdGFibGV0ClRoZSBwYXRpZW50IHdhcyBwbGFjZWQgb24gYSBjYXJlcGxhbjoKLSBsaWZlc3R5bGUgZWR1Y2F0aW9uIHJlZ2FyZGluZyBoeXBlcnRlbnNpb24K" + } ] + }, + "request": { + "method": "POST", + "url": "DiagnosticReport" + } + }, { + "fullUrl": "urn:uuid:e01ef8b2-0ac5-b1a7-1d36-78b8474d181b", + "resource": { + "resourceType": "DocumentReference", + "id": "e01ef8b2-0ac5-b1a7-1d36-78b8474d181b", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-documentreference" ] + }, + "identifier": [ { + "system": "urn:ietf:rfc:3986", + "value": "urn:uuid:3c4434bb-9d92-013a-4df9-3d149fce706a" + } ], + "status": "superseded", + "type": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "category": [ { + "coding": [ { + "system": "http://hl7.org/fhir/us/core/CodeSystem/us-core-documentreference-category", + "code": "clinical-note", + "display": "Clinical Note" + } ] + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "date": "2002-11-05T11:44:52.558-05:00", + "author": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999962229", + "display": "Dr. Alphonso102 Nienow652" + } ], + "custodian": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|dd406540-fa97-3a90-858e-0a0ea61cf07b", + "display": "PCP74147" + }, + "content": [ { + "attachment": { + "contentType": "text/plain; charset=utf-8", + "data": "CjIwMDItMTEtMDUKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgNTIgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuCgojIFNvY2lhbCBIaXN0b3J5ClBhdGllbnQgaXMgbWFycmllZC4gUGF0aWVudCBpcyBhbiBhY3RpdmUgc21va2VyIGFuZCBpcyBhbiBhbGNvaG9saWMuCiBQYXRpZW50IGlkZW50aWZpZXMgYXMgaGV0ZXJvc2V4dWFsLgoKUGF0aWVudCBjb21lcyBmcm9tIGEgbWlkZGxlIHNvY2lvZWNvbm9taWMgYmFja2dyb3VuZC4KIFBhdGllbnQgaGFzIGNvbXBsZXRlZCBzb21lIGNvbGxlZ2UgY291cnNlcy4KUGF0aWVudCBjdXJyZW50bHkgaGFzIEh1bWFuYS4KCiMgQWxsZXJnaWVzCk5vIEtub3duIEFsbGVyZ2llcy4KCiMgTWVkaWNhdGlvbnMKTm8gQWN0aXZlIE1lZGljYXRpb25zLgoKIyBBc3Nlc3NtZW50IGFuZCBQbGFuClBhdGllbnQgaXMgcHJlc2VudGluZyB3aXRoIGh5cGVydGVuc2lvbi4gCgojIyBQbGFuCgpUaGUgcGF0aWVudCB3YXMgcHJlc2NyaWJlZCB0aGUgZm9sbG93aW5nIG1lZGljYXRpb25zOgotIGh5ZHJvY2hsb3JvdGhpYXppZGUgMjUgbWcgb3JhbCB0YWJsZXQKLSBsaXNpbm9wcmlsIDEwIG1nIG9yYWwgdGFibGV0ClRoZSBwYXRpZW50IHdhcyBwbGFjZWQgb24gYSBjYXJlcGxhbjoKLSBsaWZlc3R5bGUgZWR1Y2F0aW9uIHJlZ2FyZGluZyBoeXBlcnRlbnNpb24K" + }, + "format": { + "system": "http://ihe.net/fhir/ValueSet/IHE.FormatCode.codesystem", + "code": "urn:ihe:iti:xds:2017:mimeTypeSufficient", + "display": "mimeType Sufficient" + } + } ], + "context": { + "encounter": [ { + "reference": "urn:uuid:a2920167-37fd-e71e-4cff-3a095a130147" + } ], + "period": { + "start": "2002-11-05T11:44:52-05:00", + "end": "2002-11-05T11:59:52-05:00" + } + } + }, + "request": { + "method": "POST", + "url": "DocumentReference" + } + }, { + "fullUrl": "urn:uuid:bcf8d4a2-08e7-42da-f848-c644901bbf29", + "resource": { + "resourceType": "Claim", + "id": "bcf8d4a2-08e7-42da-f848-c644901bbf29", + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Lindsay928 Gerlach374" + }, + "billablePeriod": { + "start": "2002-11-05T11:44:52-05:00", + "end": "2002-11-05T11:59:52-05:00" + }, + "created": "2002-11-05T11:59:52-05:00", + "provider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|dd406540-fa97-3a90-858e-0a0ea61cf07b", + "display": "PCP74147" + }, + "priority": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } ] + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|cb6521ac-69d9-3b02-b34a-15e5d2ed50ea", + "display": "PCP74147" + }, + "diagnosis": [ { + "sequence": 1, + "diagnosisReference": { + "reference": "urn:uuid:38863302-dad7-21ad-032c-2a53d4f04f96" + } + } ], + "insurance": [ { + "sequence": 1, + "focal": true, + "coverage": { + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "162673000", + "display": "General examination of patient (procedure)" + } ], + "text": "General examination of patient (procedure)" + }, + "encounter": [ { + "reference": "urn:uuid:a2920167-37fd-e71e-4cff-3a095a130147" + } ] + }, { + "sequence": 2, + "diagnosisSequence": [ 1 ], + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "59621000", + "display": "Hypertension" + } ], + "text": "Hypertension" + } + } ], + "total": { + "value": 129.16, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, { + "fullUrl": "urn:uuid:63af689b-e11b-10d0-3f26-e54d071594ba", + "resource": { + "resourceType": "ExplanationOfBenefit", + "id": "63af689b-e11b-10d0-3f26-e54d071594ba", + "contained": [ { + "resourceType": "ServiceRequest", + "id": "referral", + "status": "completed", + "intent": "order", + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "requester": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999962229" + }, + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999962229" + } ] + }, { + "resourceType": "Coverage", + "id": "coverage", + "status": "active", + "type": { + "text": "Humana" + }, + "beneficiary": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "payor": [ { + "display": "Humana" + } ] + } ], + "identifier": [ { + "system": "https://bluebutton.cms.gov/resources/variables/clm_id", + "value": "bcf8d4a2-08e7-42da-f848-c644901bbf29" + }, { + "system": "https://bluebutton.cms.gov/resources/identifier/claim-group", + "value": "99999999999" + } ], + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "billablePeriod": { + "start": "2002-11-05T11:59:52-05:00", + "end": "2003-11-05T11:59:52-05:00" + }, + "created": "2002-11-05T11:59:52-05:00", + "insurer": { + "display": "Humana" + }, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999962229" + }, + "referral": { + "reference": "#referral" + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|cb6521ac-69d9-3b02-b34a-15e5d2ed50ea", + "display": "PCP74147" + }, + "claim": { + "reference": "urn:uuid:bcf8d4a2-08e7-42da-f848-c644901bbf29" + }, + "outcome": "complete", + "careTeam": [ { + "sequence": 1, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999962229" + }, + "role": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", + "code": "primary", + "display": "Primary Care Practitioner" + } ] + } + } ], + "diagnosis": [ { + "sequence": 1, + "diagnosisReference": { + "reference": "urn:uuid:38863302-dad7-21ad-032c-2a53d4f04f96" + }, + "type": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-diagnosistype", + "code": "principal" + } ] + } ] + } ], + "insurance": [ { + "focal": true, + "coverage": { + "reference": "#coverage", + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } ] + }, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "162673000", + "display": "General examination of patient (procedure)" + } ], + "text": "General examination of patient (procedure)" + }, + "servicedPeriod": { + "start": "2002-11-05T11:44:52-05:00", + "end": "2002-11-05T11:59:52-05:00" + }, + "locationCodeableConcept": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "19", + "display": "Off Campus-Outpatient Hospital" + } ] + }, + "encounter": [ { + "reference": "urn:uuid:a2920167-37fd-e71e-4cff-3a095a130147" + } ] + }, { + "sequence": 2, + "diagnosisSequence": [ 1 ], + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } ] + }, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "59621000", + "display": "Hypertension" + } ], + "text": "Hypertension" + }, + "servicedPeriod": { + "start": "2002-11-05T11:44:52-05:00", + "end": "2002-11-05T11:59:52-05:00" + }, + "locationCodeableConcept": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "19", + "display": "Off Campus-Outpatient Hospital" + } ] + } + } ], + "total": [ { + "category": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/adjudication", + "code": "submitted", + "display": "Submitted Amount" + } ], + "text": "Submitted Amount" + }, + "amount": { + "value": 129.16, + "currency": "USD" + } + } ], + "payment": { + "amount": { + "value": 0.0, + "currency": "USD" + } + } + }, + "request": { + "method": "POST", + "url": "ExplanationOfBenefit" + } + }, { + "fullUrl": "urn:uuid:700e75cf-15d4-7232-e836-78871c5d2979", + "resource": { + "resourceType": "Encounter", + "id": "700e75cf-15d4-7232-e836-78871c5d2979", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter", "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter" ] + }, + "identifier": [ { + "use": "official", + "system": "https://github.com/synthetichealth/synthea", + "value": "700e75cf-15d4-7232-e836-78871c5d2979" + } ], + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB" + }, + "type": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "390906007", + "display": "Hypertension follow-up encounter" + } ], + "text": "Hypertension follow-up encounter" + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Mr. Lindsay928 Gerlach374" + }, + "participant": [ { + "type": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType", + "code": "PPRF", + "display": "primary performer" + } ], + "text": "primary performer" + } ], + "period": { + "start": "2002-12-05T11:44:52-05:00", + "end": "2002-12-05T11:59:52-05:00" + }, + "individual": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } + } ], + "period": { + "start": "2002-12-05T11:44:52-05:00", + "end": "2002-12-05T11:59:52-05:00" + }, + "reasonCode": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "59621000", + "display": "Hypertension" + } ] + } ], + "location": [ { + "location": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + } ], + "serviceProvider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + }, + "request": { + "method": "POST", + "url": "Encounter" + } + }, { + "fullUrl": "urn:uuid:7c744762-5174-d292-3a53-4cbbe324dd73", + "resource": { + "resourceType": "MedicationRequest", + "id": "7c744762-5174-d292-3a53-4cbbe324dd73", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-medicationrequest" ] + }, + "status": "active", + "intent": "order", + "medicationCodeableConcept": { + "coding": [ { + "system": "http://www.nlm.nih.gov/research/umls/rxnorm", + "code": "308136", + "display": "amLODIPine 2.5 MG Oral Tablet" + } ], + "text": "amLODIPine 2.5 MG Oral Tablet" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:700e75cf-15d4-7232-e836-78871c5d2979" + }, + "authoredOn": "2002-12-05T11:44:52-05:00", + "requester": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + }, + "reasonReference": [ { + "reference": "urn:uuid:38863302-dad7-21ad-032c-2a53d4f04f96" + } ], + "dosageInstruction": [ { + "sequence": 1, + "timing": { + "repeat": { + "frequency": 1, + "period": 1.0, + "periodUnit": "d" + } + }, + "asNeededBoolean": false, + "doseAndRate": [ { + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/dose-rate-type", + "code": "ordered", + "display": "Ordered" + } ] + }, + "doseQuantity": { + "value": 1.0 + } + } ] + } ] + }, + "request": { + "method": "POST", + "url": "MedicationRequest" + } + }, { + "fullUrl": "urn:uuid:788f9b05-0df5-c841-15e3-6fc1f93d2a91", + "resource": { + "resourceType": "Claim", + "id": "788f9b05-0df5-c841-15e3-6fc1f93d2a91", + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "pharmacy" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "billablePeriod": { + "start": "2002-12-05T11:44:52-05:00", + "end": "2002-12-05T11:59:52-05:00" + }, + "created": "2002-12-05T11:59:52-05:00", + "provider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "priority": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } ] + }, + "prescription": { + "reference": "urn:uuid:7c744762-5174-d292-3a53-4cbbe324dd73" + }, + "insurance": [ { + "sequence": 1, + "focal": true, + "coverage": { + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "390906007", + "display": "Hypertension follow-up encounter" + } ], + "text": "Hypertension follow-up encounter" + }, + "encounter": [ { + "reference": "urn:uuid:700e75cf-15d4-7232-e836-78871c5d2979" + } ] + } ], + "total": { + "value": 0.02, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, { + "fullUrl": "urn:uuid:2f79ba37-a1ba-7f6c-24a6-1796f46d69d7", + "resource": { + "resourceType": "DiagnosticReport", + "id": "2f79ba37-a1ba-7f6c-24a6-1796f46d69d7", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-note" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:700e75cf-15d4-7232-e836-78871c5d2979" + }, + "effectiveDateTime": "2002-12-05T11:44:52-05:00", + "issued": "2002-12-05T11:44:52.558-05:00", + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } ], + "presentedForm": [ { + "contentType": "text/plain; charset=utf-8", + "data": "CjIwMDItMTItMDUKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgNTIgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuCgojIFNvY2lhbCBIaXN0b3J5ClBhdGllbnQgaXMgbWFycmllZC4gUGF0aWVudCBpcyBhbiBhY3RpdmUgc21va2VyIGFuZCBpcyBhbiBhbGNvaG9saWMuCiBQYXRpZW50IGlkZW50aWZpZXMgYXMgaGV0ZXJvc2V4dWFsLgoKUGF0aWVudCBjb21lcyBmcm9tIGEgbWlkZGxlIHNvY2lvZWNvbm9taWMgYmFja2dyb3VuZC4KIFBhdGllbnQgaGFzIGNvbXBsZXRlZCBzb21lIGNvbGxlZ2UgY291cnNlcy4KUGF0aWVudCBjdXJyZW50bHkgaGFzIEh1bWFuYS4KCiMgQWxsZXJnaWVzCk5vIEtub3duIEFsbGVyZ2llcy4KCiMgTWVkaWNhdGlvbnMKTm8gQWN0aXZlIE1lZGljYXRpb25zLgoKIyBBc3Nlc3NtZW50IGFuZCBQbGFuCgoKIyMgUGxhbgoKVGhlIHBhdGllbnQgd2FzIHByZXNjcmliZWQgdGhlIGZvbGxvd2luZyBtZWRpY2F0aW9uczoKLSBhbWxvZGlwaW5lIDIuNSBtZyBvcmFsIHRhYmxldAo=" + } ] + }, + "request": { + "method": "POST", + "url": "DiagnosticReport" + } + }, { + "fullUrl": "urn:uuid:9f86f39f-6e45-5f0c-e286-bc48e0aab1b3", + "resource": { + "resourceType": "DocumentReference", + "id": "9f86f39f-6e45-5f0c-e286-bc48e0aab1b3", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-documentreference" ] + }, + "identifier": [ { + "system": "urn:ietf:rfc:3986", + "value": "urn:uuid:2f79ba37-a1ba-7f6c-24a6-1796f46d69d7" + } ], + "status": "superseded", + "type": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "category": [ { + "coding": [ { + "system": "http://hl7.org/fhir/us/core/CodeSystem/us-core-documentreference-category", + "code": "clinical-note", + "display": "Clinical Note" + } ] + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "date": "2002-12-05T11:44:52.558-05:00", + "author": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } ], + "custodian": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "content": [ { + "attachment": { + "contentType": "text/plain; charset=utf-8", + "data": "CjIwMDItMTItMDUKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgNTIgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuCgojIFNvY2lhbCBIaXN0b3J5ClBhdGllbnQgaXMgbWFycmllZC4gUGF0aWVudCBpcyBhbiBhY3RpdmUgc21va2VyIGFuZCBpcyBhbiBhbGNvaG9saWMuCiBQYXRpZW50IGlkZW50aWZpZXMgYXMgaGV0ZXJvc2V4dWFsLgoKUGF0aWVudCBjb21lcyBmcm9tIGEgbWlkZGxlIHNvY2lvZWNvbm9taWMgYmFja2dyb3VuZC4KIFBhdGllbnQgaGFzIGNvbXBsZXRlZCBzb21lIGNvbGxlZ2UgY291cnNlcy4KUGF0aWVudCBjdXJyZW50bHkgaGFzIEh1bWFuYS4KCiMgQWxsZXJnaWVzCk5vIEtub3duIEFsbGVyZ2llcy4KCiMgTWVkaWNhdGlvbnMKTm8gQWN0aXZlIE1lZGljYXRpb25zLgoKIyBBc3Nlc3NtZW50IGFuZCBQbGFuCgoKIyMgUGxhbgoKVGhlIHBhdGllbnQgd2FzIHByZXNjcmliZWQgdGhlIGZvbGxvd2luZyBtZWRpY2F0aW9uczoKLSBhbWxvZGlwaW5lIDIuNSBtZyBvcmFsIHRhYmxldAo=" + }, + "format": { + "system": "http://ihe.net/fhir/ValueSet/IHE.FormatCode.codesystem", + "code": "urn:ihe:iti:xds:2017:mimeTypeSufficient", + "display": "mimeType Sufficient" + } + } ], + "context": { + "encounter": [ { + "reference": "urn:uuid:700e75cf-15d4-7232-e836-78871c5d2979" + } ], + "period": { + "start": "2002-12-05T11:44:52-05:00", + "end": "2002-12-05T11:59:52-05:00" + } + } + }, + "request": { + "method": "POST", + "url": "DocumentReference" + } + }, { + "fullUrl": "urn:uuid:ae0a6eea-9c60-38b2-6c19-0ef19d311511", + "resource": { + "resourceType": "Claim", + "id": "ae0a6eea-9c60-38b2-6c19-0ef19d311511", + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Lindsay928 Gerlach374" + }, + "billablePeriod": { + "start": "2002-12-05T11:44:52-05:00", + "end": "2002-12-05T11:59:52-05:00" + }, + "created": "2002-12-05T11:59:52-05:00", + "provider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "priority": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } ] + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "insurance": [ { + "sequence": 1, + "focal": true, + "coverage": { + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "390906007", + "display": "Hypertension follow-up encounter" + } ], + "text": "Hypertension follow-up encounter" + }, + "encounter": [ { + "reference": "urn:uuid:700e75cf-15d4-7232-e836-78871c5d2979" + } ] + } ], + "total": { + "value": 77.49, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, { + "fullUrl": "urn:uuid:811a6967-f9ed-8c87-5004-addba6064aa3", + "resource": { + "resourceType": "ExplanationOfBenefit", + "id": "811a6967-f9ed-8c87-5004-addba6064aa3", + "contained": [ { + "resourceType": "ServiceRequest", + "id": "referral", + "status": "completed", + "intent": "order", + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "requester": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + } ] + }, { + "resourceType": "Coverage", + "id": "coverage", + "status": "active", + "type": { + "text": "Humana" + }, + "beneficiary": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "payor": [ { + "display": "Humana" + } ] + } ], + "identifier": [ { + "system": "https://bluebutton.cms.gov/resources/variables/clm_id", + "value": "ae0a6eea-9c60-38b2-6c19-0ef19d311511" + }, { + "system": "https://bluebutton.cms.gov/resources/identifier/claim-group", + "value": "99999999999" + } ], + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "billablePeriod": { + "start": "2002-12-05T11:59:52-05:00", + "end": "2003-12-05T11:59:52-05:00" + }, + "created": "2002-12-05T11:59:52-05:00", + "insurer": { + "display": "Humana" + }, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "referral": { + "reference": "#referral" + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "claim": { + "reference": "urn:uuid:ae0a6eea-9c60-38b2-6c19-0ef19d311511" + }, + "outcome": "complete", + "careTeam": [ { + "sequence": 1, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "role": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", + "code": "primary", + "display": "Primary Care Practitioner" + } ] + } + } ], + "insurance": [ { + "focal": true, + "coverage": { + "reference": "#coverage", + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } ] + }, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "390906007", + "display": "Hypertension follow-up encounter" + } ], + "text": "Hypertension follow-up encounter" + }, + "servicedPeriod": { + "start": "2002-12-05T11:44:52-05:00", + "end": "2002-12-05T11:59:52-05:00" + }, + "locationCodeableConcept": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "21", + "display": "Inpatient Hospital" + } ] + }, + "encounter": [ { + "reference": "urn:uuid:700e75cf-15d4-7232-e836-78871c5d2979" + } ] + } ], + "total": [ { + "category": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/adjudication", + "code": "submitted", + "display": "Submitted Amount" + } ], + "text": "Submitted Amount" + }, + "amount": { + "value": 77.49, + "currency": "USD" + } + } ], + "payment": { + "amount": { + "value": 0.0, + "currency": "USD" + } + } + }, + "request": { + "method": "POST", + "url": "ExplanationOfBenefit" + } + }, { + "fullUrl": "urn:uuid:92352c70-ea81-b0b5-a1ce-c211d3d4bce1", + "resource": { + "resourceType": "Encounter", + "id": "92352c70-ea81-b0b5-a1ce-c211d3d4bce1", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter", "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter" ] + }, + "identifier": [ { + "use": "official", + "system": "https://github.com/synthetichealth/synthea", + "value": "92352c70-ea81-b0b5-a1ce-c211d3d4bce1" + } ], + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB" + }, + "type": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "162673000", + "display": "General examination of patient (procedure)" + } ], + "text": "General examination of patient (procedure)" + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Mr. Lindsay928 Gerlach374" + }, + "participant": [ { + "type": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType", + "code": "PPRF", + "display": "primary performer" + } ], + "text": "primary performer" + } ], + "period": { + "start": "2006-11-28T11:44:52-05:00", + "end": "2006-11-28T11:59:52-05:00" + }, + "individual": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999962229", + "display": "Dr. Alphonso102 Nienow652" + } + } ], + "period": { + "start": "2006-11-28T11:44:52-05:00", + "end": "2006-11-28T11:59:52-05:00" + }, + "location": [ { + "location": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|cb6521ac-69d9-3b02-b34a-15e5d2ed50ea", + "display": "PCP74147" + } + } ], + "serviceProvider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|dd406540-fa97-3a90-858e-0a0ea61cf07b", + "display": "PCP74147" + } + }, + "request": { + "method": "POST", + "url": "Encounter" + } + }, { + "fullUrl": "urn:uuid:6a9a7725-785c-8b05-ec27-623301191651", + "resource": { + "resourceType": "Condition", + "id": "6a9a7725-785c-8b05-ec27-623301191651", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-condition" ] + }, + "clinicalStatus": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/condition-clinical", + "code": "active" + } ] + }, + "verificationStatus": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status", + "code": "confirmed" + } ] + }, + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/condition-category", + "code": "encounter-diagnosis", + "display": "Encounter Diagnosis" + } ] + } ], + "code": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "414545008", + "display": "Ischemic heart disease (disorder)" + } ], + "text": "Ischemic heart disease (disorder)" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:92352c70-ea81-b0b5-a1ce-c211d3d4bce1" + }, + "onsetDateTime": "2006-11-28T11:44:52-05:00", + "recordedDate": "2006-11-28T11:44:52-05:00" + }, + "request": { + "method": "POST", + "url": "Condition" + } + }, { + "fullUrl": "urn:uuid:2a654f5a-4512-c0c8-8829-ce88a0e5ce08", + "resource": { + "resourceType": "MedicationRequest", + "id": "2a654f5a-4512-c0c8-8829-ce88a0e5ce08", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-medicationrequest" ] + }, + "status": "active", + "intent": "order", + "medicationCodeableConcept": { + "coding": [ { + "system": "http://www.nlm.nih.gov/research/umls/rxnorm", + "code": "309362", + "display": "Clopidogrel 75 MG Oral Tablet" + } ], + "text": "Clopidogrel 75 MG Oral Tablet" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:92352c70-ea81-b0b5-a1ce-c211d3d4bce1" + }, + "authoredOn": "2006-12-05T11:44:52-05:00", + "requester": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999962229", + "display": "Dr. Alphonso102 Nienow652" + } + }, + "request": { + "method": "POST", + "url": "MedicationRequest" + } + }, { + "fullUrl": "urn:uuid:de5bda58-d5b4-786f-7536-b9aaa0864ca5", + "resource": { + "resourceType": "Claim", + "id": "de5bda58-d5b4-786f-7536-b9aaa0864ca5", + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "pharmacy" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "billablePeriod": { + "start": "2006-11-28T11:44:52-05:00", + "end": "2006-11-28T11:59:52-05:00" + }, + "created": "2006-11-28T11:59:52-05:00", + "provider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|dd406540-fa97-3a90-858e-0a0ea61cf07b", + "display": "PCP74147" + }, + "priority": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } ] + }, + "prescription": { + "reference": "urn:uuid:2a654f5a-4512-c0c8-8829-ce88a0e5ce08" + }, + "insurance": [ { + "sequence": 1, + "focal": true, + "coverage": { + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "162673000", + "display": "General examination of patient (procedure)" + } ], + "text": "General examination of patient (procedure)" + }, + "encounter": [ { + "reference": "urn:uuid:92352c70-ea81-b0b5-a1ce-c211d3d4bce1" + } ] + } ], + "total": { + "value": 48.82, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, { + "fullUrl": "urn:uuid:a62a167b-9ff4-e04a-24e8-871c17be6184", + "resource": { + "resourceType": "MedicationRequest", + "id": "a62a167b-9ff4-e04a-24e8-871c17be6184", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-medicationrequest" ] + }, + "status": "active", + "intent": "order", + "medicationCodeableConcept": { + "coding": [ { + "system": "http://www.nlm.nih.gov/research/umls/rxnorm", + "code": "312961", + "display": "Simvastatin 20 MG Oral Tablet" + } ], + "text": "Simvastatin 20 MG Oral Tablet" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:92352c70-ea81-b0b5-a1ce-c211d3d4bce1" + }, + "authoredOn": "2006-12-05T11:44:52-05:00", + "requester": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999962229", + "display": "Dr. Alphonso102 Nienow652" + } + }, + "request": { + "method": "POST", + "url": "MedicationRequest" + } + }, { + "fullUrl": "urn:uuid:a02d8d5e-2097-aae8-5e11-3f250b4692f1", + "resource": { + "resourceType": "Claim", + "id": "a02d8d5e-2097-aae8-5e11-3f250b4692f1", + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "pharmacy" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "billablePeriod": { + "start": "2006-11-28T11:44:52-05:00", + "end": "2006-11-28T11:59:52-05:00" + }, + "created": "2006-11-28T11:59:52-05:00", + "provider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|dd406540-fa97-3a90-858e-0a0ea61cf07b", + "display": "PCP74147" + }, + "priority": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } ] + }, + "prescription": { + "reference": "urn:uuid:a62a167b-9ff4-e04a-24e8-871c17be6184" + }, + "insurance": [ { + "sequence": 1, + "focal": true, + "coverage": { + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "162673000", + "display": "General examination of patient (procedure)" + } ], + "text": "General examination of patient (procedure)" + }, + "encounter": [ { + "reference": "urn:uuid:92352c70-ea81-b0b5-a1ce-c211d3d4bce1" + } ] + } ], + "total": { + "value": 14.79, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, { + "fullUrl": "urn:uuid:ed98c7e6-eba3-5cdd-2e32-61e53daa679f", + "resource": { + "resourceType": "MedicationRequest", + "id": "ed98c7e6-eba3-5cdd-2e32-61e53daa679f", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-medicationrequest" ] + }, + "status": "active", + "intent": "order", + "medicationCodeableConcept": { + "coding": [ { + "system": "http://www.nlm.nih.gov/research/umls/rxnorm", + "code": "866412", + "display": "24 HR metoprolol succinate 100 MG Extended Release Oral Tablet" + } ], + "text": "24 HR metoprolol succinate 100 MG Extended Release Oral Tablet" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:92352c70-ea81-b0b5-a1ce-c211d3d4bce1" + }, + "authoredOn": "2006-12-05T11:44:52-05:00", + "requester": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999962229", + "display": "Dr. Alphonso102 Nienow652" + } + }, + "request": { + "method": "POST", + "url": "MedicationRequest" + } + }, { + "fullUrl": "urn:uuid:eebab6dd-37a8-9d8f-cba8-7f527513794b", + "resource": { + "resourceType": "Claim", + "id": "eebab6dd-37a8-9d8f-cba8-7f527513794b", + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "pharmacy" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "billablePeriod": { + "start": "2006-11-28T11:44:52-05:00", + "end": "2006-11-28T11:59:52-05:00" + }, + "created": "2006-11-28T11:59:52-05:00", + "provider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|dd406540-fa97-3a90-858e-0a0ea61cf07b", + "display": "PCP74147" + }, + "priority": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } ] + }, + "prescription": { + "reference": "urn:uuid:ed98c7e6-eba3-5cdd-2e32-61e53daa679f" + }, + "insurance": [ { + "sequence": 1, + "focal": true, + "coverage": { + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "162673000", + "display": "General examination of patient (procedure)" + } ], + "text": "General examination of patient (procedure)" + }, + "encounter": [ { + "reference": "urn:uuid:92352c70-ea81-b0b5-a1ce-c211d3d4bce1" + } ] + } ], + "total": { + "value": 263.49, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, { + "fullUrl": "urn:uuid:2915b2c8-a6cf-e0ea-e232-be8624ae126b", + "resource": { + "resourceType": "MedicationRequest", + "id": "2915b2c8-a6cf-e0ea-e232-be8624ae126b", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-medicationrequest" ] + }, + "status": "active", + "intent": "order", + "medicationCodeableConcept": { + "coding": [ { + "system": "http://www.nlm.nih.gov/research/umls/rxnorm", + "code": "705129", + "display": "Nitroglycerin 0.4 MG/ACTUAT Mucosal Spray" + } ], + "text": "Nitroglycerin 0.4 MG/ACTUAT Mucosal Spray" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:92352c70-ea81-b0b5-a1ce-c211d3d4bce1" + }, + "authoredOn": "2006-12-05T11:44:52-05:00", + "requester": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999962229", + "display": "Dr. Alphonso102 Nienow652" + } + }, + "request": { + "method": "POST", + "url": "MedicationRequest" + } + }, { + "fullUrl": "urn:uuid:1f01bde4-0b29-1727-7ad7-ca8c92a129b0", + "resource": { + "resourceType": "Claim", + "id": "1f01bde4-0b29-1727-7ad7-ca8c92a129b0", + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "pharmacy" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "billablePeriod": { + "start": "2006-11-28T11:44:52-05:00", + "end": "2006-11-28T11:59:52-05:00" + }, + "created": "2006-11-28T11:59:52-05:00", + "provider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|dd406540-fa97-3a90-858e-0a0ea61cf07b", + "display": "PCP74147" + }, + "priority": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } ] + }, + "prescription": { + "reference": "urn:uuid:2915b2c8-a6cf-e0ea-e232-be8624ae126b" + }, + "insurance": [ { + "sequence": 1, + "focal": true, + "coverage": { + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "162673000", + "display": "General examination of patient (procedure)" + } ], + "text": "General examination of patient (procedure)" + }, + "encounter": [ { + "reference": "urn:uuid:92352c70-ea81-b0b5-a1ce-c211d3d4bce1" + } ] + } ], + "total": { + "value": 256.45, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, { + "fullUrl": "urn:uuid:b06a366d-79f3-081c-7bc0-a03ae9242403", + "resource": { + "resourceType": "DiagnosticReport", + "id": "b06a366d-79f3-081c-7bc0-a03ae9242403", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-note" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:92352c70-ea81-b0b5-a1ce-c211d3d4bce1" + }, + "effectiveDateTime": "2006-11-28T11:44:52-05:00", + "issued": "2006-11-28T11:44:52.558-05:00", + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999962229", + "display": "Dr. Alphonso102 Nienow652" + } ], + "presentedForm": [ { + "contentType": "text/plain; charset=utf-8", + "data": "CjIwMDYtMTEtMjgKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgNTYgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuCgojIFNvY2lhbCBIaXN0b3J5ClBhdGllbnQgaXMgbWFycmllZC4gUGF0aWVudCBpcyBhbiBhY3RpdmUgc21va2VyIGFuZCBpcyBhbiBhbGNvaG9saWMuCiBQYXRpZW50IGlkZW50aWZpZXMgYXMgaGV0ZXJvc2V4dWFsLgoKUGF0aWVudCBjb21lcyBmcm9tIGEgbWlkZGxlIHNvY2lvZWNvbm9taWMgYmFja2dyb3VuZC4KIFBhdGllbnQgaGFzIGNvbXBsZXRlZCBzb21lIGNvbGxlZ2UgY291cnNlcy4KUGF0aWVudCBjdXJyZW50bHkgaGFzIEh1bWFuYS4KCiMgQWxsZXJnaWVzCk5vIEtub3duIEFsbGVyZ2llcy4KCiMgTWVkaWNhdGlvbnMKTm8gQWN0aXZlIE1lZGljYXRpb25zLgoKIyBBc3Nlc3NtZW50IGFuZCBQbGFuClBhdGllbnQgaXMgcHJlc2VudGluZyB3aXRoIGlzY2hlbWljIGhlYXJ0IGRpc2Vhc2UgKGRpc29yZGVyKS4gCgojIyBQbGFuCgpUaGUgcGF0aWVudCB3YXMgcHJlc2NyaWJlZCB0aGUgZm9sbG93aW5nIG1lZGljYXRpb25zOgotIGNsb3BpZG9ncmVsIDc1IG1nIG9yYWwgdGFibGV0Ci0gc2ltdmFzdGF0aW4gMjAgbWcgb3JhbCB0YWJsZXQKLSAyNCBociBtZXRvcHJvbG9sIHN1Y2NpbmF0ZSAxMDAgbWcgZXh0ZW5kZWQgcmVsZWFzZSBvcmFsIHRhYmxldAotIG5pdHJvZ2x5Y2VyaW4gMC40IG1nL2FjdHVhdCBtdWNvc2FsIHNwcmF5Cg==" + } ] + }, + "request": { + "method": "POST", + "url": "DiagnosticReport" + } + }, { + "fullUrl": "urn:uuid:29ce0052-49fd-ed5c-8f4c-e4b1872661d9", + "resource": { + "resourceType": "DocumentReference", + "id": "29ce0052-49fd-ed5c-8f4c-e4b1872661d9", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-documentreference" ] + }, + "identifier": [ { + "system": "urn:ietf:rfc:3986", + "value": "urn:uuid:b06a366d-79f3-081c-7bc0-a03ae9242403" + } ], + "status": "superseded", + "type": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "category": [ { + "coding": [ { + "system": "http://hl7.org/fhir/us/core/CodeSystem/us-core-documentreference-category", + "code": "clinical-note", + "display": "Clinical Note" + } ] + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "date": "2006-11-28T11:44:52.558-05:00", + "author": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999962229", + "display": "Dr. Alphonso102 Nienow652" + } ], + "custodian": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|dd406540-fa97-3a90-858e-0a0ea61cf07b", + "display": "PCP74147" + }, + "content": [ { + "attachment": { + "contentType": "text/plain; charset=utf-8", + "data": "CjIwMDYtMTEtMjgKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgNTYgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuCgojIFNvY2lhbCBIaXN0b3J5ClBhdGllbnQgaXMgbWFycmllZC4gUGF0aWVudCBpcyBhbiBhY3RpdmUgc21va2VyIGFuZCBpcyBhbiBhbGNvaG9saWMuCiBQYXRpZW50IGlkZW50aWZpZXMgYXMgaGV0ZXJvc2V4dWFsLgoKUGF0aWVudCBjb21lcyBmcm9tIGEgbWlkZGxlIHNvY2lvZWNvbm9taWMgYmFja2dyb3VuZC4KIFBhdGllbnQgaGFzIGNvbXBsZXRlZCBzb21lIGNvbGxlZ2UgY291cnNlcy4KUGF0aWVudCBjdXJyZW50bHkgaGFzIEh1bWFuYS4KCiMgQWxsZXJnaWVzCk5vIEtub3duIEFsbGVyZ2llcy4KCiMgTWVkaWNhdGlvbnMKTm8gQWN0aXZlIE1lZGljYXRpb25zLgoKIyBBc3Nlc3NtZW50IGFuZCBQbGFuClBhdGllbnQgaXMgcHJlc2VudGluZyB3aXRoIGlzY2hlbWljIGhlYXJ0IGRpc2Vhc2UgKGRpc29yZGVyKS4gCgojIyBQbGFuCgpUaGUgcGF0aWVudCB3YXMgcHJlc2NyaWJlZCB0aGUgZm9sbG93aW5nIG1lZGljYXRpb25zOgotIGNsb3BpZG9ncmVsIDc1IG1nIG9yYWwgdGFibGV0Ci0gc2ltdmFzdGF0aW4gMjAgbWcgb3JhbCB0YWJsZXQKLSAyNCBociBtZXRvcHJvbG9sIHN1Y2NpbmF0ZSAxMDAgbWcgZXh0ZW5kZWQgcmVsZWFzZSBvcmFsIHRhYmxldAotIG5pdHJvZ2x5Y2VyaW4gMC40IG1nL2FjdHVhdCBtdWNvc2FsIHNwcmF5Cg==" + }, + "format": { + "system": "http://ihe.net/fhir/ValueSet/IHE.FormatCode.codesystem", + "code": "urn:ihe:iti:xds:2017:mimeTypeSufficient", + "display": "mimeType Sufficient" + } + } ], + "context": { + "encounter": [ { + "reference": "urn:uuid:92352c70-ea81-b0b5-a1ce-c211d3d4bce1" + } ], + "period": { + "start": "2006-11-28T11:44:52-05:00", + "end": "2006-11-28T11:59:52-05:00" + } + } + }, + "request": { + "method": "POST", + "url": "DocumentReference" + } + }, { + "fullUrl": "urn:uuid:b4384cc9-11a8-6db9-7c9f-6bb749e7f144", + "resource": { + "resourceType": "Claim", + "id": "b4384cc9-11a8-6db9-7c9f-6bb749e7f144", + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Lindsay928 Gerlach374" + }, + "billablePeriod": { + "start": "2006-11-28T11:44:52-05:00", + "end": "2006-11-28T11:59:52-05:00" + }, + "created": "2006-11-28T11:59:52-05:00", + "provider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|dd406540-fa97-3a90-858e-0a0ea61cf07b", + "display": "PCP74147" + }, + "priority": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } ] + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|cb6521ac-69d9-3b02-b34a-15e5d2ed50ea", + "display": "PCP74147" + }, + "diagnosis": [ { + "sequence": 1, + "diagnosisReference": { + "reference": "urn:uuid:6a9a7725-785c-8b05-ec27-623301191651" + } + } ], + "insurance": [ { + "sequence": 1, + "focal": true, + "coverage": { + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "162673000", + "display": "General examination of patient (procedure)" + } ], + "text": "General examination of patient (procedure)" + }, + "encounter": [ { + "reference": "urn:uuid:92352c70-ea81-b0b5-a1ce-c211d3d4bce1" + } ] + }, { + "sequence": 2, + "diagnosisSequence": [ 1 ], + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "414545008", + "display": "Ischemic heart disease (disorder)" + } ], + "text": "Ischemic heart disease (disorder)" + } + } ], + "total": { + "value": 129.16, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, { + "fullUrl": "urn:uuid:bea32922-d48a-9643-58e4-4be99e4a5333", + "resource": { + "resourceType": "ExplanationOfBenefit", + "id": "bea32922-d48a-9643-58e4-4be99e4a5333", + "contained": [ { + "resourceType": "ServiceRequest", + "id": "referral", + "status": "completed", + "intent": "order", + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "requester": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999962229" + }, + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999962229" + } ] + }, { + "resourceType": "Coverage", + "id": "coverage", + "status": "active", + "type": { + "text": "Humana" + }, + "beneficiary": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "payor": [ { + "display": "Humana" + } ] + } ], + "identifier": [ { + "system": "https://bluebutton.cms.gov/resources/variables/clm_id", + "value": "b4384cc9-11a8-6db9-7c9f-6bb749e7f144" + }, { + "system": "https://bluebutton.cms.gov/resources/identifier/claim-group", + "value": "99999999999" + } ], + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "billablePeriod": { + "start": "2006-11-28T11:59:52-05:00", + "end": "2007-11-28T11:59:52-05:00" + }, + "created": "2006-11-28T11:59:52-05:00", + "insurer": { + "display": "Humana" + }, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999962229" + }, + "referral": { + "reference": "#referral" + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|cb6521ac-69d9-3b02-b34a-15e5d2ed50ea", + "display": "PCP74147" + }, + "claim": { + "reference": "urn:uuid:b4384cc9-11a8-6db9-7c9f-6bb749e7f144" + }, + "outcome": "complete", + "careTeam": [ { + "sequence": 1, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999962229" + }, + "role": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", + "code": "primary", + "display": "Primary Care Practitioner" + } ] + } + } ], + "diagnosis": [ { + "sequence": 1, + "diagnosisReference": { + "reference": "urn:uuid:6a9a7725-785c-8b05-ec27-623301191651" + }, + "type": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-diagnosistype", + "code": "principal" + } ] + } ] + } ], + "insurance": [ { + "focal": true, + "coverage": { + "reference": "#coverage", + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } ] + }, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "162673000", + "display": "General examination of patient (procedure)" + } ], + "text": "General examination of patient (procedure)" + }, + "servicedPeriod": { + "start": "2006-11-28T11:44:52-05:00", + "end": "2006-11-28T11:59:52-05:00" + }, + "locationCodeableConcept": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "19", + "display": "Off Campus-Outpatient Hospital" + } ] + }, + "encounter": [ { + "reference": "urn:uuid:92352c70-ea81-b0b5-a1ce-c211d3d4bce1" + } ] + }, { + "sequence": 2, + "diagnosisSequence": [ 1 ], + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } ] + }, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "414545008", + "display": "Ischemic heart disease (disorder)" + } ], + "text": "Ischemic heart disease (disorder)" + }, + "servicedPeriod": { + "start": "2006-11-28T11:44:52-05:00", + "end": "2006-11-28T11:59:52-05:00" + }, + "locationCodeableConcept": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "19", + "display": "Off Campus-Outpatient Hospital" + } ] + } + } ], + "total": [ { + "category": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/adjudication", + "code": "submitted", + "display": "Submitted Amount" + } ], + "text": "Submitted Amount" + }, + "amount": { + "value": 129.16, + "currency": "USD" + } + } ], + "payment": { + "amount": { + "value": 0.0, + "currency": "USD" + } + } + }, + "request": { + "method": "POST", + "url": "ExplanationOfBenefit" + } + }, { + "fullUrl": "urn:uuid:51a99f1e-54c9-160e-0023-693a55c9a6d2", + "resource": { + "resourceType": "Encounter", + "id": "51a99f1e-54c9-160e-0023-693a55c9a6d2", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter", "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter" ] + }, + "identifier": [ { + "use": "official", + "system": "https://github.com/synthetichealth/synthea", + "value": "51a99f1e-54c9-160e-0023-693a55c9a6d2" + } ], + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB" + }, + "type": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "185347001", + "display": "Encounter for problem (procedure)" + } ], + "text": "Encounter for problem (procedure)" + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Mr. Lindsay928 Gerlach374" + }, + "participant": [ { + "type": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType", + "code": "PPRF", + "display": "primary performer" + } ], + "text": "primary performer" + } ], + "period": { + "start": "2006-12-10T21:36:43-05:00", + "end": "2006-12-11T03:44:02-05:00" + }, + "individual": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } + } ], + "period": { + "start": "2006-12-10T21:36:43-05:00", + "end": "2006-12-11T03:44:02-05:00" + }, + "reasonCode": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "414545008", + "display": "Ischemic heart disease (disorder)" + } ] + } ], + "location": [ { + "location": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + } ], + "serviceProvider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + }, + "request": { + "method": "POST", + "url": "Encounter" + } + }, { + "fullUrl": "urn:uuid:52cb0676-be79-f238-f48c-b29b3352a731", + "resource": { + "resourceType": "Condition", + "id": "52cb0676-be79-f238-f48c-b29b3352a731", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-condition" ] + }, + "clinicalStatus": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/condition-clinical", + "code": "active" + } ] + }, + "verificationStatus": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status", + "code": "confirmed" + } ] + }, + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/condition-category", + "code": "encounter-diagnosis", + "display": "Encounter Diagnosis" + } ] + } ], + "code": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "274531002", + "display": "Abnormal findings diagnostic imaging heart+coronary circulat (finding)" + } ], + "text": "Abnormal findings diagnostic imaging heart+coronary circulat (finding)" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:51a99f1e-54c9-160e-0023-693a55c9a6d2" + }, + "onsetDateTime": "2006-12-10T23:31:47-05:00", + "recordedDate": "2006-12-10T23:31:47-05:00" + }, + "request": { + "method": "POST", + "url": "Condition" + } + }, { + "fullUrl": "urn:uuid:c8995bc3-34d1-f629-c45e-06f582c85f23", + "resource": { + "resourceType": "DiagnosticReport", + "id": "c8995bc3-34d1-f629-c45e-06f582c85f23", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-note" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:51a99f1e-54c9-160e-0023-693a55c9a6d2" + }, + "effectiveDateTime": "2006-12-10T21:36:43-05:00", + "issued": "2006-12-10T21:36:43.558-05:00", + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } ], + "presentedForm": [ { + "contentType": "text/plain; charset=utf-8", + "data": "CjIwMDYtMTItMTAKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgNTYgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuCgojIFNvY2lhbCBIaXN0b3J5ClBhdGllbnQgaXMgbWFycmllZC4gUGF0aWVudCBpcyBhbiBhY3RpdmUgc21va2VyIGFuZCBpcyBhbiBhbGNvaG9saWMuCiBQYXRpZW50IGlkZW50aWZpZXMgYXMgaGV0ZXJvc2V4dWFsLgoKUGF0aWVudCBjb21lcyBmcm9tIGEgbWlkZGxlIHNvY2lvZWNvbm9taWMgYmFja2dyb3VuZC4KIFBhdGllbnQgaGFzIGNvbXBsZXRlZCBzb21lIGNvbGxlZ2UgY291cnNlcy4KUGF0aWVudCBjdXJyZW50bHkgaGFzIEh1bWFuYS4KCiMgQWxsZXJnaWVzCk5vIEtub3duIEFsbGVyZ2llcy4KCiMgTWVkaWNhdGlvbnMKTm8gQWN0aXZlIE1lZGljYXRpb25zLgoKIyBBc3Nlc3NtZW50IGFuZCBQbGFuClBhdGllbnQgaXMgcHJlc2VudGluZyB3aXRoIGFibm9ybWFsIGZpbmRpbmdzIGRpYWdub3N0aWMgaW1hZ2luZyBoZWFydCtjb3JvbmFyeSBjaXJjdWxhdCAoZmluZGluZykuIAoKIyMgUGxhbgoK" + } ] + }, + "request": { + "method": "POST", + "url": "DiagnosticReport" + } + }, { + "fullUrl": "urn:uuid:0c75b07e-f682-641c-e40d-f560add6b768", + "resource": { + "resourceType": "DocumentReference", + "id": "0c75b07e-f682-641c-e40d-f560add6b768", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-documentreference" ] + }, + "identifier": [ { + "system": "urn:ietf:rfc:3986", + "value": "urn:uuid:c8995bc3-34d1-f629-c45e-06f582c85f23" + } ], + "status": "superseded", + "type": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "category": [ { + "coding": [ { + "system": "http://hl7.org/fhir/us/core/CodeSystem/us-core-documentreference-category", + "code": "clinical-note", + "display": "Clinical Note" + } ] + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "date": "2006-12-10T21:36:43.558-05:00", + "author": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } ], + "custodian": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "content": [ { + "attachment": { + "contentType": "text/plain; charset=utf-8", + "data": "CjIwMDYtMTItMTAKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgNTYgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuCgojIFNvY2lhbCBIaXN0b3J5ClBhdGllbnQgaXMgbWFycmllZC4gUGF0aWVudCBpcyBhbiBhY3RpdmUgc21va2VyIGFuZCBpcyBhbiBhbGNvaG9saWMuCiBQYXRpZW50IGlkZW50aWZpZXMgYXMgaGV0ZXJvc2V4dWFsLgoKUGF0aWVudCBjb21lcyBmcm9tIGEgbWlkZGxlIHNvY2lvZWNvbm9taWMgYmFja2dyb3VuZC4KIFBhdGllbnQgaGFzIGNvbXBsZXRlZCBzb21lIGNvbGxlZ2UgY291cnNlcy4KUGF0aWVudCBjdXJyZW50bHkgaGFzIEh1bWFuYS4KCiMgQWxsZXJnaWVzCk5vIEtub3duIEFsbGVyZ2llcy4KCiMgTWVkaWNhdGlvbnMKTm8gQWN0aXZlIE1lZGljYXRpb25zLgoKIyBBc3Nlc3NtZW50IGFuZCBQbGFuClBhdGllbnQgaXMgcHJlc2VudGluZyB3aXRoIGFibm9ybWFsIGZpbmRpbmdzIGRpYWdub3N0aWMgaW1hZ2luZyBoZWFydCtjb3JvbmFyeSBjaXJjdWxhdCAoZmluZGluZykuIAoKIyMgUGxhbgoK" + }, + "format": { + "system": "http://ihe.net/fhir/ValueSet/IHE.FormatCode.codesystem", + "code": "urn:ihe:iti:xds:2017:mimeTypeSufficient", + "display": "mimeType Sufficient" + } + } ], + "context": { + "encounter": [ { + "reference": "urn:uuid:51a99f1e-54c9-160e-0023-693a55c9a6d2" + } ], + "period": { + "start": "2006-12-10T21:36:43-05:00", + "end": "2006-12-11T03:44:02-05:00" + } + } + }, + "request": { + "method": "POST", + "url": "DocumentReference" + } + }, { + "fullUrl": "urn:uuid:951b0865-3f22-a9df-3d65-cc906add430e", + "resource": { + "resourceType": "Claim", + "id": "951b0865-3f22-a9df-3d65-cc906add430e", + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Lindsay928 Gerlach374" + }, + "billablePeriod": { + "start": "2006-12-10T21:36:43-05:00", + "end": "2006-12-11T03:44:02-05:00" + }, + "created": "2006-12-11T03:44:02-05:00", + "provider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "priority": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } ] + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "diagnosis": [ { + "sequence": 1, + "diagnosisReference": { + "reference": "urn:uuid:52cb0676-be79-f238-f48c-b29b3352a731" + } + } ], + "insurance": [ { + "sequence": 1, + "focal": true, + "coverage": { + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "185347001", + "display": "Encounter for problem (procedure)" + } ], + "text": "Encounter for problem (procedure)" + }, + "encounter": [ { + "reference": "urn:uuid:51a99f1e-54c9-160e-0023-693a55c9a6d2" + } ] + }, { + "sequence": 2, + "diagnosisSequence": [ 1 ], + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "274531002", + "display": "Abnormal findings diagnostic imaging heart+coronary circulat (finding)" + } ], + "text": "Abnormal findings diagnostic imaging heart+coronary circulat (finding)" + } + } ], + "total": { + "value": 77.49, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, { + "fullUrl": "urn:uuid:08693800-a6fa-1dd6-efe8-ad89998fee13", + "resource": { + "resourceType": "ExplanationOfBenefit", + "id": "08693800-a6fa-1dd6-efe8-ad89998fee13", + "contained": [ { + "resourceType": "ServiceRequest", + "id": "referral", + "status": "completed", + "intent": "order", + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "requester": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + } ] + }, { + "resourceType": "Coverage", + "id": "coverage", + "status": "active", + "type": { + "text": "Humana" + }, + "beneficiary": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "payor": [ { + "display": "Humana" + } ] + } ], + "identifier": [ { + "system": "https://bluebutton.cms.gov/resources/variables/clm_id", + "value": "951b0865-3f22-a9df-3d65-cc906add430e" + }, { + "system": "https://bluebutton.cms.gov/resources/identifier/claim-group", + "value": "99999999999" + } ], + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "billablePeriod": { + "start": "2006-12-11T03:44:02-05:00", + "end": "2007-12-11T03:44:02-05:00" + }, + "created": "2006-12-11T03:44:02-05:00", + "insurer": { + "display": "Humana" + }, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "referral": { + "reference": "#referral" + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "claim": { + "reference": "urn:uuid:951b0865-3f22-a9df-3d65-cc906add430e" + }, + "outcome": "complete", + "careTeam": [ { + "sequence": 1, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "role": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", + "code": "primary", + "display": "Primary Care Practitioner" + } ] + } + } ], + "diagnosis": [ { + "sequence": 1, + "diagnosisReference": { + "reference": "urn:uuid:52cb0676-be79-f238-f48c-b29b3352a731" + }, + "type": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-diagnosistype", + "code": "principal" + } ] + } ] + } ], + "insurance": [ { + "focal": true, + "coverage": { + "reference": "#coverage", + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } ] + }, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "185347001", + "display": "Encounter for problem (procedure)" + } ], + "text": "Encounter for problem (procedure)" + }, + "servicedPeriod": { + "start": "2006-12-10T21:36:43-05:00", + "end": "2006-12-11T03:44:02-05:00" + }, + "locationCodeableConcept": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "21", + "display": "Inpatient Hospital" + } ] + }, + "encounter": [ { + "reference": "urn:uuid:51a99f1e-54c9-160e-0023-693a55c9a6d2" + } ] + }, { + "sequence": 2, + "diagnosisSequence": [ 1 ], + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } ] + }, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "274531002", + "display": "Abnormal findings diagnostic imaging heart+coronary circulat (finding)" + } ], + "text": "Abnormal findings diagnostic imaging heart+coronary circulat (finding)" + }, + "servicedPeriod": { + "start": "2006-12-10T21:36:43-05:00", + "end": "2006-12-11T03:44:02-05:00" + }, + "locationCodeableConcept": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "21", + "display": "Inpatient Hospital" + } ] + } + } ], + "total": [ { + "category": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/adjudication", + "code": "submitted", + "display": "Submitted Amount" + } ], + "text": "Submitted Amount" + }, + "amount": { + "value": 77.49, + "currency": "USD" + } + } ], + "payment": { + "amount": { + "value": 0.0, + "currency": "USD" + } + } + }, + "request": { + "method": "POST", + "url": "ExplanationOfBenefit" + } + }, { + "fullUrl": "urn:uuid:bfe69881-b53a-0845-3a8c-959ecaa1724f", + "resource": { + "resourceType": "Encounter", + "id": "bfe69881-b53a-0845-3a8c-959ecaa1724f", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter", "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter" ] + }, + "identifier": [ { + "use": "official", + "system": "https://github.com/synthetichealth/synthea", + "value": "bfe69881-b53a-0845-3a8c-959ecaa1724f" + } ], + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "IMP" + }, + "type": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "112802009", + "display": "Cardiovascular operative procedure (procedure)" + } ], + "text": "Cardiovascular operative procedure (procedure)" + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Mr. Lindsay928 Gerlach374" + }, + "participant": [ { + "type": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType", + "code": "PPRF", + "display": "primary performer" + } ], + "text": "primary performer" + } ], + "period": { + "start": "2006-12-18T03:59:59-05:00", + "end": "2006-12-19T03:59:59-05:00" + }, + "individual": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } + } ], + "period": { + "start": "2006-12-18T03:59:59-05:00", + "end": "2006-12-19T03:59:59-05:00" + }, + "reasonCode": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "274531002", + "display": "Abnormal findings diagnostic imaging heart+coronary circulat (finding)" + } ] + } ], + "location": [ { + "location": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + } ], + "serviceProvider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + }, + "request": { + "method": "POST", + "url": "Encounter" + } + }, { + "fullUrl": "urn:uuid:2b88a4d5-52f8-7ccd-cda5-939796a5b690", + "resource": { + "resourceType": "Condition", + "id": "2b88a4d5-52f8-7ccd-cda5-939796a5b690", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-condition" ] + }, + "clinicalStatus": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/condition-clinical", + "code": "active" + } ] + }, + "verificationStatus": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status", + "code": "confirmed" + } ] + }, + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/condition-category", + "code": "encounter-diagnosis", + "display": "Encounter Diagnosis" + } ] + } ], + "code": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "399261000", + "display": "History of coronary artery bypass grafting (situation)" + } ], + "text": "History of coronary artery bypass grafting (situation)" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:bfe69881-b53a-0845-3a8c-959ecaa1724f" + }, + "onsetDateTime": "2006-12-18T08:19:09-05:00", + "recordedDate": "2006-12-18T08:19:09-05:00" + }, + "request": { + "method": "POST", + "url": "Condition" + } + }, { + "fullUrl": "urn:uuid:1ec0d3ef-4340-c837-d532-9c307a987c06", + "resource": { + "resourceType": "SupplyDelivery", + "id": "1ec0d3ef-4340-c837-d532-9c307a987c06", + "status": "completed", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/supply-item-type", + "code": "device", + "display": "Device" + } ] + }, + "suppliedItem": { + "quantity": { + "value": 1 + }, + "itemCodeableConcept": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "431069006", + "display": "Packed red blood cells (product)" + } ], + "text": "Packed red blood cells (product)" + } + }, + "occurrenceDateTime": "2006-12-18T03:59:59-05:00" + }, + "request": { + "method": "POST", + "url": "SupplyDelivery" + } + }, { + "fullUrl": "urn:uuid:45cc446a-2e96-7670-9abe-b1c2c056fde1", + "resource": { + "resourceType": "Medication", + "id": "45cc446a-2e96-7670-9abe-b1c2c056fde1", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-medication" ] + }, + "code": { + "coding": [ { + "system": "http://www.nlm.nih.gov/research/umls/rxnorm", + "code": "1665060", + "display": "cefazolin 2000 MG Injection" + } ], + "text": "cefazolin 2000 MG Injection" + }, + "status": "active" + }, + "request": { + "method": "POST", + "url": "Medication" + } + }, { + "fullUrl": "urn:uuid:ca1a0d52-ea94-34d4-5200-5344bd216738", + "resource": { + "resourceType": "MedicationRequest", + "id": "ca1a0d52-ea94-34d4-5200-5344bd216738", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-medicationrequest" ] + }, + "status": "active", + "intent": "order", + "medicationReference": { + "reference": "urn:uuid:45cc446a-2e96-7670-9abe-b1c2c056fde1" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:bfe69881-b53a-0845-3a8c-959ecaa1724f" + }, + "authoredOn": "2006-12-18T03:59:59-05:00", + "requester": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } + }, + "request": { + "method": "POST", + "url": "MedicationRequest" + } + }, { + "fullUrl": "urn:uuid:a5854840-b120-14ae-578c-66744223432c", + "resource": { + "resourceType": "Claim", + "id": "a5854840-b120-14ae-578c-66744223432c", + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "pharmacy" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "billablePeriod": { + "start": "2006-12-18T03:59:59-05:00", + "end": "2006-12-19T03:59:59-05:00" + }, + "created": "2006-12-19T03:59:59-05:00", + "provider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "priority": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } ] + }, + "prescription": { + "reference": "urn:uuid:ca1a0d52-ea94-34d4-5200-5344bd216738" + }, + "insurance": [ { + "sequence": 1, + "focal": true, + "coverage": { + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "112802009", + "display": "Cardiovascular operative procedure (procedure)" + } ], + "text": "Cardiovascular operative procedure (procedure)" + }, + "encounter": [ { + "reference": "urn:uuid:bfe69881-b53a-0845-3a8c-959ecaa1724f" + } ] + } ], + "total": { + "value": 263.49, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, { + "fullUrl": "urn:uuid:ba5d28a9-fa42-f1ff-2c91-1150b9504b4d", + "resource": { + "resourceType": "MedicationAdministration", + "id": "ba5d28a9-fa42-f1ff-2c91-1150b9504b4d", + "status": "completed", + "medicationCodeableConcept": { + "coding": [ { + "system": "http://www.nlm.nih.gov/research/umls/rxnorm", + "code": "1665060", + "display": "cefazolin 2000 MG Injection" + } ], + "text": "cefazolin 2000 MG Injection" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "context": { + "reference": "urn:uuid:bfe69881-b53a-0845-3a8c-959ecaa1724f" + }, + "effectiveDateTime": "2006-12-18T03:59:59-05:00" + }, + "request": { + "method": "POST", + "url": "MedicationAdministration" + } + }, { + "fullUrl": "urn:uuid:7b06b470-a849-027e-d0e0-36cbf5d5383c", + "resource": { + "resourceType": "Medication", + "id": "7b06b470-a849-027e-d0e0-36cbf5d5383c", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-medication" ] + }, + "code": { + "coding": [ { + "system": "http://www.nlm.nih.gov/research/umls/rxnorm", + "code": "1659263", + "display": "1 ML heparin sodium, porcine 5000 UNT/ML Injection" + } ], + "text": "1 ML heparin sodium, porcine 5000 UNT/ML Injection" + }, + "status": "active" + }, + "request": { + "method": "POST", + "url": "Medication" + } + }, { + "fullUrl": "urn:uuid:94a8f1c2-7bad-d0e0-bcd8-8abd01327890", + "resource": { + "resourceType": "MedicationRequest", + "id": "94a8f1c2-7bad-d0e0-bcd8-8abd01327890", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-medicationrequest" ] + }, + "status": "active", + "intent": "order", + "medicationReference": { + "reference": "urn:uuid:7b06b470-a849-027e-d0e0-36cbf5d5383c" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:bfe69881-b53a-0845-3a8c-959ecaa1724f" + }, + "authoredOn": "2006-12-18T03:59:59-05:00", + "requester": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } + }, + "request": { + "method": "POST", + "url": "MedicationRequest" + } + }, { + "fullUrl": "urn:uuid:d237711b-0f10-f1fd-2bed-c2c14dbeb461", + "resource": { + "resourceType": "Claim", + "id": "d237711b-0f10-f1fd-2bed-c2c14dbeb461", + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "pharmacy" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "billablePeriod": { + "start": "2006-12-18T03:59:59-05:00", + "end": "2006-12-19T03:59:59-05:00" + }, + "created": "2006-12-19T03:59:59-05:00", + "provider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "priority": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } ] + }, + "prescription": { + "reference": "urn:uuid:94a8f1c2-7bad-d0e0-bcd8-8abd01327890" + }, + "insurance": [ { + "sequence": 1, + "focal": true, + "coverage": { + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "112802009", + "display": "Cardiovascular operative procedure (procedure)" + } ], + "text": "Cardiovascular operative procedure (procedure)" + }, + "encounter": [ { + "reference": "urn:uuid:bfe69881-b53a-0845-3a8c-959ecaa1724f" + } ] + } ], + "total": { + "value": 1.97, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, { + "fullUrl": "urn:uuid:c4cd1c66-903f-30b3-1782-ba12686e58bb", + "resource": { + "resourceType": "MedicationAdministration", + "id": "c4cd1c66-903f-30b3-1782-ba12686e58bb", + "status": "completed", + "medicationCodeableConcept": { + "coding": [ { + "system": "http://www.nlm.nih.gov/research/umls/rxnorm", + "code": "1659263", + "display": "1 ML heparin sodium, porcine 5000 UNT/ML Injection" + } ], + "text": "1 ML heparin sodium, porcine 5000 UNT/ML Injection" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "context": { + "reference": "urn:uuid:bfe69881-b53a-0845-3a8c-959ecaa1724f" + }, + "effectiveDateTime": "2006-12-18T03:59:59-05:00" + }, + "request": { + "method": "POST", + "url": "MedicationAdministration" + } + }, { + "fullUrl": "urn:uuid:0daf9f69-0b47-a903-20a9-7a9d456785b2", + "resource": { + "resourceType": "Medication", + "id": "0daf9f69-0b47-a903-20a9-7a9d456785b2", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-medication" ] + }, + "code": { + "coding": [ { + "system": "http://www.nlm.nih.gov/research/umls/rxnorm", + "code": "1796676", + "display": "25 ML protamine sulfate (USP) 10 MG/ML Injection" + } ], + "text": "25 ML protamine sulfate (USP) 10 MG/ML Injection" + }, + "status": "active" + }, + "request": { + "method": "POST", + "url": "Medication" + } + }, { + "fullUrl": "urn:uuid:bc20e61d-c4f6-ef48-ab6f-3b12bc040ca5", + "resource": { + "resourceType": "MedicationRequest", + "id": "bc20e61d-c4f6-ef48-ab6f-3b12bc040ca5", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-medicationrequest" ] + }, + "status": "active", + "intent": "order", + "medicationReference": { + "reference": "urn:uuid:0daf9f69-0b47-a903-20a9-7a9d456785b2" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:bfe69881-b53a-0845-3a8c-959ecaa1724f" + }, + "authoredOn": "2006-12-18T03:59:59-05:00", + "requester": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } + }, + "request": { + "method": "POST", + "url": "MedicationRequest" + } + }, { + "fullUrl": "urn:uuid:e226c9f0-5733-0a04-56bb-c3a20e5b38c6", + "resource": { + "resourceType": "Claim", + "id": "e226c9f0-5733-0a04-56bb-c3a20e5b38c6", + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "pharmacy" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "billablePeriod": { + "start": "2006-12-18T03:59:59-05:00", + "end": "2006-12-19T03:59:59-05:00" + }, + "created": "2006-12-19T03:59:59-05:00", + "provider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "priority": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } ] + }, + "prescription": { + "reference": "urn:uuid:bc20e61d-c4f6-ef48-ab6f-3b12bc040ca5" + }, + "insurance": [ { + "sequence": 1, + "focal": true, + "coverage": { + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "112802009", + "display": "Cardiovascular operative procedure (procedure)" + } ], + "text": "Cardiovascular operative procedure (procedure)" + }, + "encounter": [ { + "reference": "urn:uuid:bfe69881-b53a-0845-3a8c-959ecaa1724f" + } ] + } ], + "total": { + "value": 263.49, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, { + "fullUrl": "urn:uuid:df13b527-76f3-4249-c03f-008a3f8a301e", + "resource": { + "resourceType": "MedicationAdministration", + "id": "df13b527-76f3-4249-c03f-008a3f8a301e", + "status": "completed", + "medicationCodeableConcept": { + "coding": [ { + "system": "http://www.nlm.nih.gov/research/umls/rxnorm", + "code": "1796676", + "display": "25 ML protamine sulfate (USP) 10 MG/ML Injection" + } ], + "text": "25 ML protamine sulfate (USP) 10 MG/ML Injection" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "context": { + "reference": "urn:uuid:bfe69881-b53a-0845-3a8c-959ecaa1724f" + }, + "effectiveDateTime": "2006-12-18T03:59:59-05:00" + }, + "request": { + "method": "POST", + "url": "MedicationAdministration" + } + }, { + "fullUrl": "urn:uuid:0b31899f-5d3a-1659-ae0c-a9f03332e0d4", + "resource": { + "resourceType": "Medication", + "id": "0b31899f-5d3a-1659-ae0c-a9f03332e0d4", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-medication" ] + }, + "code": { + "coding": [ { + "system": "http://www.nlm.nih.gov/research/umls/rxnorm", + "code": "242969", + "display": "4 ML norepinephrine 1 MG/ML Injection" + } ], + "text": "4 ML norepinephrine 1 MG/ML Injection" + }, + "status": "active" + }, + "request": { + "method": "POST", + "url": "Medication" + } + }, { + "fullUrl": "urn:uuid:dca7bebb-70e9-3290-f9aa-14f242a5fead", + "resource": { + "resourceType": "MedicationRequest", + "id": "dca7bebb-70e9-3290-f9aa-14f242a5fead", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-medicationrequest" ] + }, + "status": "active", + "intent": "order", + "medicationReference": { + "reference": "urn:uuid:0b31899f-5d3a-1659-ae0c-a9f03332e0d4" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:bfe69881-b53a-0845-3a8c-959ecaa1724f" + }, + "authoredOn": "2006-12-18T07:48:20-05:00", + "requester": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } + }, + "request": { + "method": "POST", + "url": "MedicationRequest" + } + }, { + "fullUrl": "urn:uuid:87ff81fa-a870-d4d6-7fc3-2a8644603c60", + "resource": { + "resourceType": "Claim", + "id": "87ff81fa-a870-d4d6-7fc3-2a8644603c60", + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "pharmacy" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "billablePeriod": { + "start": "2006-12-18T03:59:59-05:00", + "end": "2006-12-19T03:59:59-05:00" + }, + "created": "2006-12-19T03:59:59-05:00", + "provider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "priority": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } ] + }, + "prescription": { + "reference": "urn:uuid:dca7bebb-70e9-3290-f9aa-14f242a5fead" + }, + "insurance": [ { + "sequence": 1, + "focal": true, + "coverage": { + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "112802009", + "display": "Cardiovascular operative procedure (procedure)" + } ], + "text": "Cardiovascular operative procedure (procedure)" + }, + "encounter": [ { + "reference": "urn:uuid:bfe69881-b53a-0845-3a8c-959ecaa1724f" + } ] + } ], + "total": { + "value": 3.14, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, { + "fullUrl": "urn:uuid:cedf7c57-6f4f-efe1-8812-1eb3a9aa109f", + "resource": { + "resourceType": "MedicationAdministration", + "id": "cedf7c57-6f4f-efe1-8812-1eb3a9aa109f", + "status": "completed", + "medicationCodeableConcept": { + "coding": [ { + "system": "http://www.nlm.nih.gov/research/umls/rxnorm", + "code": "242969", + "display": "4 ML norepinephrine 1 MG/ML Injection" + } ], + "text": "4 ML norepinephrine 1 MG/ML Injection" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "context": { + "reference": "urn:uuid:bfe69881-b53a-0845-3a8c-959ecaa1724f" + }, + "effectiveDateTime": "2006-12-18T07:48:20-05:00" + }, + "request": { + "method": "POST", + "url": "MedicationAdministration" + } + }, { + "fullUrl": "urn:uuid:28ec1f09-7213-e40d-d608-6d29a31fd7da", + "resource": { + "resourceType": "DiagnosticReport", + "id": "28ec1f09-7213-e40d-d608-6d29a31fd7da", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-note" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:bfe69881-b53a-0845-3a8c-959ecaa1724f" + }, + "effectiveDateTime": "2006-12-18T03:59:59-05:00", + "issued": "2006-12-18T03:59:59.558-05:00", + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } ], + "presentedForm": [ { + "contentType": "text/plain; charset=utf-8", + "data": "CjIwMDYtMTItMTgKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgNTYgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuCgojIFNvY2lhbCBIaXN0b3J5ClBhdGllbnQgaXMgbWFycmllZC4gUGF0aWVudCBpcyBhbiBhY3RpdmUgc21va2VyIGFuZCBpcyBhbiBhbGNvaG9saWMuCiBQYXRpZW50IGlkZW50aWZpZXMgYXMgaGV0ZXJvc2V4dWFsLgoKUGF0aWVudCBjb21lcyBmcm9tIGEgbWlkZGxlIHNvY2lvZWNvbm9taWMgYmFja2dyb3VuZC4KIFBhdGllbnQgaGFzIGNvbXBsZXRlZCBzb21lIGNvbGxlZ2UgY291cnNlcy4KUGF0aWVudCBjdXJyZW50bHkgaGFzIEh1bWFuYS4KCiMgQWxsZXJnaWVzCk5vIEtub3duIEFsbGVyZ2llcy4KCiMgTWVkaWNhdGlvbnMKTm8gQWN0aXZlIE1lZGljYXRpb25zLgoKIyBBc3Nlc3NtZW50IGFuZCBQbGFuClBhdGllbnQgaXMgcHJlc2VudGluZyB3aXRoIGhpc3Rvcnkgb2YgY29yb25hcnkgYXJ0ZXJ5IGJ5cGFzcyBncmFmdGluZyAoc2l0dWF0aW9uKS4gCgojIyBQbGFuCgpUaGUgcGF0aWVudCB3YXMgcHJlc2NyaWJlZCB0aGUgZm9sbG93aW5nIG1lZGljYXRpb25zOgotIGNlZmF6b2xpbiAyMDAwIG1nIGluamVjdGlvbgotIDEgbWwgaGVwYXJpbiBzb2RpdW0sIHBvcmNpbmUgNTAwMCB1bnQvbWwgaW5qZWN0aW9uCi0gMjUgbWwgcHJvdGFtaW5lIHN1bGZhdGUgKHVzcCkgMTAgbWcvbWwgaW5qZWN0aW9uCi0gNCBtbCBub3JlcGluZXBocmluZSAxIG1nL21sIGluamVjdGlvbgo=" + } ] + }, + "request": { + "method": "POST", + "url": "DiagnosticReport" + } + }, { + "fullUrl": "urn:uuid:dccb52db-ef15-b3ca-7501-fffb0ffd6cf7", + "resource": { + "resourceType": "DocumentReference", + "id": "dccb52db-ef15-b3ca-7501-fffb0ffd6cf7", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-documentreference" ] + }, + "identifier": [ { + "system": "urn:ietf:rfc:3986", + "value": "urn:uuid:28ec1f09-7213-e40d-d608-6d29a31fd7da" + } ], + "status": "superseded", + "type": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "category": [ { + "coding": [ { + "system": "http://hl7.org/fhir/us/core/CodeSystem/us-core-documentreference-category", + "code": "clinical-note", + "display": "Clinical Note" + } ] + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "date": "2006-12-18T03:59:59.558-05:00", + "author": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } ], + "custodian": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "content": [ { + "attachment": { + "contentType": "text/plain; charset=utf-8", + "data": "CjIwMDYtMTItMTgKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgNTYgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuCgojIFNvY2lhbCBIaXN0b3J5ClBhdGllbnQgaXMgbWFycmllZC4gUGF0aWVudCBpcyBhbiBhY3RpdmUgc21va2VyIGFuZCBpcyBhbiBhbGNvaG9saWMuCiBQYXRpZW50IGlkZW50aWZpZXMgYXMgaGV0ZXJvc2V4dWFsLgoKUGF0aWVudCBjb21lcyBmcm9tIGEgbWlkZGxlIHNvY2lvZWNvbm9taWMgYmFja2dyb3VuZC4KIFBhdGllbnQgaGFzIGNvbXBsZXRlZCBzb21lIGNvbGxlZ2UgY291cnNlcy4KUGF0aWVudCBjdXJyZW50bHkgaGFzIEh1bWFuYS4KCiMgQWxsZXJnaWVzCk5vIEtub3duIEFsbGVyZ2llcy4KCiMgTWVkaWNhdGlvbnMKTm8gQWN0aXZlIE1lZGljYXRpb25zLgoKIyBBc3Nlc3NtZW50IGFuZCBQbGFuClBhdGllbnQgaXMgcHJlc2VudGluZyB3aXRoIGhpc3Rvcnkgb2YgY29yb25hcnkgYXJ0ZXJ5IGJ5cGFzcyBncmFmdGluZyAoc2l0dWF0aW9uKS4gCgojIyBQbGFuCgpUaGUgcGF0aWVudCB3YXMgcHJlc2NyaWJlZCB0aGUgZm9sbG93aW5nIG1lZGljYXRpb25zOgotIGNlZmF6b2xpbiAyMDAwIG1nIGluamVjdGlvbgotIDEgbWwgaGVwYXJpbiBzb2RpdW0sIHBvcmNpbmUgNTAwMCB1bnQvbWwgaW5qZWN0aW9uCi0gMjUgbWwgcHJvdGFtaW5lIHN1bGZhdGUgKHVzcCkgMTAgbWcvbWwgaW5qZWN0aW9uCi0gNCBtbCBub3JlcGluZXBocmluZSAxIG1nL21sIGluamVjdGlvbgo=" + }, + "format": { + "system": "http://ihe.net/fhir/ValueSet/IHE.FormatCode.codesystem", + "code": "urn:ihe:iti:xds:2017:mimeTypeSufficient", + "display": "mimeType Sufficient" + } + } ], + "context": { + "encounter": [ { + "reference": "urn:uuid:bfe69881-b53a-0845-3a8c-959ecaa1724f" + } ], + "period": { + "start": "2006-12-18T03:59:59-05:00", + "end": "2006-12-19T03:59:59-05:00" + } + } + }, + "request": { + "method": "POST", + "url": "DocumentReference" + } + }, { + "fullUrl": "urn:uuid:f21859b7-7fac-9a7b-266f-72ba28959189", + "resource": { + "resourceType": "Claim", + "id": "f21859b7-7fac-9a7b-266f-72ba28959189", + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Lindsay928 Gerlach374" + }, + "billablePeriod": { + "start": "2006-12-18T03:59:59-05:00", + "end": "2006-12-19T03:59:59-05:00" + }, + "created": "2006-12-19T03:59:59-05:00", + "provider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "priority": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } ] + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "diagnosis": [ { + "sequence": 1, + "diagnosisReference": { + "reference": "urn:uuid:2b88a4d5-52f8-7ccd-cda5-939796a5b690" + } + } ], + "insurance": [ { + "sequence": 1, + "focal": true, + "coverage": { + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "112802009", + "display": "Cardiovascular operative procedure (procedure)" + } ], + "text": "Cardiovascular operative procedure (procedure)" + }, + "encounter": [ { + "reference": "urn:uuid:bfe69881-b53a-0845-3a8c-959ecaa1724f" + } ] + }, { + "sequence": 2, + "diagnosisSequence": [ 1 ], + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "399261000", + "display": "History of coronary artery bypass grafting (situation)" + } ], + "text": "History of coronary artery bypass grafting (situation)" + } + } ], + "total": { + "value": 129.16, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, { + "fullUrl": "urn:uuid:f6923b35-32ef-3f7d-d99e-632bf50e0275", + "resource": { + "resourceType": "ExplanationOfBenefit", + "id": "f6923b35-32ef-3f7d-d99e-632bf50e0275", + "contained": [ { + "resourceType": "ServiceRequest", + "id": "referral", + "status": "completed", + "intent": "order", + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "requester": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + } ] + }, { + "resourceType": "Coverage", + "id": "coverage", + "status": "active", + "type": { + "text": "Humana" + }, + "beneficiary": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "payor": [ { + "display": "Humana" + } ] + } ], + "identifier": [ { + "system": "https://bluebutton.cms.gov/resources/variables/clm_id", + "value": "f21859b7-7fac-9a7b-266f-72ba28959189" + }, { + "system": "https://bluebutton.cms.gov/resources/identifier/claim-group", + "value": "99999999999" + } ], + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "billablePeriod": { + "start": "2006-12-19T03:59:59-05:00", + "end": "2007-12-19T03:59:59-05:00" + }, + "created": "2006-12-19T03:59:59-05:00", + "insurer": { + "display": "Humana" + }, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "referral": { + "reference": "#referral" + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "claim": { + "reference": "urn:uuid:f21859b7-7fac-9a7b-266f-72ba28959189" + }, + "outcome": "complete", + "careTeam": [ { + "sequence": 1, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "role": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", + "code": "primary", + "display": "Primary Care Practitioner" + } ] + } + } ], + "diagnosis": [ { + "sequence": 1, + "diagnosisReference": { + "reference": "urn:uuid:2b88a4d5-52f8-7ccd-cda5-939796a5b690" + }, + "type": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-diagnosistype", + "code": "principal" + } ] + } ] + } ], + "insurance": [ { + "focal": true, + "coverage": { + "reference": "#coverage", + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } ] + }, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "112802009", + "display": "Cardiovascular operative procedure (procedure)" + } ], + "text": "Cardiovascular operative procedure (procedure)" + }, + "servicedPeriod": { + "start": "2006-12-18T03:59:59-05:00", + "end": "2006-12-19T03:59:59-05:00" + }, + "locationCodeableConcept": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "21", + "display": "Inpatient Hospital" + } ] + }, + "encounter": [ { + "reference": "urn:uuid:bfe69881-b53a-0845-3a8c-959ecaa1724f" + } ] + }, { + "sequence": 2, + "diagnosisSequence": [ 1 ], + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } ] + }, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "399261000", + "display": "History of coronary artery bypass grafting (situation)" + } ], + "text": "History of coronary artery bypass grafting (situation)" + }, + "servicedPeriod": { + "start": "2006-12-18T03:59:59-05:00", + "end": "2006-12-19T03:59:59-05:00" + }, + "locationCodeableConcept": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "21", + "display": "Inpatient Hospital" + } ] + } + } ], + "total": [ { + "category": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/adjudication", + "code": "submitted", + "display": "Submitted Amount" + } ], + "text": "Submitted Amount" + }, + "amount": { + "value": 129.16, + "currency": "USD" + } + } ], + "payment": { + "amount": { + "value": 0.0, + "currency": "USD" + } + } + }, + "request": { + "method": "POST", + "url": "ExplanationOfBenefit" + } + }, { + "fullUrl": "urn:uuid:c5ebe674-a726-9567-80e9-993ec3b5b2d7", + "resource": { + "resourceType": "Encounter", + "id": "c5ebe674-a726-9567-80e9-993ec3b5b2d7", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter", "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter" ] + }, + "identifier": [ { + "use": "official", + "system": "https://github.com/synthetichealth/synthea", + "value": "c5ebe674-a726-9567-80e9-993ec3b5b2d7" + } ], + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB" + }, + "type": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "185345009", + "display": "Encounter for symptom" + } ], + "text": "Encounter for symptom" + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Mr. Lindsay928 Gerlach374" + }, + "participant": [ { + "type": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType", + "code": "PPRF", + "display": "primary performer" + } ], + "text": "primary performer" + } ], + "period": { + "start": "2009-10-26T06:44:52-04:00", + "end": "2009-10-26T06:59:52-04:00" + }, + "individual": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } + } ], + "period": { + "start": "2009-10-26T06:44:52-04:00", + "end": "2009-10-26T06:59:52-04:00" + }, + "reasonCode": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "195662009", + "display": "Acute viral pharyngitis (disorder)" + } ] + } ], + "location": [ { + "location": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + } ], + "serviceProvider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + }, + "request": { + "method": "POST", + "url": "Encounter" + } + }, { + "fullUrl": "urn:uuid:679c1d2e-56f8-e993-62af-3a3b1fc95126", + "resource": { + "resourceType": "Condition", + "id": "679c1d2e-56f8-e993-62af-3a3b1fc95126", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-condition" ] + }, + "clinicalStatus": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/condition-clinical", + "code": "resolved" + } ] + }, + "verificationStatus": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status", + "code": "confirmed" + } ] + }, + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/condition-category", + "code": "encounter-diagnosis", + "display": "Encounter Diagnosis" + } ] + } ], + "code": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "195662009", + "display": "Acute viral pharyngitis (disorder)" + } ], + "text": "Acute viral pharyngitis (disorder)" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:c5ebe674-a726-9567-80e9-993ec3b5b2d7" + }, + "onsetDateTime": "2009-10-26T06:44:52-04:00", + "abatementDateTime": "2009-11-05T20:44:52-05:00", + "recordedDate": "2009-10-26T06:44:52-04:00" + }, + "request": { + "method": "POST", + "url": "Condition" + } + }, { + "fullUrl": "urn:uuid:a5587c04-bab7-e7dd-cf9a-7b36c0187a95", + "resource": { + "resourceType": "Observation", + "id": "a5587c04-bab7-e7dd-cf9a-7b36c0187a95", + "meta": { + "profile": [ "http://hl7.org/fhir/StructureDefinition/bodytemp", "http://hl7.org/fhir/StructureDefinition/vitalsigns" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "8310-5", + "display": "Body temperature" + }, { + "system": "http://loinc.org", + "code": "8331-1", + "display": "Oral temperature" + } ], + "text": "Body temperature" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:c5ebe674-a726-9567-80e9-993ec3b5b2d7" + }, + "effectiveInstant": "2009-10-26T06:44:52-04:00", + "issued": "2009-10-26T06:44:52.558-04:00", + "valueQuantity": { + "value": 37.665, + "unit": "Cel", + "system": "http://unitsofmeasure.org", + "code": "Cel" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, { + "fullUrl": "urn:uuid:2bc83422-33a4-96aa-2eb1-86ccff4040bc", + "resource": { + "resourceType": "DiagnosticReport", + "id": "2bc83422-33a4-96aa-2eb1-86ccff4040bc", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-note" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:c5ebe674-a726-9567-80e9-993ec3b5b2d7" + }, + "effectiveDateTime": "2009-10-26T06:44:52-04:00", + "issued": "2009-10-26T06:44:52.558-04:00", + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } ], + "presentedForm": [ { + "contentType": "text/plain; charset=utf-8", + "data": "CjIwMDktMTAtMjYKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgNTkgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuCgojIFNvY2lhbCBIaXN0b3J5ClBhdGllbnQgaXMgbWFycmllZC4gUGF0aWVudCBpcyBhbiBhY3RpdmUgc21va2VyIGFuZCBpcyBhbiBhbGNvaG9saWMuCiBQYXRpZW50IGlkZW50aWZpZXMgYXMgaGV0ZXJvc2V4dWFsLgoKUGF0aWVudCBjb21lcyBmcm9tIGEgbWlkZGxlIHNvY2lvZWNvbm9taWMgYmFja2dyb3VuZC4KIFBhdGllbnQgaGFzIGNvbXBsZXRlZCBzb21lIGNvbGxlZ2UgY291cnNlcy4KUGF0aWVudCBjdXJyZW50bHkgaGFzIEh1bWFuYS4KCiMgQWxsZXJnaWVzCk5vIEtub3duIEFsbGVyZ2llcy4KCiMgTWVkaWNhdGlvbnMKTm8gQWN0aXZlIE1lZGljYXRpb25zLgoKIyBBc3Nlc3NtZW50IGFuZCBQbGFuClBhdGllbnQgaXMgcHJlc2VudGluZyB3aXRoIGFjdXRlIHZpcmFsIHBoYXJ5bmdpdGlzIChkaXNvcmRlcikuIAoKIyMgUGxhbgoK" + } ] + }, + "request": { + "method": "POST", + "url": "DiagnosticReport" + } + }, { + "fullUrl": "urn:uuid:bab04a00-12a8-8f2b-196f-8a10c355e577", + "resource": { + "resourceType": "DocumentReference", + "id": "bab04a00-12a8-8f2b-196f-8a10c355e577", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-documentreference" ] + }, + "identifier": [ { + "system": "urn:ietf:rfc:3986", + "value": "urn:uuid:2bc83422-33a4-96aa-2eb1-86ccff4040bc" + } ], + "status": "superseded", + "type": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "category": [ { + "coding": [ { + "system": "http://hl7.org/fhir/us/core/CodeSystem/us-core-documentreference-category", + "code": "clinical-note", + "display": "Clinical Note" + } ] + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "date": "2009-10-26T06:44:52.558-04:00", + "author": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } ], + "custodian": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "content": [ { + "attachment": { + "contentType": "text/plain; charset=utf-8", + "data": "CjIwMDktMTAtMjYKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgNTkgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuCgojIFNvY2lhbCBIaXN0b3J5ClBhdGllbnQgaXMgbWFycmllZC4gUGF0aWVudCBpcyBhbiBhY3RpdmUgc21va2VyIGFuZCBpcyBhbiBhbGNvaG9saWMuCiBQYXRpZW50IGlkZW50aWZpZXMgYXMgaGV0ZXJvc2V4dWFsLgoKUGF0aWVudCBjb21lcyBmcm9tIGEgbWlkZGxlIHNvY2lvZWNvbm9taWMgYmFja2dyb3VuZC4KIFBhdGllbnQgaGFzIGNvbXBsZXRlZCBzb21lIGNvbGxlZ2UgY291cnNlcy4KUGF0aWVudCBjdXJyZW50bHkgaGFzIEh1bWFuYS4KCiMgQWxsZXJnaWVzCk5vIEtub3duIEFsbGVyZ2llcy4KCiMgTWVkaWNhdGlvbnMKTm8gQWN0aXZlIE1lZGljYXRpb25zLgoKIyBBc3Nlc3NtZW50IGFuZCBQbGFuClBhdGllbnQgaXMgcHJlc2VudGluZyB3aXRoIGFjdXRlIHZpcmFsIHBoYXJ5bmdpdGlzIChkaXNvcmRlcikuIAoKIyMgUGxhbgoK" + }, + "format": { + "system": "http://ihe.net/fhir/ValueSet/IHE.FormatCode.codesystem", + "code": "urn:ihe:iti:xds:2017:mimeTypeSufficient", + "display": "mimeType Sufficient" + } + } ], + "context": { + "encounter": [ { + "reference": "urn:uuid:c5ebe674-a726-9567-80e9-993ec3b5b2d7" + } ], + "period": { + "start": "2009-10-26T06:44:52-04:00", + "end": "2009-10-26T06:59:52-04:00" + } + } + }, + "request": { + "method": "POST", + "url": "DocumentReference" + } + }, { + "fullUrl": "urn:uuid:1ba46d84-0e33-f5e3-8a3e-1cbd8326f10e", + "resource": { + "resourceType": "Claim", + "id": "1ba46d84-0e33-f5e3-8a3e-1cbd8326f10e", + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Lindsay928 Gerlach374" + }, + "billablePeriod": { + "start": "2009-10-26T06:44:52-04:00", + "end": "2009-10-26T06:59:52-04:00" + }, + "created": "2009-10-26T06:59:52-04:00", + "provider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "priority": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } ] + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "diagnosis": [ { + "sequence": 1, + "diagnosisReference": { + "reference": "urn:uuid:679c1d2e-56f8-e993-62af-3a3b1fc95126" + } + } ], + "insurance": [ { + "sequence": 1, + "focal": true, + "coverage": { + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "185345009", + "display": "Encounter for symptom" + } ], + "text": "Encounter for symptom" + }, + "encounter": [ { + "reference": "urn:uuid:c5ebe674-a726-9567-80e9-993ec3b5b2d7" + } ] + }, { + "sequence": 2, + "diagnosisSequence": [ 1 ], + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "195662009", + "display": "Acute viral pharyngitis (disorder)" + } ], + "text": "Acute viral pharyngitis (disorder)" + } + } ], + "total": { + "value": 77.49, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, { + "fullUrl": "urn:uuid:9364bf50-87e3-f766-1520-78b1f1e20695", + "resource": { + "resourceType": "ExplanationOfBenefit", + "id": "9364bf50-87e3-f766-1520-78b1f1e20695", + "contained": [ { + "resourceType": "ServiceRequest", + "id": "referral", + "status": "completed", + "intent": "order", + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "requester": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + } ] + }, { + "resourceType": "Coverage", + "id": "coverage", + "status": "active", + "type": { + "text": "Humana" + }, + "beneficiary": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "payor": [ { + "display": "Humana" + } ] + } ], + "identifier": [ { + "system": "https://bluebutton.cms.gov/resources/variables/clm_id", + "value": "1ba46d84-0e33-f5e3-8a3e-1cbd8326f10e" + }, { + "system": "https://bluebutton.cms.gov/resources/identifier/claim-group", + "value": "99999999999" + } ], + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "billablePeriod": { + "start": "2009-10-26T06:59:52-04:00", + "end": "2010-10-26T06:59:52-04:00" + }, + "created": "2009-10-26T06:59:52-04:00", + "insurer": { + "display": "Humana" + }, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "referral": { + "reference": "#referral" + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "claim": { + "reference": "urn:uuid:1ba46d84-0e33-f5e3-8a3e-1cbd8326f10e" + }, + "outcome": "complete", + "careTeam": [ { + "sequence": 1, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "role": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", + "code": "primary", + "display": "Primary Care Practitioner" + } ] + } + } ], + "diagnosis": [ { + "sequence": 1, + "diagnosisReference": { + "reference": "urn:uuid:679c1d2e-56f8-e993-62af-3a3b1fc95126" + }, + "type": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-diagnosistype", + "code": "principal" + } ] + } ] + } ], + "insurance": [ { + "focal": true, + "coverage": { + "reference": "#coverage", + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } ] + }, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "185345009", + "display": "Encounter for symptom" + } ], + "text": "Encounter for symptom" + }, + "servicedPeriod": { + "start": "2009-10-26T06:44:52-04:00", + "end": "2009-10-26T06:59:52-04:00" + }, + "locationCodeableConcept": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "21", + "display": "Inpatient Hospital" + } ] + }, + "encounter": [ { + "reference": "urn:uuid:c5ebe674-a726-9567-80e9-993ec3b5b2d7" + } ] + }, { + "sequence": 2, + "diagnosisSequence": [ 1 ], + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } ] + }, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "195662009", + "display": "Acute viral pharyngitis (disorder)" + } ], + "text": "Acute viral pharyngitis (disorder)" + }, + "servicedPeriod": { + "start": "2009-10-26T06:44:52-04:00", + "end": "2009-10-26T06:59:52-04:00" + }, + "locationCodeableConcept": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "21", + "display": "Inpatient Hospital" + } ] + } + } ], + "total": [ { + "category": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/adjudication", + "code": "submitted", + "display": "Submitted Amount" + } ], + "text": "Submitted Amount" + }, + "amount": { + "value": 77.49, + "currency": "USD" + } + } ], + "payment": { + "amount": { + "value": 0.0, + "currency": "USD" + } + } + }, + "request": { + "method": "POST", + "url": "ExplanationOfBenefit" + } + }, { + "fullUrl": "urn:uuid:2bc21759-828d-cd62-a896-349c094e1a96", + "resource": { + "resourceType": "Encounter", + "id": "2bc21759-828d-cd62-a896-349c094e1a96", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter", "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter" ] + }, + "identifier": [ { + "use": "official", + "system": "https://github.com/synthetichealth/synthea", + "value": "2bc21759-828d-cd62-a896-349c094e1a96" + } ], + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB" + }, + "type": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "1234", + "display": "Referral to clinical trial (procedure)" + } ], + "text": "Referral to clinical trial (procedure)" + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Mr. Lindsay928 Gerlach374" + }, + "participant": [ { + "type": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType", + "code": "PPRF", + "display": "primary performer" + } ], + "text": "primary performer" + } ], + "period": { + "start": "2010-01-05T11:44:52-05:00", + "end": "2010-01-05T11:59:52-05:00" + }, + "individual": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } + } ], + "period": { + "start": "2010-01-05T11:44:52-05:00", + "end": "2010-01-05T11:59:52-05:00" + }, + "location": [ { + "location": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + } ], + "serviceProvider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + }, + "request": { + "method": "POST", + "url": "Encounter" + } + }, { + "fullUrl": "urn:uuid:3f67a0b6-c886-8fe3-42e2-75f2d4ebefec", + "resource": { + "resourceType": "Observation", + "id": "3f67a0b6-c886-8fe3-42e2-75f2d4ebefec", + "meta": { + "profile": [ "http://hl7.org/fhir/StructureDefinition/bp", "http://hl7.org/fhir/StructureDefinition/vitalsigns" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "85354-9", + "display": "Blood Pressure" + } ], + "text": "Blood Pressure" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:2bc21759-828d-cd62-a896-349c094e1a96" + }, + "effectiveInstant": "2010-01-05T11:44:52-05:00", + "issued": "2010-01-05T11:44:52.558-05:00", + "component": [ { + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "8462-4", + "display": "Diastolic Blood Pressure" + } ], + "text": "Diastolic Blood Pressure" + }, + "valueQuantity": { + "value": 49, + "unit": "mm[Hg]", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + }, { + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "8480-6", + "display": "Systolic Blood Pressure" + } ], + "text": "Systolic Blood Pressure" + }, + "valueQuantity": { + "value": 136, + "unit": "mm[Hg]", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + } ] + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, { + "fullUrl": "urn:uuid:e781debb-b0c0-56d2-693f-ce28cfb7fef1", + "resource": { + "resourceType": "Observation", + "id": "e781debb-b0c0-56d2-693f-ce28cfb7fef1", + "status": "final", + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "exam", + "display": "exam" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "65853-4", + "display": "General cardiovascular disease 10Y risk [#] Framingham.D'Agostino" + } ], + "text": "General cardiovascular disease 10Y risk [#] Framingham.D'Agostino" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:2bc21759-828d-cd62-a896-349c094e1a96" + }, + "effectiveInstant": "2010-01-05T11:44:52-05:00", + "issued": "2010-01-05T11:44:52.558-05:00", + "valueQuantity": { + "value": 9.4, + "unit": "%", + "system": "http://unitsofmeasure.org", + "code": "%" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, { + "fullUrl": "urn:uuid:6a286f48-23d9-6fbe-8258-371f89012adb", + "resource": { + "resourceType": "Observation", + "id": "6a286f48-23d9-6fbe-8258-371f89012adb", + "status": "final", + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "laboratory", + "display": "laboratory" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "33914-3", + "display": "Estimated Glomerular Filtration Rate" + } ], + "text": "Estimated Glomerular Filtration Rate" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:2bc21759-828d-cd62-a896-349c094e1a96" + }, + "effectiveInstant": "2010-01-05T11:44:52-05:00", + "issued": "2010-01-05T11:44:52.558-05:00", + "valueQuantity": { + "value": 158.5, + "unit": "mL/min/{1.73_m2}", + "system": "http://unitsofmeasure.org", + "code": "mL/min/{1.73_m2}" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, { + "fullUrl": "urn:uuid:40f11e59-f0c2-abde-aedb-e2dbed2ae963", + "resource": { + "resourceType": "Observation", + "id": "40f11e59-f0c2-abde-aedb-e2dbed2ae963", + "status": "final", + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "laboratory", + "display": "laboratory" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "4548-4", + "display": "Hemoglobin A1c/Hemoglobin.total in Blood" + } ], + "text": "Hemoglobin A1c/Hemoglobin.total in Blood" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:2bc21759-828d-cd62-a896-349c094e1a96" + }, + "effectiveInstant": "2010-01-05T11:44:52-05:00", + "issued": "2010-01-05T11:44:52.558-05:00", + "valueQuantity": { + "value": 5.97, + "unit": "%", + "system": "http://unitsofmeasure.org", + "code": "%" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, { + "fullUrl": "urn:uuid:46681ee9-676e-0a56-8188-d27a3377c0a7", + "resource": { + "resourceType": "Observation", + "id": "46681ee9-676e-0a56-8188-d27a3377c0a7", + "status": "final", + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "laboratory", + "display": "laboratory" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "1558-6", + "display": "Fasting glucose [Mass/volume] in Serum or Plasma" + } ], + "text": "Fasting glucose [Mass/volume] in Serum or Plasma" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:2bc21759-828d-cd62-a896-349c094e1a96" + }, + "effectiveInstant": "2010-01-05T11:44:52-05:00", + "issued": "2010-01-05T11:44:52.558-05:00", + "valueQuantity": { + "value": 73.78, + "unit": "mg/dL", + "system": "http://unitsofmeasure.org", + "code": "mg/dL" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, { + "fullUrl": "urn:uuid:a8927cf4-4f47-42b9-66a0-68616c633f50", + "resource": { + "resourceType": "Observation", + "id": "a8927cf4-4f47-42b9-66a0-68616c633f50", + "status": "final", + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "laboratory", + "display": "laboratory" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "14959-1", + "display": "Microalbumin Creatinine Ratio" + } ], + "text": "Microalbumin Creatinine Ratio" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:2bc21759-828d-cd62-a896-349c094e1a96" + }, + "effectiveInstant": "2010-01-05T11:44:52-05:00", + "issued": "2010-01-05T11:44:52.558-05:00", + "valueQuantity": { + "value": 10.36, + "unit": "mg/g", + "system": "http://unitsofmeasure.org", + "code": "mg/g" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, { + "fullUrl": "urn:uuid:535d1cd6-2b4b-f3cf-70e7-69b5bae0d2f7", + "resource": { + "resourceType": "Observation", + "id": "535d1cd6-2b4b-f3cf-70e7-69b5bae0d2f7", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-lab" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "laboratory", + "display": "laboratory" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "2339-0", + "display": "Glucose" + } ], + "text": "Glucose" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:2bc21759-828d-cd62-a896-349c094e1a96" + }, + "effectiveInstant": "2010-01-05T11:44:52-05:00", + "issued": "2010-01-05T11:44:52.558-05:00", + "valueQuantity": { + "value": 73.78, + "unit": "mg/dL", + "system": "http://unitsofmeasure.org", + "code": "mg/dL" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, { + "fullUrl": "urn:uuid:212bdbde-deb1-7a97-2320-2314c84720c4", + "resource": { + "resourceType": "Observation", + "id": "212bdbde-deb1-7a97-2320-2314c84720c4", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-lab" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "laboratory", + "display": "laboratory" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "6299-2", + "display": "Urea Nitrogen" + } ], + "text": "Urea Nitrogen" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:2bc21759-828d-cd62-a896-349c094e1a96" + }, + "effectiveInstant": "2010-01-05T11:44:52-05:00", + "issued": "2010-01-05T11:44:52.558-05:00", + "valueQuantity": { + "value": 13.31, + "unit": "mg/dL", + "system": "http://unitsofmeasure.org", + "code": "mg/dL" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, { + "fullUrl": "urn:uuid:96e1a620-f762-b58e-1fb5-a47d4505c458", + "resource": { + "resourceType": "Observation", + "id": "96e1a620-f762-b58e-1fb5-a47d4505c458", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-lab" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "laboratory", + "display": "laboratory" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "38483-4", + "display": "Creatinine" + } ], + "text": "Creatinine" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:2bc21759-828d-cd62-a896-349c094e1a96" + }, + "effectiveInstant": "2010-01-05T11:44:52-05:00", + "issued": "2010-01-05T11:44:52.558-05:00", + "valueQuantity": { + "value": 0.88, + "unit": "mg/dL", + "system": "http://unitsofmeasure.org", + "code": "mg/dL" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, { + "fullUrl": "urn:uuid:acf39587-7780-3831-184a-488ab1bd98ec", + "resource": { + "resourceType": "Observation", + "id": "acf39587-7780-3831-184a-488ab1bd98ec", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-lab" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "laboratory", + "display": "laboratory" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "49765-1", + "display": "Calcium" + } ], + "text": "Calcium" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:2bc21759-828d-cd62-a896-349c094e1a96" + }, + "effectiveInstant": "2010-01-05T11:44:52-05:00", + "issued": "2010-01-05T11:44:52.558-05:00", + "valueQuantity": { + "value": 9.58, + "unit": "mg/dL", + "system": "http://unitsofmeasure.org", + "code": "mg/dL" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, { + "fullUrl": "urn:uuid:e5a66e2a-00b1-b2c1-034a-faea0b31f0ba", + "resource": { + "resourceType": "Observation", + "id": "e5a66e2a-00b1-b2c1-034a-faea0b31f0ba", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-lab" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "laboratory", + "display": "laboratory" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "2947-0", + "display": "Sodium" + } ], + "text": "Sodium" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:2bc21759-828d-cd62-a896-349c094e1a96" + }, + "effectiveInstant": "2010-01-05T11:44:52-05:00", + "issued": "2010-01-05T11:44:52.558-05:00", + "valueQuantity": { + "value": 140.01, + "unit": "mmol/L", + "system": "http://unitsofmeasure.org", + "code": "mmol/L" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, { + "fullUrl": "urn:uuid:02b70be6-dbbf-9246-59cb-f208ba0b5e9b", + "resource": { + "resourceType": "Observation", + "id": "02b70be6-dbbf-9246-59cb-f208ba0b5e9b", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-lab" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "laboratory", + "display": "laboratory" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "6298-4", + "display": "Potassium" + } ], + "text": "Potassium" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:2bc21759-828d-cd62-a896-349c094e1a96" + }, + "effectiveInstant": "2010-01-05T11:44:52-05:00", + "issued": "2010-01-05T11:44:52.558-05:00", + "valueQuantity": { + "value": 5.13, + "unit": "mmol/L", + "system": "http://unitsofmeasure.org", + "code": "mmol/L" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, { + "fullUrl": "urn:uuid:37a3952b-d8d8-1cd5-b30a-d00eabcaf5f1", + "resource": { + "resourceType": "Observation", + "id": "37a3952b-d8d8-1cd5-b30a-d00eabcaf5f1", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-lab" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "laboratory", + "display": "laboratory" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "2069-3", + "display": "Chloride" + } ], + "text": "Chloride" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:2bc21759-828d-cd62-a896-349c094e1a96" + }, + "effectiveInstant": "2010-01-05T11:44:52-05:00", + "issued": "2010-01-05T11:44:52.558-05:00", + "valueQuantity": { + "value": 106.53, + "unit": "mmol/L", + "system": "http://unitsofmeasure.org", + "code": "mmol/L" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, { + "fullUrl": "urn:uuid:f2d48712-5153-8e14-783d-5f0b36d724c6", + "resource": { + "resourceType": "Observation", + "id": "f2d48712-5153-8e14-783d-5f0b36d724c6", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-lab" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "laboratory", + "display": "laboratory" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "20565-8", + "display": "Carbon Dioxide" + } ], + "text": "Carbon Dioxide" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:2bc21759-828d-cd62-a896-349c094e1a96" + }, + "effectiveInstant": "2010-01-05T11:44:52-05:00", + "issued": "2010-01-05T11:44:52.558-05:00", + "valueQuantity": { + "value": 23.1, + "unit": "mmol/L", + "system": "http://unitsofmeasure.org", + "code": "mmol/L" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, { + "fullUrl": "urn:uuid:d441eeb1-4efe-f7fe-1213-5c703e798c35", + "resource": { + "resourceType": "Observation", + "id": "d441eeb1-4efe-f7fe-1213-5c703e798c35", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-lab" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "laboratory", + "display": "laboratory" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "2093-3", + "display": "Total Cholesterol" + } ], + "text": "Total Cholesterol" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:2bc21759-828d-cd62-a896-349c094e1a96" + }, + "effectiveInstant": "2010-01-05T11:44:52-05:00", + "issued": "2010-01-05T11:44:52.558-05:00", + "valueQuantity": { + "value": 160.23, + "unit": "mg/dL", + "system": "http://unitsofmeasure.org", + "code": "mg/dL" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, { + "fullUrl": "urn:uuid:452263ad-af2d-ebe3-fcc5-07bf77377b08", + "resource": { + "resourceType": "Observation", + "id": "452263ad-af2d-ebe3-fcc5-07bf77377b08", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-lab" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "laboratory", + "display": "laboratory" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "2571-8", + "display": "Triglycerides" + } ], + "text": "Triglycerides" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:2bc21759-828d-cd62-a896-349c094e1a96" + }, + "effectiveInstant": "2010-01-05T11:44:52-05:00", + "issued": "2010-01-05T11:44:52.558-05:00", + "valueQuantity": { + "value": 145.97, + "unit": "mg/dL", + "system": "http://unitsofmeasure.org", + "code": "mg/dL" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, { + "fullUrl": "urn:uuid:56f69817-ed4f-2fb2-b6ef-68851664eea2", + "resource": { + "resourceType": "Observation", + "id": "56f69817-ed4f-2fb2-b6ef-68851664eea2", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-lab" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "laboratory", + "display": "laboratory" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "18262-6", + "display": "Low Density Lipoprotein Cholesterol" + } ], + "text": "Low Density Lipoprotein Cholesterol" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:2bc21759-828d-cd62-a896-349c094e1a96" + }, + "effectiveInstant": "2010-01-05T11:44:52-05:00", + "issued": "2010-01-05T11:44:52.558-05:00", + "valueQuantity": { + "value": 54.06, + "unit": "mg/dL", + "system": "http://unitsofmeasure.org", + "code": "mg/dL" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, { + "fullUrl": "urn:uuid:221d9173-89c1-037a-ce1a-7f882b6c3e1f", + "resource": { + "resourceType": "Observation", + "id": "221d9173-89c1-037a-ce1a-7f882b6c3e1f", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-lab" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "laboratory", + "display": "laboratory" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "2085-9", + "display": "High Density Lipoprotein Cholesterol" + } ], + "text": "High Density Lipoprotein Cholesterol" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:2bc21759-828d-cd62-a896-349c094e1a96" + }, + "effectiveInstant": "2010-01-05T11:44:52-05:00", + "issued": "2010-01-05T11:44:52.558-05:00", + "valueQuantity": { + "value": 76.98, + "unit": "mg/dL", + "system": "http://unitsofmeasure.org", + "code": "mg/dL" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, { + "fullUrl": "urn:uuid:2a4adf15-f265-bb2e-20d4-d73d4c42d3b9", + "resource": { + "resourceType": "Observation", + "id": "2a4adf15-f265-bb2e-20d4-d73d4c42d3b9", + "meta": { + "profile": [ "http://hl7.org/fhir/StructureDefinition/bodyheight", "http://hl7.org/fhir/StructureDefinition/vitalsigns" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "8302-2", + "display": "Body Height" + } ], + "text": "Body Height" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:2bc21759-828d-cd62-a896-349c094e1a96" + }, + "effectiveInstant": "2010-01-05T11:44:52-05:00", + "issued": "2010-01-05T11:44:52.558-05:00", + "valueQuantity": { + "value": 162.1, + "unit": "cm", + "system": "http://unitsofmeasure.org", + "code": "cm" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, { + "fullUrl": "urn:uuid:4af961b1-a341-b0a8-3d13-277bb325986d", + "resource": { + "resourceType": "Observation", + "id": "4af961b1-a341-b0a8-3d13-277bb325986d", + "meta": { + "profile": [ "http://hl7.org/fhir/StructureDefinition/bodyweight", "http://hl7.org/fhir/StructureDefinition/vitalsigns" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "29463-7", + "display": "Body Weight" + } ], + "text": "Body Weight" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:2bc21759-828d-cd62-a896-349c094e1a96" + }, + "effectiveInstant": "2010-01-05T11:44:52-05:00", + "issued": "2010-01-05T11:44:52.558-05:00", + "valueQuantity": { + "value": 78.1, + "unit": "kg", + "system": "http://unitsofmeasure.org", + "code": "kg" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, { + "fullUrl": "urn:uuid:1c8a7831-6277-d1f0-f13a-0075e03df5dd", + "resource": { + "resourceType": "Observation", + "id": "1c8a7831-6277-d1f0-f13a-0075e03df5dd", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/pediatric-bmi-for-age" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "59576-9", + "display": "Body mass index (BMI) [Percentile] Per age and gender" + } ], + "text": "Body mass index (BMI) [Percentile] Per age and gender" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:2bc21759-828d-cd62-a896-349c094e1a96" + }, + "effectiveInstant": "2010-01-05T11:44:52-05:00", + "issued": "2010-01-05T11:44:52.558-05:00", + "valueQuantity": { + "value": 60.542, + "unit": "%", + "system": "http://unitsofmeasure.org", + "code": "%" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, { + "fullUrl": "urn:uuid:7d6aa5c8-048a-4fbd-5222-b0e5e07a9278", + "resource": { + "resourceType": "Observation", + "id": "7d6aa5c8-048a-4fbd-5222-b0e5e07a9278", + "status": "final", + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "survey", + "display": "survey" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "clinical_trial_enrollment_criteria", + "display": "clinical_trial_enrollment_criteria" + } ], + "text": "clinical_trial_enrollment_criteria" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:2bc21759-828d-cd62-a896-349c094e1a96" + }, + "effectiveInstant": "2010-01-05T11:44:52-05:00", + "issued": "2010-01-05T11:44:52.558-05:00", + "component": [ { + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "htn_trial_excl_crit_proteinuria", + "display": "htn_trial_excl_crit_proteinuria" + } ], + "text": "htn_trial_excl_crit_proteinuria" + }, + "valueBoolean": false + }, { + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "diabetes_dx", + "display": "diabetes_dx" + } ], + "text": "diabetes_dx" + }, + "valueCodeableConcept": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "15777000", + "display": "Prediabetes" + } ], + "text": "Prediabetes" + } + }, { + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "htn_trial_excl_crit_diabetes", + "display": "htn_trial_excl_crit_diabetes" + } ], + "text": "htn_trial_excl_crit_diabetes" + }, + "valueBoolean": false + }, { + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "htn_excl_crit_stroke", + "display": "htn_excl_crit_stroke" + } ], + "text": "htn_excl_crit_stroke" + }, + "valueBoolean": false + }, { + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "htn_trial_excl_crit_esrd", + "display": "htn_trial_excl_crit_esrd" + } ], + "text": "htn_trial_excl_crit_esrd" + }, + "valueBoolean": false + }, { + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "htn_trial_incl_crit_cvdrisk_decreased_egfr", + "display": "htn_trial_incl_crit_cvdrisk_decreased_egfr" + } ], + "text": "htn_trial_incl_crit_cvdrisk_decreased_egfr" + }, + "valueBoolean": false + }, { + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "htn_trial_incl_crit_cvd", + "display": "htn_trial_incl_crit_cvd" + } ], + "text": "htn_trial_incl_crit_cvd" + }, + "valueBoolean": true + }, { + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "htn_trial_incl_crit_cvdrisk_fhs", + "display": "htn_trial_incl_crit_cvdrisk_fhs" + } ], + "text": "htn_trial_incl_crit_cvdrisk_fhs" + }, + "valueBoolean": false + }, { + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "htn_trial_incl_crit_cvdrisk_old_age", + "display": "htn_trial_incl_crit_cvdrisk_old_age" + } ], + "text": "htn_trial_incl_crit_cvdrisk_old_age" + }, + "valueBoolean": false + }, { + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "htn_trial_incl_crit_age", + "display": "htn_trial_incl_crit_age" + } ], + "text": "htn_trial_incl_crit_age" + }, + "valueBoolean": true + }, { + "code": { + "coding": [ { + "system": "http://loinc.org", + "display": "htn_trial_incl_crit_sbp" + } ], + "text": "htn_trial_incl_crit_sbp" + }, + "valueBoolean": true + }, { + "code": { + "coding": [ { + "system": "http://loinc.org", + "display": "htn_trial_excl_crit_overall" + } ], + "text": "htn_trial_excl_crit_overall" + }, + "valueBoolean": false + }, { + "code": { + "coding": [ { + "system": "http://loinc.org", + "display": "htn_trial_incl_crit_overall" + } ], + "text": "htn_trial_incl_crit_overall" + }, + "valueBoolean": true + }, { + "code": { + "coding": [ { + "system": "http://loinc.org", + "display": "htn_trial_treatment_arm" + } ], + "text": "htn_trial_treatment_arm" + }, + "valueString": "standard" + }, { + "code": { + "coding": [ { + "system": "http://loinc.org", + "display": "htn_trial_eligibility" + } ], + "text": "htn_trial_eligibility" + }, + "valueBoolean": true + } ] + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, { + "fullUrl": "urn:uuid:1e920546-d019-303b-afcb-db8581f52bd7", + "resource": { + "resourceType": "DiagnosticReport", + "id": "1e920546-d019-303b-afcb-db8581f52bd7", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-lab" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/v2-0074", + "code": "LAB", + "display": "Laboratory" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "51990-0", + "display": "Basic Metabolic Panel" + } ], + "text": "Basic Metabolic Panel" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:2bc21759-828d-cd62-a896-349c094e1a96" + }, + "effectiveDateTime": "2010-01-05T11:44:52-05:00", + "issued": "2010-01-05T11:44:52.558-05:00", + "performer": [ { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } ], + "result": [ { + "reference": "urn:uuid:535d1cd6-2b4b-f3cf-70e7-69b5bae0d2f7", + "display": "Glucose" + }, { + "reference": "urn:uuid:212bdbde-deb1-7a97-2320-2314c84720c4", + "display": "Urea Nitrogen" + }, { + "reference": "urn:uuid:96e1a620-f762-b58e-1fb5-a47d4505c458", + "display": "Creatinine" + }, { + "reference": "urn:uuid:acf39587-7780-3831-184a-488ab1bd98ec", + "display": "Calcium" + }, { + "reference": "urn:uuid:e5a66e2a-00b1-b2c1-034a-faea0b31f0ba", + "display": "Sodium" + }, { + "reference": "urn:uuid:02b70be6-dbbf-9246-59cb-f208ba0b5e9b", + "display": "Potassium" + }, { + "reference": "urn:uuid:37a3952b-d8d8-1cd5-b30a-d00eabcaf5f1", + "display": "Chloride" + }, { + "reference": "urn:uuid:f2d48712-5153-8e14-783d-5f0b36d724c6", + "display": "Carbon Dioxide" + } ] + }, + "request": { + "method": "POST", + "url": "DiagnosticReport" + } + }, { + "fullUrl": "urn:uuid:61481dae-2bb0-ca0e-f879-6fc39ff1336a", + "resource": { + "resourceType": "DiagnosticReport", + "id": "61481dae-2bb0-ca0e-f879-6fc39ff1336a", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-lab" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/v2-0074", + "code": "LAB", + "display": "Laboratory" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "57698-3", + "display": "Lipid Panel" + } ], + "text": "Lipid Panel" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:2bc21759-828d-cd62-a896-349c094e1a96" + }, + "effectiveDateTime": "2010-01-05T11:44:52-05:00", + "issued": "2010-01-05T11:44:52.558-05:00", + "performer": [ { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } ], + "result": [ { + "reference": "urn:uuid:d441eeb1-4efe-f7fe-1213-5c703e798c35", + "display": "Total Cholesterol" + }, { + "reference": "urn:uuid:452263ad-af2d-ebe3-fcc5-07bf77377b08", + "display": "Triglycerides" + }, { + "reference": "urn:uuid:56f69817-ed4f-2fb2-b6ef-68851664eea2", + "display": "Low Density Lipoprotein Cholesterol" + }, { + "reference": "urn:uuid:221d9173-89c1-037a-ce1a-7f882b6c3e1f", + "display": "High Density Lipoprotein Cholesterol" + } ] + }, + "request": { + "method": "POST", + "url": "DiagnosticReport" + } + }, { + "fullUrl": "urn:uuid:1277ec05-c8d6-6b96-960e-f9b4d3151153", + "resource": { + "resourceType": "DiagnosticReport", + "id": "1277ec05-c8d6-6b96-960e-f9b4d3151153", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-note" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:2bc21759-828d-cd62-a896-349c094e1a96" + }, + "effectiveDateTime": "2010-01-05T11:44:52-05:00", + "issued": "2010-01-05T11:44:52.558-05:00", + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } ], + "presentedForm": [ { + "contentType": "text/plain; charset=utf-8", + "data": "CjIwMTAtMDEtMDUKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgNTkgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuIFBhdGllbnQgaGFzIGEgaGlzdG9yeSBvZiBhY3V0ZSB2aXJhbCBwaGFyeW5naXRpcyAoZGlzb3JkZXIpLgoKIyBTb2NpYWwgSGlzdG9yeQpQYXRpZW50IGlzIG1hcnJpZWQuIFBhdGllbnQgaXMgYW4gYWN0aXZlIHNtb2tlciBhbmQgaXMgYW4gYWxjb2hvbGljLgogUGF0aWVudCBpZGVudGlmaWVzIGFzIGhldGVyb3NleHVhbC4KClBhdGllbnQgY29tZXMgZnJvbSBhIG1pZGRsZSBzb2Npb2Vjb25vbWljIGJhY2tncm91bmQuCiBQYXRpZW50IGhhcyBjb21wbGV0ZWQgc29tZSBjb2xsZWdlIGNvdXJzZXMuClBhdGllbnQgY3VycmVudGx5IGhhcyBIdW1hbmEuCgojIEFsbGVyZ2llcwpObyBLbm93biBBbGxlcmdpZXMuCgojIE1lZGljYXRpb25zCk5vIEFjdGl2ZSBNZWRpY2F0aW9ucy4KCiMgQXNzZXNzbWVudCBhbmQgUGxhbgoKCiMjIFBsYW4KCg==" + } ] + }, + "request": { + "method": "POST", + "url": "DiagnosticReport" + } + }, { + "fullUrl": "urn:uuid:475a366c-8da1-b274-ceaa-7d48e03a3191", + "resource": { + "resourceType": "DocumentReference", + "id": "475a366c-8da1-b274-ceaa-7d48e03a3191", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-documentreference" ] + }, + "identifier": [ { + "system": "urn:ietf:rfc:3986", + "value": "urn:uuid:1277ec05-c8d6-6b96-960e-f9b4d3151153" + } ], + "status": "superseded", + "type": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "category": [ { + "coding": [ { + "system": "http://hl7.org/fhir/us/core/CodeSystem/us-core-documentreference-category", + "code": "clinical-note", + "display": "Clinical Note" + } ] + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "date": "2010-01-05T11:44:52.558-05:00", + "author": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } ], + "custodian": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "content": [ { + "attachment": { + "contentType": "text/plain; charset=utf-8", + "data": "CjIwMTAtMDEtMDUKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgNTkgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuIFBhdGllbnQgaGFzIGEgaGlzdG9yeSBvZiBhY3V0ZSB2aXJhbCBwaGFyeW5naXRpcyAoZGlzb3JkZXIpLgoKIyBTb2NpYWwgSGlzdG9yeQpQYXRpZW50IGlzIG1hcnJpZWQuIFBhdGllbnQgaXMgYW4gYWN0aXZlIHNtb2tlciBhbmQgaXMgYW4gYWxjb2hvbGljLgogUGF0aWVudCBpZGVudGlmaWVzIGFzIGhldGVyb3NleHVhbC4KClBhdGllbnQgY29tZXMgZnJvbSBhIG1pZGRsZSBzb2Npb2Vjb25vbWljIGJhY2tncm91bmQuCiBQYXRpZW50IGhhcyBjb21wbGV0ZWQgc29tZSBjb2xsZWdlIGNvdXJzZXMuClBhdGllbnQgY3VycmVudGx5IGhhcyBIdW1hbmEuCgojIEFsbGVyZ2llcwpObyBLbm93biBBbGxlcmdpZXMuCgojIE1lZGljYXRpb25zCk5vIEFjdGl2ZSBNZWRpY2F0aW9ucy4KCiMgQXNzZXNzbWVudCBhbmQgUGxhbgoKCiMjIFBsYW4KCg==" + }, + "format": { + "system": "http://ihe.net/fhir/ValueSet/IHE.FormatCode.codesystem", + "code": "urn:ihe:iti:xds:2017:mimeTypeSufficient", + "display": "mimeType Sufficient" + } + } ], + "context": { + "encounter": [ { + "reference": "urn:uuid:2bc21759-828d-cd62-a896-349c094e1a96" + } ], + "period": { + "start": "2010-01-05T11:44:52-05:00", + "end": "2010-01-05T11:59:52-05:00" + } + } + }, + "request": { + "method": "POST", + "url": "DocumentReference" + } + }, { + "fullUrl": "urn:uuid:cd097c71-6615-574d-7f35-50c0474e3f61", + "resource": { + "resourceType": "Claim", + "id": "cd097c71-6615-574d-7f35-50c0474e3f61", + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Lindsay928 Gerlach374" + }, + "billablePeriod": { + "start": "2010-01-05T11:44:52-05:00", + "end": "2010-01-05T11:59:52-05:00" + }, + "created": "2010-01-05T11:59:52-05:00", + "provider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "priority": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } ] + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "insurance": [ { + "sequence": 1, + "focal": true, + "coverage": { + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "1234", + "display": "Referral to clinical trial (procedure)" + } ], + "text": "Referral to clinical trial (procedure)" + }, + "encounter": [ { + "reference": "urn:uuid:2bc21759-828d-cd62-a896-349c094e1a96" + } ] + } ], + "total": { + "value": 129.16, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, { + "fullUrl": "urn:uuid:d1f418a1-4052-71cd-b803-aa5c068232e0", + "resource": { + "resourceType": "ExplanationOfBenefit", + "id": "d1f418a1-4052-71cd-b803-aa5c068232e0", + "contained": [ { + "resourceType": "ServiceRequest", + "id": "referral", + "status": "completed", + "intent": "order", + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "requester": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + } ] + }, { + "resourceType": "Coverage", + "id": "coverage", + "status": "active", + "type": { + "text": "Humana" + }, + "beneficiary": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "payor": [ { + "display": "Humana" + } ] + } ], + "identifier": [ { + "system": "https://bluebutton.cms.gov/resources/variables/clm_id", + "value": "cd097c71-6615-574d-7f35-50c0474e3f61" + }, { + "system": "https://bluebutton.cms.gov/resources/identifier/claim-group", + "value": "99999999999" + } ], + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "billablePeriod": { + "start": "2010-01-05T11:59:52-05:00", + "end": "2011-01-05T11:59:52-05:00" + }, + "created": "2010-01-05T11:59:52-05:00", + "insurer": { + "display": "Humana" + }, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "referral": { + "reference": "#referral" + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "claim": { + "reference": "urn:uuid:cd097c71-6615-574d-7f35-50c0474e3f61" + }, + "outcome": "complete", + "careTeam": [ { + "sequence": 1, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "role": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", + "code": "primary", + "display": "Primary Care Practitioner" + } ] + } + } ], + "insurance": [ { + "focal": true, + "coverage": { + "reference": "#coverage", + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } ] + }, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "1234", + "display": "Referral to clinical trial (procedure)" + } ], + "text": "Referral to clinical trial (procedure)" + }, + "servicedPeriod": { + "start": "2010-01-05T11:44:52-05:00", + "end": "2010-01-05T11:59:52-05:00" + }, + "locationCodeableConcept": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "21", + "display": "Inpatient Hospital" + } ] + }, + "encounter": [ { + "reference": "urn:uuid:2bc21759-828d-cd62-a896-349c094e1a96" + } ] + } ], + "total": [ { + "category": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/adjudication", + "code": "submitted", + "display": "Submitted Amount" + } ], + "text": "Submitted Amount" + }, + "amount": { + "value": 129.16, + "currency": "USD" + } + } ], + "payment": { + "amount": { + "value": 0.0, + "currency": "USD" + } + } + }, + "request": { + "method": "POST", + "url": "ExplanationOfBenefit" + } + }, { + "fullUrl": "urn:uuid:12566761-5eed-78ee-5ff2-d5579aaa14f4", + "resource": { + "resourceType": "Encounter", + "id": "12566761-5eed-78ee-5ff2-d5579aaa14f4", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter", "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter" ] + }, + "identifier": [ { + "use": "official", + "system": "https://github.com/synthetichealth/synthea", + "value": "12566761-5eed-78ee-5ff2-d5579aaa14f4" + } ], + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB" + }, + "type": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "1234", + "display": "SNOMED Code" + } ], + "text": "SNOMED Code" + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Mr. Lindsay928 Gerlach374" + }, + "participant": [ { + "type": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType", + "code": "PPRF", + "display": "primary performer" + } ], + "text": "primary performer" + } ], + "period": { + "start": "2010-02-04T11:44:52-05:00", + "end": "2010-02-04T11:59:52-05:00" + }, + "individual": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } + } ], + "period": { + "start": "2010-02-04T11:44:52-05:00", + "end": "2010-02-04T11:59:52-05:00" + }, + "reasonCode": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "274531002", + "display": "Abnormal findings diagnostic imaging heart+coronary circulat (finding)" + } ] + } ], + "location": [ { + "location": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + } ], + "serviceProvider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + }, + "request": { + "method": "POST", + "url": "Encounter" + } + }, { + "fullUrl": "urn:uuid:593006fe-035c-837a-c501-4218367a9d6d", + "resource": { + "resourceType": "Observation", + "id": "593006fe-035c-837a-c501-4218367a9d6d", + "meta": { + "profile": [ "http://hl7.org/fhir/StructureDefinition/bp", "http://hl7.org/fhir/StructureDefinition/vitalsigns" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "85354-9", + "display": "Blood Pressure" + } ], + "text": "Blood Pressure" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:12566761-5eed-78ee-5ff2-d5579aaa14f4" + }, + "effectiveInstant": "2010-02-04T11:44:52-05:00", + "issued": "2010-02-04T11:44:52.558-05:00", + "component": [ { + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "8462-4", + "display": "Diastolic Blood Pressure" + } ], + "text": "Diastolic Blood Pressure" + }, + "valueQuantity": { + "value": 49, + "unit": "mm[Hg]", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + }, { + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "8480-6", + "display": "Systolic Blood Pressure" + } ], + "text": "Systolic Blood Pressure" + }, + "valueQuantity": { + "value": 136, + "unit": "mm[Hg]", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + } ] + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, { + "fullUrl": "urn:uuid:62c48502-1bea-8cce-995a-e5a135800f66", + "resource": { + "resourceType": "DiagnosticReport", + "id": "62c48502-1bea-8cce-995a-e5a135800f66", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-note" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:12566761-5eed-78ee-5ff2-d5579aaa14f4" + }, + "effectiveDateTime": "2010-02-04T11:44:52-05:00", + "issued": "2010-02-04T11:44:52.558-05:00", + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } ], + "presentedForm": [ { + "contentType": "text/plain; charset=utf-8", + "data": "CjIwMTAtMDItMDQKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgNTkgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuIFBhdGllbnQgaGFzIGEgaGlzdG9yeSBvZiBhY3V0ZSB2aXJhbCBwaGFyeW5naXRpcyAoZGlzb3JkZXIpLgoKIyBTb2NpYWwgSGlzdG9yeQpQYXRpZW50IGlzIG1hcnJpZWQuIFBhdGllbnQgaXMgYW4gYWN0aXZlIHNtb2tlciBhbmQgaXMgYW4gYWxjb2hvbGljLgogUGF0aWVudCBpZGVudGlmaWVzIGFzIGhldGVyb3NleHVhbC4KClBhdGllbnQgY29tZXMgZnJvbSBhIG1pZGRsZSBzb2Npb2Vjb25vbWljIGJhY2tncm91bmQuCiBQYXRpZW50IGhhcyBjb21wbGV0ZWQgc29tZSBjb2xsZWdlIGNvdXJzZXMuClBhdGllbnQgY3VycmVudGx5IGhhcyBIdW1hbmEuCgojIEFsbGVyZ2llcwpObyBLbm93biBBbGxlcmdpZXMuCgojIE1lZGljYXRpb25zCk5vIEFjdGl2ZSBNZWRpY2F0aW9ucy4KCiMgQXNzZXNzbWVudCBhbmQgUGxhbgoKCiMjIFBsYW4KCg==" + } ] + }, + "request": { + "method": "POST", + "url": "DiagnosticReport" + } + }, { + "fullUrl": "urn:uuid:7de90cc8-0513-c1e0-ac87-9c49b77bf7f1", + "resource": { + "resourceType": "DocumentReference", + "id": "7de90cc8-0513-c1e0-ac87-9c49b77bf7f1", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-documentreference" ] + }, + "identifier": [ { + "system": "urn:ietf:rfc:3986", + "value": "urn:uuid:62c48502-1bea-8cce-995a-e5a135800f66" + } ], + "status": "superseded", + "type": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "category": [ { + "coding": [ { + "system": "http://hl7.org/fhir/us/core/CodeSystem/us-core-documentreference-category", + "code": "clinical-note", + "display": "Clinical Note" + } ] + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "date": "2010-02-04T11:44:52.558-05:00", + "author": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } ], + "custodian": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "content": [ { + "attachment": { + "contentType": "text/plain; charset=utf-8", + "data": "CjIwMTAtMDItMDQKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgNTkgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuIFBhdGllbnQgaGFzIGEgaGlzdG9yeSBvZiBhY3V0ZSB2aXJhbCBwaGFyeW5naXRpcyAoZGlzb3JkZXIpLgoKIyBTb2NpYWwgSGlzdG9yeQpQYXRpZW50IGlzIG1hcnJpZWQuIFBhdGllbnQgaXMgYW4gYWN0aXZlIHNtb2tlciBhbmQgaXMgYW4gYWxjb2hvbGljLgogUGF0aWVudCBpZGVudGlmaWVzIGFzIGhldGVyb3NleHVhbC4KClBhdGllbnQgY29tZXMgZnJvbSBhIG1pZGRsZSBzb2Npb2Vjb25vbWljIGJhY2tncm91bmQuCiBQYXRpZW50IGhhcyBjb21wbGV0ZWQgc29tZSBjb2xsZWdlIGNvdXJzZXMuClBhdGllbnQgY3VycmVudGx5IGhhcyBIdW1hbmEuCgojIEFsbGVyZ2llcwpObyBLbm93biBBbGxlcmdpZXMuCgojIE1lZGljYXRpb25zCk5vIEFjdGl2ZSBNZWRpY2F0aW9ucy4KCiMgQXNzZXNzbWVudCBhbmQgUGxhbgoKCiMjIFBsYW4KCg==" + }, + "format": { + "system": "http://ihe.net/fhir/ValueSet/IHE.FormatCode.codesystem", + "code": "urn:ihe:iti:xds:2017:mimeTypeSufficient", + "display": "mimeType Sufficient" + } + } ], + "context": { + "encounter": [ { + "reference": "urn:uuid:12566761-5eed-78ee-5ff2-d5579aaa14f4" + } ], + "period": { + "start": "2010-02-04T11:44:52-05:00", + "end": "2010-02-04T11:59:52-05:00" + } + } + }, + "request": { + "method": "POST", + "url": "DocumentReference" + } + }, { + "fullUrl": "urn:uuid:e365eb51-b9eb-1a82-1110-83b3bb8db2f2", + "resource": { + "resourceType": "Claim", + "id": "e365eb51-b9eb-1a82-1110-83b3bb8db2f2", + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Lindsay928 Gerlach374" + }, + "billablePeriod": { + "start": "2010-02-04T11:44:52-05:00", + "end": "2010-02-04T11:59:52-05:00" + }, + "created": "2010-02-04T11:59:52-05:00", + "provider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "priority": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } ] + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "insurance": [ { + "sequence": 1, + "focal": true, + "coverage": { + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "1234", + "display": "SNOMED Code" + } ], + "text": "SNOMED Code" + }, + "encounter": [ { + "reference": "urn:uuid:12566761-5eed-78ee-5ff2-d5579aaa14f4" + } ] + } ], + "total": { + "value": 129.16, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, { + "fullUrl": "urn:uuid:e7cbfc58-b269-c2e7-dacc-7ff5ca63da4b", + "resource": { + "resourceType": "ExplanationOfBenefit", + "id": "e7cbfc58-b269-c2e7-dacc-7ff5ca63da4b", + "contained": [ { + "resourceType": "ServiceRequest", + "id": "referral", + "status": "completed", + "intent": "order", + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "requester": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + } ] + }, { + "resourceType": "Coverage", + "id": "coverage", + "status": "active", + "type": { + "text": "Humana" + }, + "beneficiary": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "payor": [ { + "display": "Humana" + } ] + } ], + "identifier": [ { + "system": "https://bluebutton.cms.gov/resources/variables/clm_id", + "value": "e365eb51-b9eb-1a82-1110-83b3bb8db2f2" + }, { + "system": "https://bluebutton.cms.gov/resources/identifier/claim-group", + "value": "99999999999" + } ], + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "billablePeriod": { + "start": "2010-02-04T11:59:52-05:00", + "end": "2011-02-04T11:59:52-05:00" + }, + "created": "2010-02-04T11:59:52-05:00", + "insurer": { + "display": "Humana" + }, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "referral": { + "reference": "#referral" + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "claim": { + "reference": "urn:uuid:e365eb51-b9eb-1a82-1110-83b3bb8db2f2" + }, + "outcome": "complete", + "careTeam": [ { + "sequence": 1, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "role": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", + "code": "primary", + "display": "Primary Care Practitioner" + } ] + } + } ], + "insurance": [ { + "focal": true, + "coverage": { + "reference": "#coverage", + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } ] + }, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "1234", + "display": "SNOMED Code" + } ], + "text": "SNOMED Code" + }, + "servicedPeriod": { + "start": "2010-02-04T11:44:52-05:00", + "end": "2010-02-04T11:59:52-05:00" + }, + "locationCodeableConcept": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "21", + "display": "Inpatient Hospital" + } ] + }, + "encounter": [ { + "reference": "urn:uuid:12566761-5eed-78ee-5ff2-d5579aaa14f4" + } ] + } ], + "total": [ { + "category": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/adjudication", + "code": "submitted", + "display": "Submitted Amount" + } ], + "text": "Submitted Amount" + }, + "amount": { + "value": 129.16, + "currency": "USD" + } + } ], + "payment": { + "amount": { + "value": 0.0, + "currency": "USD" + } + } + }, + "request": { + "method": "POST", + "url": "ExplanationOfBenefit" + } + }, { + "fullUrl": "urn:uuid:898b54a4-9d8d-1966-3853-601d71f30339", + "resource": { + "resourceType": "Encounter", + "id": "898b54a4-9d8d-1966-3853-601d71f30339", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter", "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter" ] + }, + "identifier": [ { + "use": "official", + "system": "https://github.com/synthetichealth/synthea", + "value": "898b54a4-9d8d-1966-3853-601d71f30339" + } ], + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB" + }, + "type": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "1234", + "display": "SNOMED Code" + } ], + "text": "SNOMED Code" + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Mr. Lindsay928 Gerlach374" + }, + "participant": [ { + "type": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType", + "code": "PPRF", + "display": "primary performer" + } ], + "text": "primary performer" + } ], + "period": { + "start": "2010-03-06T11:44:52-05:00", + "end": "2010-03-06T11:59:52-05:00" + }, + "individual": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } + } ], + "period": { + "start": "2010-03-06T11:44:52-05:00", + "end": "2010-03-06T11:59:52-05:00" + }, + "reasonCode": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "274531002", + "display": "Abnormal findings diagnostic imaging heart+coronary circulat (finding)" + } ] + } ], + "location": [ { + "location": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + } ], + "serviceProvider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + }, + "request": { + "method": "POST", + "url": "Encounter" + } + }, { + "fullUrl": "urn:uuid:9c19bd9e-9830-447e-0e1a-55d356106dfd", + "resource": { + "resourceType": "Observation", + "id": "9c19bd9e-9830-447e-0e1a-55d356106dfd", + "meta": { + "profile": [ "http://hl7.org/fhir/StructureDefinition/bp", "http://hl7.org/fhir/StructureDefinition/vitalsigns" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "85354-9", + "display": "Blood Pressure" + } ], + "text": "Blood Pressure" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:898b54a4-9d8d-1966-3853-601d71f30339" + }, + "effectiveInstant": "2010-03-06T11:44:52-05:00", + "issued": "2010-03-06T11:44:52.558-05:00", + "component": [ { + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "8462-4", + "display": "Diastolic Blood Pressure" + } ], + "text": "Diastolic Blood Pressure" + }, + "valueQuantity": { + "value": 49, + "unit": "mm[Hg]", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + }, { + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "8480-6", + "display": "Systolic Blood Pressure" + } ], + "text": "Systolic Blood Pressure" + }, + "valueQuantity": { + "value": 136, + "unit": "mm[Hg]", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + } ] + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, { + "fullUrl": "urn:uuid:f6ccd623-34da-a519-12b3-b45d1e158bbe", + "resource": { + "resourceType": "DiagnosticReport", + "id": "f6ccd623-34da-a519-12b3-b45d1e158bbe", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-note" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:898b54a4-9d8d-1966-3853-601d71f30339" + }, + "effectiveDateTime": "2010-03-06T11:44:52-05:00", + "issued": "2010-03-06T11:44:52.558-05:00", + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } ], + "presentedForm": [ { + "contentType": "text/plain; charset=utf-8", + "data": "CjIwMTAtMDMtMDYKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgNTkgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuIFBhdGllbnQgaGFzIGEgaGlzdG9yeSBvZiBhY3V0ZSB2aXJhbCBwaGFyeW5naXRpcyAoZGlzb3JkZXIpLgoKIyBTb2NpYWwgSGlzdG9yeQpQYXRpZW50IGlzIG1hcnJpZWQuIFBhdGllbnQgaXMgYW4gYWN0aXZlIHNtb2tlciBhbmQgaXMgYW4gYWxjb2hvbGljLgogUGF0aWVudCBpZGVudGlmaWVzIGFzIGhldGVyb3NleHVhbC4KClBhdGllbnQgY29tZXMgZnJvbSBhIG1pZGRsZSBzb2Npb2Vjb25vbWljIGJhY2tncm91bmQuCiBQYXRpZW50IGhhcyBjb21wbGV0ZWQgc29tZSBjb2xsZWdlIGNvdXJzZXMuClBhdGllbnQgY3VycmVudGx5IGhhcyBIdW1hbmEuCgojIEFsbGVyZ2llcwpObyBLbm93biBBbGxlcmdpZXMuCgojIE1lZGljYXRpb25zCk5vIEFjdGl2ZSBNZWRpY2F0aW9ucy4KCiMgQXNzZXNzbWVudCBhbmQgUGxhbgoKCiMjIFBsYW4KCg==" + } ] + }, + "request": { + "method": "POST", + "url": "DiagnosticReport" + } + }, { + "fullUrl": "urn:uuid:b3f4ec9a-dc8c-a915-94d7-2ac9ea9b7ead", + "resource": { + "resourceType": "DocumentReference", + "id": "b3f4ec9a-dc8c-a915-94d7-2ac9ea9b7ead", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-documentreference" ] + }, + "identifier": [ { + "system": "urn:ietf:rfc:3986", + "value": "urn:uuid:f6ccd623-34da-a519-12b3-b45d1e158bbe" + } ], + "status": "superseded", + "type": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "category": [ { + "coding": [ { + "system": "http://hl7.org/fhir/us/core/CodeSystem/us-core-documentreference-category", + "code": "clinical-note", + "display": "Clinical Note" + } ] + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "date": "2010-03-06T11:44:52.558-05:00", + "author": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } ], + "custodian": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "content": [ { + "attachment": { + "contentType": "text/plain; charset=utf-8", + "data": "CjIwMTAtMDMtMDYKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgNTkgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuIFBhdGllbnQgaGFzIGEgaGlzdG9yeSBvZiBhY3V0ZSB2aXJhbCBwaGFyeW5naXRpcyAoZGlzb3JkZXIpLgoKIyBTb2NpYWwgSGlzdG9yeQpQYXRpZW50IGlzIG1hcnJpZWQuIFBhdGllbnQgaXMgYW4gYWN0aXZlIHNtb2tlciBhbmQgaXMgYW4gYWxjb2hvbGljLgogUGF0aWVudCBpZGVudGlmaWVzIGFzIGhldGVyb3NleHVhbC4KClBhdGllbnQgY29tZXMgZnJvbSBhIG1pZGRsZSBzb2Npb2Vjb25vbWljIGJhY2tncm91bmQuCiBQYXRpZW50IGhhcyBjb21wbGV0ZWQgc29tZSBjb2xsZWdlIGNvdXJzZXMuClBhdGllbnQgY3VycmVudGx5IGhhcyBIdW1hbmEuCgojIEFsbGVyZ2llcwpObyBLbm93biBBbGxlcmdpZXMuCgojIE1lZGljYXRpb25zCk5vIEFjdGl2ZSBNZWRpY2F0aW9ucy4KCiMgQXNzZXNzbWVudCBhbmQgUGxhbgoKCiMjIFBsYW4KCg==" + }, + "format": { + "system": "http://ihe.net/fhir/ValueSet/IHE.FormatCode.codesystem", + "code": "urn:ihe:iti:xds:2017:mimeTypeSufficient", + "display": "mimeType Sufficient" + } + } ], + "context": { + "encounter": [ { + "reference": "urn:uuid:898b54a4-9d8d-1966-3853-601d71f30339" + } ], + "period": { + "start": "2010-03-06T11:44:52-05:00", + "end": "2010-03-06T11:59:52-05:00" + } + } + }, + "request": { + "method": "POST", + "url": "DocumentReference" + } + }, { + "fullUrl": "urn:uuid:2002e647-c928-c1ff-dc76-ed697dabf86a", + "resource": { + "resourceType": "Claim", + "id": "2002e647-c928-c1ff-dc76-ed697dabf86a", + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Lindsay928 Gerlach374" + }, + "billablePeriod": { + "start": "2010-03-06T11:44:52-05:00", + "end": "2010-03-06T11:59:52-05:00" + }, + "created": "2010-03-06T11:59:52-05:00", + "provider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "priority": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } ] + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "insurance": [ { + "sequence": 1, + "focal": true, + "coverage": { + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "1234", + "display": "SNOMED Code" + } ], + "text": "SNOMED Code" + }, + "encounter": [ { + "reference": "urn:uuid:898b54a4-9d8d-1966-3853-601d71f30339" + } ] + } ], + "total": { + "value": 129.16, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, { + "fullUrl": "urn:uuid:7a54c7e3-1fae-8421-8379-827abdb71aa6", + "resource": { + "resourceType": "ExplanationOfBenefit", + "id": "7a54c7e3-1fae-8421-8379-827abdb71aa6", + "contained": [ { + "resourceType": "ServiceRequest", + "id": "referral", + "status": "completed", + "intent": "order", + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "requester": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + } ] + }, { + "resourceType": "Coverage", + "id": "coverage", + "status": "active", + "type": { + "text": "Humana" + }, + "beneficiary": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "payor": [ { + "display": "Humana" + } ] + } ], + "identifier": [ { + "system": "https://bluebutton.cms.gov/resources/variables/clm_id", + "value": "2002e647-c928-c1ff-dc76-ed697dabf86a" + }, { + "system": "https://bluebutton.cms.gov/resources/identifier/claim-group", + "value": "99999999999" + } ], + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "billablePeriod": { + "start": "2010-03-06T11:59:52-05:00", + "end": "2011-03-06T11:59:52-05:00" + }, + "created": "2010-03-06T11:59:52-05:00", + "insurer": { + "display": "Humana" + }, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "referral": { + "reference": "#referral" + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "claim": { + "reference": "urn:uuid:2002e647-c928-c1ff-dc76-ed697dabf86a" + }, + "outcome": "complete", + "careTeam": [ { + "sequence": 1, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "role": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", + "code": "primary", + "display": "Primary Care Practitioner" + } ] + } + } ], + "insurance": [ { + "focal": true, + "coverage": { + "reference": "#coverage", + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } ] + }, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "1234", + "display": "SNOMED Code" + } ], + "text": "SNOMED Code" + }, + "servicedPeriod": { + "start": "2010-03-06T11:44:52-05:00", + "end": "2010-03-06T11:59:52-05:00" + }, + "locationCodeableConcept": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "21", + "display": "Inpatient Hospital" + } ] + }, + "encounter": [ { + "reference": "urn:uuid:898b54a4-9d8d-1966-3853-601d71f30339" + } ] + } ], + "total": [ { + "category": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/adjudication", + "code": "submitted", + "display": "Submitted Amount" + } ], + "text": "Submitted Amount" + }, + "amount": { + "value": 129.16, + "currency": "USD" + } + } ], + "payment": { + "amount": { + "value": 0.0, + "currency": "USD" + } + } + }, + "request": { + "method": "POST", + "url": "ExplanationOfBenefit" + } + }, { + "fullUrl": "urn:uuid:eee9b363-cf5a-31be-27f7-26297e743e08", + "resource": { + "resourceType": "Encounter", + "id": "eee9b363-cf5a-31be-27f7-26297e743e08", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter", "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter" ] + }, + "identifier": [ { + "use": "official", + "system": "https://github.com/synthetichealth/synthea", + "value": "eee9b363-cf5a-31be-27f7-26297e743e08" + } ], + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB" + }, + "type": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "1234", + "display": "SNOMED Code" + } ], + "text": "SNOMED Code" + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Mr. Lindsay928 Gerlach374" + }, + "participant": [ { + "type": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType", + "code": "PPRF", + "display": "primary performer" + } ], + "text": "primary performer" + } ], + "period": { + "start": "2010-04-05T12:44:52-04:00", + "end": "2010-04-05T12:59:52-04:00" + }, + "individual": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } + } ], + "period": { + "start": "2010-04-05T12:44:52-04:00", + "end": "2010-04-05T12:59:52-04:00" + }, + "reasonCode": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "274531002", + "display": "Abnormal findings diagnostic imaging heart+coronary circulat (finding)" + } ] + } ], + "location": [ { + "location": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + } ], + "serviceProvider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + }, + "request": { + "method": "POST", + "url": "Encounter" + } + }, { + "fullUrl": "urn:uuid:22f76f1f-a31b-369b-a454-f9b76ccdc354", + "resource": { + "resourceType": "Observation", + "id": "22f76f1f-a31b-369b-a454-f9b76ccdc354", + "meta": { + "profile": [ "http://hl7.org/fhir/StructureDefinition/bp", "http://hl7.org/fhir/StructureDefinition/vitalsigns" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "85354-9", + "display": "Blood Pressure" + } ], + "text": "Blood Pressure" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:eee9b363-cf5a-31be-27f7-26297e743e08" + }, + "effectiveInstant": "2010-04-05T12:44:52-04:00", + "issued": "2010-04-05T12:44:52.558-04:00", + "component": [ { + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "8462-4", + "display": "Diastolic Blood Pressure" + } ], + "text": "Diastolic Blood Pressure" + }, + "valueQuantity": { + "value": 49, + "unit": "mm[Hg]", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + }, { + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "8480-6", + "display": "Systolic Blood Pressure" + } ], + "text": "Systolic Blood Pressure" + }, + "valueQuantity": { + "value": 136, + "unit": "mm[Hg]", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + } ] + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, { + "fullUrl": "urn:uuid:8b68ca18-f8f8-57c1-2887-71f9ea5652ca", + "resource": { + "resourceType": "DiagnosticReport", + "id": "8b68ca18-f8f8-57c1-2887-71f9ea5652ca", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-note" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:eee9b363-cf5a-31be-27f7-26297e743e08" + }, + "effectiveDateTime": "2010-04-05T12:44:52-04:00", + "issued": "2010-04-05T12:44:52.558-04:00", + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } ], + "presentedForm": [ { + "contentType": "text/plain; charset=utf-8", + "data": "CjIwMTAtMDQtMDUKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgNTkgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuIFBhdGllbnQgaGFzIGEgaGlzdG9yeSBvZiBhY3V0ZSB2aXJhbCBwaGFyeW5naXRpcyAoZGlzb3JkZXIpLgoKIyBTb2NpYWwgSGlzdG9yeQpQYXRpZW50IGlzIG1hcnJpZWQuIFBhdGllbnQgaXMgYW4gYWN0aXZlIHNtb2tlciBhbmQgaXMgYW4gYWxjb2hvbGljLgogUGF0aWVudCBpZGVudGlmaWVzIGFzIGhldGVyb3NleHVhbC4KClBhdGllbnQgY29tZXMgZnJvbSBhIG1pZGRsZSBzb2Npb2Vjb25vbWljIGJhY2tncm91bmQuCiBQYXRpZW50IGhhcyBjb21wbGV0ZWQgc29tZSBjb2xsZWdlIGNvdXJzZXMuClBhdGllbnQgY3VycmVudGx5IGhhcyBIdW1hbmEuCgojIEFsbGVyZ2llcwpObyBLbm93biBBbGxlcmdpZXMuCgojIE1lZGljYXRpb25zCk5vIEFjdGl2ZSBNZWRpY2F0aW9ucy4KCiMgQXNzZXNzbWVudCBhbmQgUGxhbgoKCiMjIFBsYW4KCg==" + } ] + }, + "request": { + "method": "POST", + "url": "DiagnosticReport" + } + }, { + "fullUrl": "urn:uuid:5ced7191-6f20-9b81-7668-b90683c82dcb", + "resource": { + "resourceType": "DocumentReference", + "id": "5ced7191-6f20-9b81-7668-b90683c82dcb", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-documentreference" ] + }, + "identifier": [ { + "system": "urn:ietf:rfc:3986", + "value": "urn:uuid:8b68ca18-f8f8-57c1-2887-71f9ea5652ca" + } ], + "status": "superseded", + "type": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "category": [ { + "coding": [ { + "system": "http://hl7.org/fhir/us/core/CodeSystem/us-core-documentreference-category", + "code": "clinical-note", + "display": "Clinical Note" + } ] + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "date": "2010-04-05T12:44:52.558-04:00", + "author": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } ], + "custodian": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "content": [ { + "attachment": { + "contentType": "text/plain; charset=utf-8", + "data": "CjIwMTAtMDQtMDUKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgNTkgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuIFBhdGllbnQgaGFzIGEgaGlzdG9yeSBvZiBhY3V0ZSB2aXJhbCBwaGFyeW5naXRpcyAoZGlzb3JkZXIpLgoKIyBTb2NpYWwgSGlzdG9yeQpQYXRpZW50IGlzIG1hcnJpZWQuIFBhdGllbnQgaXMgYW4gYWN0aXZlIHNtb2tlciBhbmQgaXMgYW4gYWxjb2hvbGljLgogUGF0aWVudCBpZGVudGlmaWVzIGFzIGhldGVyb3NleHVhbC4KClBhdGllbnQgY29tZXMgZnJvbSBhIG1pZGRsZSBzb2Npb2Vjb25vbWljIGJhY2tncm91bmQuCiBQYXRpZW50IGhhcyBjb21wbGV0ZWQgc29tZSBjb2xsZWdlIGNvdXJzZXMuClBhdGllbnQgY3VycmVudGx5IGhhcyBIdW1hbmEuCgojIEFsbGVyZ2llcwpObyBLbm93biBBbGxlcmdpZXMuCgojIE1lZGljYXRpb25zCk5vIEFjdGl2ZSBNZWRpY2F0aW9ucy4KCiMgQXNzZXNzbWVudCBhbmQgUGxhbgoKCiMjIFBsYW4KCg==" + }, + "format": { + "system": "http://ihe.net/fhir/ValueSet/IHE.FormatCode.codesystem", + "code": "urn:ihe:iti:xds:2017:mimeTypeSufficient", + "display": "mimeType Sufficient" + } + } ], + "context": { + "encounter": [ { + "reference": "urn:uuid:eee9b363-cf5a-31be-27f7-26297e743e08" + } ], + "period": { + "start": "2010-04-05T12:44:52-04:00", + "end": "2010-04-05T12:59:52-04:00" + } + } + }, + "request": { + "method": "POST", + "url": "DocumentReference" + } + }, { + "fullUrl": "urn:uuid:deb90be0-64d4-2db8-68a6-f72c52f576c2", + "resource": { + "resourceType": "Claim", + "id": "deb90be0-64d4-2db8-68a6-f72c52f576c2", + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Lindsay928 Gerlach374" + }, + "billablePeriod": { + "start": "2010-04-05T12:44:52-04:00", + "end": "2010-04-05T12:59:52-04:00" + }, + "created": "2010-04-05T12:59:52-04:00", + "provider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "priority": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } ] + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "insurance": [ { + "sequence": 1, + "focal": true, + "coverage": { + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "1234", + "display": "SNOMED Code" + } ], + "text": "SNOMED Code" + }, + "encounter": [ { + "reference": "urn:uuid:eee9b363-cf5a-31be-27f7-26297e743e08" + } ] + } ], + "total": { + "value": 129.16, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, { + "fullUrl": "urn:uuid:fc98ac86-ce40-c454-4b99-b724019a9341", + "resource": { + "resourceType": "ExplanationOfBenefit", + "id": "fc98ac86-ce40-c454-4b99-b724019a9341", + "contained": [ { + "resourceType": "ServiceRequest", + "id": "referral", + "status": "completed", + "intent": "order", + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "requester": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + } ] + }, { + "resourceType": "Coverage", + "id": "coverage", + "status": "active", + "type": { + "text": "Humana" + }, + "beneficiary": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "payor": [ { + "display": "Humana" + } ] + } ], + "identifier": [ { + "system": "https://bluebutton.cms.gov/resources/variables/clm_id", + "value": "deb90be0-64d4-2db8-68a6-f72c52f576c2" + }, { + "system": "https://bluebutton.cms.gov/resources/identifier/claim-group", + "value": "99999999999" + } ], + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "billablePeriod": { + "start": "2010-04-05T12:59:52-04:00", + "end": "2011-04-05T12:59:52-04:00" + }, + "created": "2010-04-05T12:59:52-04:00", + "insurer": { + "display": "Humana" + }, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "referral": { + "reference": "#referral" + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "claim": { + "reference": "urn:uuid:deb90be0-64d4-2db8-68a6-f72c52f576c2" + }, + "outcome": "complete", + "careTeam": [ { + "sequence": 1, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "role": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", + "code": "primary", + "display": "Primary Care Practitioner" + } ] + } + } ], + "insurance": [ { + "focal": true, + "coverage": { + "reference": "#coverage", + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } ] + }, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "1234", + "display": "SNOMED Code" + } ], + "text": "SNOMED Code" + }, + "servicedPeriod": { + "start": "2010-04-05T12:44:52-04:00", + "end": "2010-04-05T12:59:52-04:00" + }, + "locationCodeableConcept": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "21", + "display": "Inpatient Hospital" + } ] + }, + "encounter": [ { + "reference": "urn:uuid:eee9b363-cf5a-31be-27f7-26297e743e08" + } ] + } ], + "total": [ { + "category": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/adjudication", + "code": "submitted", + "display": "Submitted Amount" + } ], + "text": "Submitted Amount" + }, + "amount": { + "value": 129.16, + "currency": "USD" + } + } ], + "payment": { + "amount": { + "value": 0.0, + "currency": "USD" + } + } + }, + "request": { + "method": "POST", + "url": "ExplanationOfBenefit" + } + }, { + "fullUrl": "urn:uuid:2fe2f583-b221-4816-588c-d984a5f20c6a", + "resource": { + "resourceType": "Encounter", + "id": "2fe2f583-b221-4816-588c-d984a5f20c6a", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter", "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter" ] + }, + "identifier": [ { + "use": "official", + "system": "https://github.com/synthetichealth/synthea", + "value": "2fe2f583-b221-4816-588c-d984a5f20c6a" + } ], + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB" + }, + "type": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "1234", + "display": "SNOMED Code" + } ], + "text": "SNOMED Code" + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Mr. Lindsay928 Gerlach374" + }, + "participant": [ { + "type": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType", + "code": "PPRF", + "display": "primary performer" + } ], + "text": "primary performer" + } ], + "period": { + "start": "2010-07-04T12:44:52-04:00", + "end": "2010-07-04T12:59:52-04:00" + }, + "individual": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } + } ], + "period": { + "start": "2010-07-04T12:44:52-04:00", + "end": "2010-07-04T12:59:52-04:00" + }, + "reasonCode": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "274531002", + "display": "Abnormal findings diagnostic imaging heart+coronary circulat (finding)" + } ] + } ], + "location": [ { + "location": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + } ], + "serviceProvider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + }, + "request": { + "method": "POST", + "url": "Encounter" + } + }, { + "fullUrl": "urn:uuid:da3879e6-dea8-c599-7a02-cb7d55fb9190", + "resource": { + "resourceType": "Observation", + "id": "da3879e6-dea8-c599-7a02-cb7d55fb9190", + "meta": { + "profile": [ "http://hl7.org/fhir/StructureDefinition/bp", "http://hl7.org/fhir/StructureDefinition/vitalsigns" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "85354-9", + "display": "Blood Pressure" + } ], + "text": "Blood Pressure" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:2fe2f583-b221-4816-588c-d984a5f20c6a" + }, + "effectiveInstant": "2010-07-04T12:44:52-04:00", + "issued": "2010-07-04T12:44:52.558-04:00", + "component": [ { + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "8462-4", + "display": "Diastolic Blood Pressure" + } ], + "text": "Diastolic Blood Pressure" + }, + "valueQuantity": { + "value": 49, + "unit": "mm[Hg]", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + }, { + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "8480-6", + "display": "Systolic Blood Pressure" + } ], + "text": "Systolic Blood Pressure" + }, + "valueQuantity": { + "value": 136, + "unit": "mm[Hg]", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + } ] + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, { + "fullUrl": "urn:uuid:6e4f35a4-653c-ea92-f956-f4bcf95e011d", + "resource": { + "resourceType": "DiagnosticReport", + "id": "6e4f35a4-653c-ea92-f956-f4bcf95e011d", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-note" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:2fe2f583-b221-4816-588c-d984a5f20c6a" + }, + "effectiveDateTime": "2010-07-04T12:44:52-04:00", + "issued": "2010-07-04T12:44:52.558-04:00", + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } ], + "presentedForm": [ { + "contentType": "text/plain; charset=utf-8", + "data": "CjIwMTAtMDctMDQKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgNTkgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuIFBhdGllbnQgaGFzIGEgaGlzdG9yeSBvZiBhY3V0ZSB2aXJhbCBwaGFyeW5naXRpcyAoZGlzb3JkZXIpLgoKIyBTb2NpYWwgSGlzdG9yeQpQYXRpZW50IGlzIG1hcnJpZWQuIFBhdGllbnQgaXMgYW4gYWN0aXZlIHNtb2tlciBhbmQgaXMgYW4gYWxjb2hvbGljLgogUGF0aWVudCBpZGVudGlmaWVzIGFzIGhldGVyb3NleHVhbC4KClBhdGllbnQgY29tZXMgZnJvbSBhIG1pZGRsZSBzb2Npb2Vjb25vbWljIGJhY2tncm91bmQuCiBQYXRpZW50IGhhcyBjb21wbGV0ZWQgc29tZSBjb2xsZWdlIGNvdXJzZXMuClBhdGllbnQgY3VycmVudGx5IGhhcyBIdW1hbmEuCgojIEFsbGVyZ2llcwpObyBLbm93biBBbGxlcmdpZXMuCgojIE1lZGljYXRpb25zCk5vIEFjdGl2ZSBNZWRpY2F0aW9ucy4KCiMgQXNzZXNzbWVudCBhbmQgUGxhbgoKCiMjIFBsYW4KCg==" + } ] + }, + "request": { + "method": "POST", + "url": "DiagnosticReport" + } + }, { + "fullUrl": "urn:uuid:cb5d2eab-2a04-9358-9f44-90b39de69bb5", + "resource": { + "resourceType": "DocumentReference", + "id": "cb5d2eab-2a04-9358-9f44-90b39de69bb5", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-documentreference" ] + }, + "identifier": [ { + "system": "urn:ietf:rfc:3986", + "value": "urn:uuid:6e4f35a4-653c-ea92-f956-f4bcf95e011d" + } ], + "status": "superseded", + "type": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "category": [ { + "coding": [ { + "system": "http://hl7.org/fhir/us/core/CodeSystem/us-core-documentreference-category", + "code": "clinical-note", + "display": "Clinical Note" + } ] + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "date": "2010-07-04T12:44:52.558-04:00", + "author": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } ], + "custodian": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "content": [ { + "attachment": { + "contentType": "text/plain; charset=utf-8", + "data": "CjIwMTAtMDctMDQKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgNTkgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuIFBhdGllbnQgaGFzIGEgaGlzdG9yeSBvZiBhY3V0ZSB2aXJhbCBwaGFyeW5naXRpcyAoZGlzb3JkZXIpLgoKIyBTb2NpYWwgSGlzdG9yeQpQYXRpZW50IGlzIG1hcnJpZWQuIFBhdGllbnQgaXMgYW4gYWN0aXZlIHNtb2tlciBhbmQgaXMgYW4gYWxjb2hvbGljLgogUGF0aWVudCBpZGVudGlmaWVzIGFzIGhldGVyb3NleHVhbC4KClBhdGllbnQgY29tZXMgZnJvbSBhIG1pZGRsZSBzb2Npb2Vjb25vbWljIGJhY2tncm91bmQuCiBQYXRpZW50IGhhcyBjb21wbGV0ZWQgc29tZSBjb2xsZWdlIGNvdXJzZXMuClBhdGllbnQgY3VycmVudGx5IGhhcyBIdW1hbmEuCgojIEFsbGVyZ2llcwpObyBLbm93biBBbGxlcmdpZXMuCgojIE1lZGljYXRpb25zCk5vIEFjdGl2ZSBNZWRpY2F0aW9ucy4KCiMgQXNzZXNzbWVudCBhbmQgUGxhbgoKCiMjIFBsYW4KCg==" + }, + "format": { + "system": "http://ihe.net/fhir/ValueSet/IHE.FormatCode.codesystem", + "code": "urn:ihe:iti:xds:2017:mimeTypeSufficient", + "display": "mimeType Sufficient" + } + } ], + "context": { + "encounter": [ { + "reference": "urn:uuid:2fe2f583-b221-4816-588c-d984a5f20c6a" + } ], + "period": { + "start": "2010-07-04T12:44:52-04:00", + "end": "2010-07-04T12:59:52-04:00" + } + } + }, + "request": { + "method": "POST", + "url": "DocumentReference" + } + }, { + "fullUrl": "urn:uuid:dc639336-0193-2ca7-6865-66ffce25c59b", + "resource": { + "resourceType": "Claim", + "id": "dc639336-0193-2ca7-6865-66ffce25c59b", + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Lindsay928 Gerlach374" + }, + "billablePeriod": { + "start": "2010-07-04T12:44:52-04:00", + "end": "2010-07-04T12:59:52-04:00" + }, + "created": "2010-07-04T12:59:52-04:00", + "provider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "priority": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } ] + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "insurance": [ { + "sequence": 1, + "focal": true, + "coverage": { + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "1234", + "display": "SNOMED Code" + } ], + "text": "SNOMED Code" + }, + "encounter": [ { + "reference": "urn:uuid:2fe2f583-b221-4816-588c-d984a5f20c6a" + } ] + } ], + "total": { + "value": 129.16, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, { + "fullUrl": "urn:uuid:4edce961-2c41-eda0-27ff-172136cbfa54", + "resource": { + "resourceType": "ExplanationOfBenefit", + "id": "4edce961-2c41-eda0-27ff-172136cbfa54", + "contained": [ { + "resourceType": "ServiceRequest", + "id": "referral", + "status": "completed", + "intent": "order", + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "requester": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + } ] + }, { + "resourceType": "Coverage", + "id": "coverage", + "status": "active", + "type": { + "text": "Humana" + }, + "beneficiary": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "payor": [ { + "display": "Humana" + } ] + } ], + "identifier": [ { + "system": "https://bluebutton.cms.gov/resources/variables/clm_id", + "value": "dc639336-0193-2ca7-6865-66ffce25c59b" + }, { + "system": "https://bluebutton.cms.gov/resources/identifier/claim-group", + "value": "99999999999" + } ], + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "billablePeriod": { + "start": "2010-07-04T12:59:52-04:00", + "end": "2011-07-04T12:59:52-04:00" + }, + "created": "2010-07-04T12:59:52-04:00", + "insurer": { + "display": "Humana" + }, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "referral": { + "reference": "#referral" + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "claim": { + "reference": "urn:uuid:dc639336-0193-2ca7-6865-66ffce25c59b" + }, + "outcome": "complete", + "careTeam": [ { + "sequence": 1, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "role": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", + "code": "primary", + "display": "Primary Care Practitioner" + } ] + } + } ], + "insurance": [ { + "focal": true, + "coverage": { + "reference": "#coverage", + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } ] + }, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "1234", + "display": "SNOMED Code" + } ], + "text": "SNOMED Code" + }, + "servicedPeriod": { + "start": "2010-07-04T12:44:52-04:00", + "end": "2010-07-04T12:59:52-04:00" + }, + "locationCodeableConcept": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "21", + "display": "Inpatient Hospital" + } ] + }, + "encounter": [ { + "reference": "urn:uuid:2fe2f583-b221-4816-588c-d984a5f20c6a" + } ] + } ], + "total": [ { + "category": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/adjudication", + "code": "submitted", + "display": "Submitted Amount" + } ], + "text": "Submitted Amount" + }, + "amount": { + "value": 129.16, + "currency": "USD" + } + } ], + "payment": { + "amount": { + "value": 0.0, + "currency": "USD" + } + } + }, + "request": { + "method": "POST", + "url": "ExplanationOfBenefit" + } + }, { + "fullUrl": "urn:uuid:516623ff-7854-2e13-35ac-eb6f3c6fd689", + "resource": { + "resourceType": "Encounter", + "id": "516623ff-7854-2e13-35ac-eb6f3c6fd689", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter", "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter" ] + }, + "identifier": [ { + "use": "official", + "system": "https://github.com/synthetichealth/synthea", + "value": "516623ff-7854-2e13-35ac-eb6f3c6fd689" + } ], + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB" + }, + "type": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "1234", + "display": "SNOMED Code" + } ], + "text": "SNOMED Code" + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Mr. Lindsay928 Gerlach374" + }, + "participant": [ { + "type": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType", + "code": "PPRF", + "display": "primary performer" + } ], + "text": "primary performer" + } ], + "period": { + "start": "2010-10-02T12:44:52-04:00", + "end": "2010-10-02T12:59:52-04:00" + }, + "individual": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } + } ], + "period": { + "start": "2010-10-02T12:44:52-04:00", + "end": "2010-10-02T12:59:52-04:00" + }, + "reasonCode": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "274531002", + "display": "Abnormal findings diagnostic imaging heart+coronary circulat (finding)" + } ] + } ], + "location": [ { + "location": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + } ], + "serviceProvider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + }, + "request": { + "method": "POST", + "url": "Encounter" + } + }, { + "fullUrl": "urn:uuid:1c23b0aa-7214-5d01-a8df-674d1a905c31", + "resource": { + "resourceType": "Observation", + "id": "1c23b0aa-7214-5d01-a8df-674d1a905c31", + "meta": { + "profile": [ "http://hl7.org/fhir/StructureDefinition/bp", "http://hl7.org/fhir/StructureDefinition/vitalsigns" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "85354-9", + "display": "Blood Pressure" + } ], + "text": "Blood Pressure" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:516623ff-7854-2e13-35ac-eb6f3c6fd689" + }, + "effectiveInstant": "2010-10-02T12:44:52-04:00", + "issued": "2010-10-02T12:44:52.558-04:00", + "component": [ { + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "8462-4", + "display": "Diastolic Blood Pressure" + } ], + "text": "Diastolic Blood Pressure" + }, + "valueQuantity": { + "value": 49, + "unit": "mm[Hg]", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + }, { + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "8480-6", + "display": "Systolic Blood Pressure" + } ], + "text": "Systolic Blood Pressure" + }, + "valueQuantity": { + "value": 136, + "unit": "mm[Hg]", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + } ] + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, { + "fullUrl": "urn:uuid:3720d31b-0feb-5b5c-3f0a-049f3c34d4ef", + "resource": { + "resourceType": "DiagnosticReport", + "id": "3720d31b-0feb-5b5c-3f0a-049f3c34d4ef", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-note" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:516623ff-7854-2e13-35ac-eb6f3c6fd689" + }, + "effectiveDateTime": "2010-10-02T12:44:52-04:00", + "issued": "2010-10-02T12:44:52.558-04:00", + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } ], + "presentedForm": [ { + "contentType": "text/plain; charset=utf-8", + "data": "CjIwMTAtMTAtMDIKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgNTkgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuIFBhdGllbnQgaGFzIGEgaGlzdG9yeSBvZiBhY3V0ZSB2aXJhbCBwaGFyeW5naXRpcyAoZGlzb3JkZXIpLgoKIyBTb2NpYWwgSGlzdG9yeQpQYXRpZW50IGlzIG1hcnJpZWQuIFBhdGllbnQgaXMgYW4gYWN0aXZlIHNtb2tlciBhbmQgaXMgYW4gYWxjb2hvbGljLgogUGF0aWVudCBpZGVudGlmaWVzIGFzIGhldGVyb3NleHVhbC4KClBhdGllbnQgY29tZXMgZnJvbSBhIG1pZGRsZSBzb2Npb2Vjb25vbWljIGJhY2tncm91bmQuCiBQYXRpZW50IGhhcyBjb21wbGV0ZWQgc29tZSBjb2xsZWdlIGNvdXJzZXMuClBhdGllbnQgY3VycmVudGx5IGhhcyBIdW1hbmEuCgojIEFsbGVyZ2llcwpObyBLbm93biBBbGxlcmdpZXMuCgojIE1lZGljYXRpb25zCk5vIEFjdGl2ZSBNZWRpY2F0aW9ucy4KCiMgQXNzZXNzbWVudCBhbmQgUGxhbgoKCiMjIFBsYW4KCg==" + } ] + }, + "request": { + "method": "POST", + "url": "DiagnosticReport" + } + }, { + "fullUrl": "urn:uuid:47f8e1bb-804c-3f10-19ea-d478d8bdf6b8", + "resource": { + "resourceType": "DocumentReference", + "id": "47f8e1bb-804c-3f10-19ea-d478d8bdf6b8", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-documentreference" ] + }, + "identifier": [ { + "system": "urn:ietf:rfc:3986", + "value": "urn:uuid:3720d31b-0feb-5b5c-3f0a-049f3c34d4ef" + } ], + "status": "superseded", + "type": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "category": [ { + "coding": [ { + "system": "http://hl7.org/fhir/us/core/CodeSystem/us-core-documentreference-category", + "code": "clinical-note", + "display": "Clinical Note" + } ] + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "date": "2010-10-02T12:44:52.558-04:00", + "author": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } ], + "custodian": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "content": [ { + "attachment": { + "contentType": "text/plain; charset=utf-8", + "data": "CjIwMTAtMTAtMDIKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgNTkgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuIFBhdGllbnQgaGFzIGEgaGlzdG9yeSBvZiBhY3V0ZSB2aXJhbCBwaGFyeW5naXRpcyAoZGlzb3JkZXIpLgoKIyBTb2NpYWwgSGlzdG9yeQpQYXRpZW50IGlzIG1hcnJpZWQuIFBhdGllbnQgaXMgYW4gYWN0aXZlIHNtb2tlciBhbmQgaXMgYW4gYWxjb2hvbGljLgogUGF0aWVudCBpZGVudGlmaWVzIGFzIGhldGVyb3NleHVhbC4KClBhdGllbnQgY29tZXMgZnJvbSBhIG1pZGRsZSBzb2Npb2Vjb25vbWljIGJhY2tncm91bmQuCiBQYXRpZW50IGhhcyBjb21wbGV0ZWQgc29tZSBjb2xsZWdlIGNvdXJzZXMuClBhdGllbnQgY3VycmVudGx5IGhhcyBIdW1hbmEuCgojIEFsbGVyZ2llcwpObyBLbm93biBBbGxlcmdpZXMuCgojIE1lZGljYXRpb25zCk5vIEFjdGl2ZSBNZWRpY2F0aW9ucy4KCiMgQXNzZXNzbWVudCBhbmQgUGxhbgoKCiMjIFBsYW4KCg==" + }, + "format": { + "system": "http://ihe.net/fhir/ValueSet/IHE.FormatCode.codesystem", + "code": "urn:ihe:iti:xds:2017:mimeTypeSufficient", + "display": "mimeType Sufficient" + } + } ], + "context": { + "encounter": [ { + "reference": "urn:uuid:516623ff-7854-2e13-35ac-eb6f3c6fd689" + } ], + "period": { + "start": "2010-10-02T12:44:52-04:00", + "end": "2010-10-02T12:59:52-04:00" + } + } + }, + "request": { + "method": "POST", + "url": "DocumentReference" + } + }, { + "fullUrl": "urn:uuid:bcff377a-b46a-c246-41de-f71782922eb8", + "resource": { + "resourceType": "Claim", + "id": "bcff377a-b46a-c246-41de-f71782922eb8", + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Lindsay928 Gerlach374" + }, + "billablePeriod": { + "start": "2010-10-02T12:44:52-04:00", + "end": "2010-10-02T12:59:52-04:00" + }, + "created": "2010-10-02T12:59:52-04:00", + "provider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "priority": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } ] + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "insurance": [ { + "sequence": 1, + "focal": true, + "coverage": { + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "1234", + "display": "SNOMED Code" + } ], + "text": "SNOMED Code" + }, + "encounter": [ { + "reference": "urn:uuid:516623ff-7854-2e13-35ac-eb6f3c6fd689" + } ] + } ], + "total": { + "value": 129.16, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, { + "fullUrl": "urn:uuid:1a13eee1-0552-e2e6-aff2-1f156b893676", + "resource": { + "resourceType": "ExplanationOfBenefit", + "id": "1a13eee1-0552-e2e6-aff2-1f156b893676", + "contained": [ { + "resourceType": "ServiceRequest", + "id": "referral", + "status": "completed", + "intent": "order", + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "requester": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + } ] + }, { + "resourceType": "Coverage", + "id": "coverage", + "status": "active", + "type": { + "text": "Humana" + }, + "beneficiary": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "payor": [ { + "display": "Humana" + } ] + } ], + "identifier": [ { + "system": "https://bluebutton.cms.gov/resources/variables/clm_id", + "value": "bcff377a-b46a-c246-41de-f71782922eb8" + }, { + "system": "https://bluebutton.cms.gov/resources/identifier/claim-group", + "value": "99999999999" + } ], + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "billablePeriod": { + "start": "2010-10-02T12:59:52-04:00", + "end": "2011-10-02T12:59:52-04:00" + }, + "created": "2010-10-02T12:59:52-04:00", + "insurer": { + "display": "Humana" + }, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "referral": { + "reference": "#referral" + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "claim": { + "reference": "urn:uuid:bcff377a-b46a-c246-41de-f71782922eb8" + }, + "outcome": "complete", + "careTeam": [ { + "sequence": 1, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "role": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", + "code": "primary", + "display": "Primary Care Practitioner" + } ] + } + } ], + "insurance": [ { + "focal": true, + "coverage": { + "reference": "#coverage", + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } ] + }, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "1234", + "display": "SNOMED Code" + } ], + "text": "SNOMED Code" + }, + "servicedPeriod": { + "start": "2010-10-02T12:44:52-04:00", + "end": "2010-10-02T12:59:52-04:00" + }, + "locationCodeableConcept": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "21", + "display": "Inpatient Hospital" + } ] + }, + "encounter": [ { + "reference": "urn:uuid:516623ff-7854-2e13-35ac-eb6f3c6fd689" + } ] + } ], + "total": [ { + "category": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/adjudication", + "code": "submitted", + "display": "Submitted Amount" + } ], + "text": "Submitted Amount" + }, + "amount": { + "value": 129.16, + "currency": "USD" + } + } ], + "payment": { + "amount": { + "value": 0.0, + "currency": "USD" + } + } + }, + "request": { + "method": "POST", + "url": "ExplanationOfBenefit" + } + }, { + "fullUrl": "urn:uuid:77a0ba61-b55c-765e-7386-93d73a995735", + "resource": { + "resourceType": "Encounter", + "id": "77a0ba61-b55c-765e-7386-93d73a995735", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter", "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter" ] + }, + "identifier": [ { + "use": "official", + "system": "https://github.com/synthetichealth/synthea", + "value": "77a0ba61-b55c-765e-7386-93d73a995735" + } ], + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB" + }, + "type": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "1234", + "display": "SNOMED Code" + } ], + "text": "SNOMED Code" + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Mr. Lindsay928 Gerlach374" + }, + "participant": [ { + "type": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType", + "code": "PPRF", + "display": "primary performer" + } ], + "text": "primary performer" + } ], + "period": { + "start": "2010-12-31T11:44:52-05:00", + "end": "2010-12-31T11:59:52-05:00" + }, + "individual": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } + } ], + "period": { + "start": "2010-12-31T11:44:52-05:00", + "end": "2010-12-31T11:59:52-05:00" + }, + "reasonCode": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "274531002", + "display": "Abnormal findings diagnostic imaging heart+coronary circulat (finding)" + } ] + } ], + "location": [ { + "location": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + } ], + "serviceProvider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + }, + "request": { + "method": "POST", + "url": "Encounter" + } + }, { + "fullUrl": "urn:uuid:001a6df5-ee5d-b5a2-e356-6748998aff9d", + "resource": { + "resourceType": "Observation", + "id": "001a6df5-ee5d-b5a2-e356-6748998aff9d", + "meta": { + "profile": [ "http://hl7.org/fhir/StructureDefinition/bp", "http://hl7.org/fhir/StructureDefinition/vitalsigns" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "85354-9", + "display": "Blood Pressure" + } ], + "text": "Blood Pressure" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:77a0ba61-b55c-765e-7386-93d73a995735" + }, + "effectiveInstant": "2010-12-31T11:44:52-05:00", + "issued": "2010-12-31T11:44:52.558-05:00", + "component": [ { + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "8462-4", + "display": "Diastolic Blood Pressure" + } ], + "text": "Diastolic Blood Pressure" + }, + "valueQuantity": { + "value": 49, + "unit": "mm[Hg]", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + }, { + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "8480-6", + "display": "Systolic Blood Pressure" + } ], + "text": "Systolic Blood Pressure" + }, + "valueQuantity": { + "value": 136, + "unit": "mm[Hg]", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + } ] + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, { + "fullUrl": "urn:uuid:c9190de8-51ac-0573-3865-d2cc369d8f9a", + "resource": { + "resourceType": "DiagnosticReport", + "id": "c9190de8-51ac-0573-3865-d2cc369d8f9a", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-note" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:77a0ba61-b55c-765e-7386-93d73a995735" + }, + "effectiveDateTime": "2010-12-31T11:44:52-05:00", + "issued": "2010-12-31T11:44:52.558-05:00", + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } ], + "presentedForm": [ { + "contentType": "text/plain; charset=utf-8", + "data": "CjIwMTAtMTItMzEKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgNjAgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuIFBhdGllbnQgaGFzIGEgaGlzdG9yeSBvZiBhY3V0ZSB2aXJhbCBwaGFyeW5naXRpcyAoZGlzb3JkZXIpLgoKIyBTb2NpYWwgSGlzdG9yeQpQYXRpZW50IGlzIG1hcnJpZWQuIFBhdGllbnQgaXMgYW4gYWN0aXZlIHNtb2tlciBhbmQgaXMgYW4gYWxjb2hvbGljLgogUGF0aWVudCBpZGVudGlmaWVzIGFzIGhldGVyb3NleHVhbC4KClBhdGllbnQgY29tZXMgZnJvbSBhIG1pZGRsZSBzb2Npb2Vjb25vbWljIGJhY2tncm91bmQuCiBQYXRpZW50IGhhcyBjb21wbGV0ZWQgc29tZSBjb2xsZWdlIGNvdXJzZXMuClBhdGllbnQgY3VycmVudGx5IGhhcyBIdW1hbmEuCgojIEFsbGVyZ2llcwpObyBLbm93biBBbGxlcmdpZXMuCgojIE1lZGljYXRpb25zCk5vIEFjdGl2ZSBNZWRpY2F0aW9ucy4KCiMgQXNzZXNzbWVudCBhbmQgUGxhbgoKCiMjIFBsYW4KCg==" + } ] + }, + "request": { + "method": "POST", + "url": "DiagnosticReport" + } + }, { + "fullUrl": "urn:uuid:43e176ec-da2a-7ee2-2e89-ef6f0f527e84", + "resource": { + "resourceType": "DocumentReference", + "id": "43e176ec-da2a-7ee2-2e89-ef6f0f527e84", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-documentreference" ] + }, + "identifier": [ { + "system": "urn:ietf:rfc:3986", + "value": "urn:uuid:c9190de8-51ac-0573-3865-d2cc369d8f9a" + } ], + "status": "superseded", + "type": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "category": [ { + "coding": [ { + "system": "http://hl7.org/fhir/us/core/CodeSystem/us-core-documentreference-category", + "code": "clinical-note", + "display": "Clinical Note" + } ] + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "date": "2010-12-31T11:44:52.558-05:00", + "author": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } ], + "custodian": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "content": [ { + "attachment": { + "contentType": "text/plain; charset=utf-8", + "data": "CjIwMTAtMTItMzEKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgNjAgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuIFBhdGllbnQgaGFzIGEgaGlzdG9yeSBvZiBhY3V0ZSB2aXJhbCBwaGFyeW5naXRpcyAoZGlzb3JkZXIpLgoKIyBTb2NpYWwgSGlzdG9yeQpQYXRpZW50IGlzIG1hcnJpZWQuIFBhdGllbnQgaXMgYW4gYWN0aXZlIHNtb2tlciBhbmQgaXMgYW4gYWxjb2hvbGljLgogUGF0aWVudCBpZGVudGlmaWVzIGFzIGhldGVyb3NleHVhbC4KClBhdGllbnQgY29tZXMgZnJvbSBhIG1pZGRsZSBzb2Npb2Vjb25vbWljIGJhY2tncm91bmQuCiBQYXRpZW50IGhhcyBjb21wbGV0ZWQgc29tZSBjb2xsZWdlIGNvdXJzZXMuClBhdGllbnQgY3VycmVudGx5IGhhcyBIdW1hbmEuCgojIEFsbGVyZ2llcwpObyBLbm93biBBbGxlcmdpZXMuCgojIE1lZGljYXRpb25zCk5vIEFjdGl2ZSBNZWRpY2F0aW9ucy4KCiMgQXNzZXNzbWVudCBhbmQgUGxhbgoKCiMjIFBsYW4KCg==" + }, + "format": { + "system": "http://ihe.net/fhir/ValueSet/IHE.FormatCode.codesystem", + "code": "urn:ihe:iti:xds:2017:mimeTypeSufficient", + "display": "mimeType Sufficient" + } + } ], + "context": { + "encounter": [ { + "reference": "urn:uuid:77a0ba61-b55c-765e-7386-93d73a995735" + } ], + "period": { + "start": "2010-12-31T11:44:52-05:00", + "end": "2010-12-31T11:59:52-05:00" + } + } + }, + "request": { + "method": "POST", + "url": "DocumentReference" + } + }, { + "fullUrl": "urn:uuid:fb58f377-1699-fc17-80a6-3d5d15423f80", + "resource": { + "resourceType": "Claim", + "id": "fb58f377-1699-fc17-80a6-3d5d15423f80", + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Lindsay928 Gerlach374" + }, + "billablePeriod": { + "start": "2010-12-31T11:44:52-05:00", + "end": "2010-12-31T11:59:52-05:00" + }, + "created": "2010-12-31T11:59:52-05:00", + "provider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "priority": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } ] + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "insurance": [ { + "sequence": 1, + "focal": true, + "coverage": { + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "1234", + "display": "SNOMED Code" + } ], + "text": "SNOMED Code" + }, + "encounter": [ { + "reference": "urn:uuid:77a0ba61-b55c-765e-7386-93d73a995735" + } ] + } ], + "total": { + "value": 129.16, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, { + "fullUrl": "urn:uuid:4c0c524b-0b56-ad4e-31f6-ae95de308825", + "resource": { + "resourceType": "ExplanationOfBenefit", + "id": "4c0c524b-0b56-ad4e-31f6-ae95de308825", + "contained": [ { + "resourceType": "ServiceRequest", + "id": "referral", + "status": "completed", + "intent": "order", + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "requester": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + } ] + }, { + "resourceType": "Coverage", + "id": "coverage", + "status": "active", + "type": { + "text": "Humana" + }, + "beneficiary": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "payor": [ { + "display": "Humana" + } ] + } ], + "identifier": [ { + "system": "https://bluebutton.cms.gov/resources/variables/clm_id", + "value": "fb58f377-1699-fc17-80a6-3d5d15423f80" + }, { + "system": "https://bluebutton.cms.gov/resources/identifier/claim-group", + "value": "99999999999" + } ], + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "billablePeriod": { + "start": "2010-12-31T11:59:52-05:00", + "end": "2011-12-31T11:59:52-05:00" + }, + "created": "2010-12-31T11:59:52-05:00", + "insurer": { + "display": "Humana" + }, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "referral": { + "reference": "#referral" + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "claim": { + "reference": "urn:uuid:fb58f377-1699-fc17-80a6-3d5d15423f80" + }, + "outcome": "complete", + "careTeam": [ { + "sequence": 1, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "role": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", + "code": "primary", + "display": "Primary Care Practitioner" + } ] + } + } ], + "insurance": [ { + "focal": true, + "coverage": { + "reference": "#coverage", + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } ] + }, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "1234", + "display": "SNOMED Code" + } ], + "text": "SNOMED Code" + }, + "servicedPeriod": { + "start": "2010-12-31T11:44:52-05:00", + "end": "2010-12-31T11:59:52-05:00" + }, + "locationCodeableConcept": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "21", + "display": "Inpatient Hospital" + } ] + }, + "encounter": [ { + "reference": "urn:uuid:77a0ba61-b55c-765e-7386-93d73a995735" + } ] + } ], + "total": [ { + "category": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/adjudication", + "code": "submitted", + "display": "Submitted Amount" + } ], + "text": "Submitted Amount" + }, + "amount": { + "value": 129.16, + "currency": "USD" + } + } ], + "payment": { + "amount": { + "value": 0.0, + "currency": "USD" + } + } + }, + "request": { + "method": "POST", + "url": "ExplanationOfBenefit" + } + }, { + "fullUrl": "urn:uuid:eb795251-02eb-7a22-68e3-28e13bcbdd62", + "resource": { + "resourceType": "Encounter", + "id": "eb795251-02eb-7a22-68e3-28e13bcbdd62", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter", "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter" ] + }, + "identifier": [ { + "use": "official", + "system": "https://github.com/synthetichealth/synthea", + "value": "eb795251-02eb-7a22-68e3-28e13bcbdd62" + } ], + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB" + }, + "type": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "1234", + "display": "SNOMED Code" + } ], + "text": "SNOMED Code" + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Mr. Lindsay928 Gerlach374" + }, + "participant": [ { + "type": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType", + "code": "PPRF", + "display": "primary performer" + } ], + "text": "primary performer" + } ], + "period": { + "start": "2011-03-31T12:44:52-04:00", + "end": "2011-03-31T12:59:52-04:00" + }, + "individual": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } + } ], + "period": { + "start": "2011-03-31T12:44:52-04:00", + "end": "2011-03-31T12:59:52-04:00" + }, + "reasonCode": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "274531002", + "display": "Abnormal findings diagnostic imaging heart+coronary circulat (finding)" + } ] + } ], + "location": [ { + "location": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + } ], + "serviceProvider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + }, + "request": { + "method": "POST", + "url": "Encounter" + } + }, { + "fullUrl": "urn:uuid:376277aa-6ca3-b30e-3634-b30097de8a9e", + "resource": { + "resourceType": "Observation", + "id": "376277aa-6ca3-b30e-3634-b30097de8a9e", + "meta": { + "profile": [ "http://hl7.org/fhir/StructureDefinition/bp", "http://hl7.org/fhir/StructureDefinition/vitalsigns" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "85354-9", + "display": "Blood Pressure" + } ], + "text": "Blood Pressure" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:eb795251-02eb-7a22-68e3-28e13bcbdd62" + }, + "effectiveInstant": "2011-03-31T12:44:52-04:00", + "issued": "2011-03-31T12:44:52.558-04:00", + "component": [ { + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "8462-4", + "display": "Diastolic Blood Pressure" + } ], + "text": "Diastolic Blood Pressure" + }, + "valueQuantity": { + "value": 49, + "unit": "mm[Hg]", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + }, { + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "8480-6", + "display": "Systolic Blood Pressure" + } ], + "text": "Systolic Blood Pressure" + }, + "valueQuantity": { + "value": 136, + "unit": "mm[Hg]", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + } ] + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, { + "fullUrl": "urn:uuid:81e29e06-93c7-d72f-7c53-c12675756720", + "resource": { + "resourceType": "DiagnosticReport", + "id": "81e29e06-93c7-d72f-7c53-c12675756720", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-note" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:eb795251-02eb-7a22-68e3-28e13bcbdd62" + }, + "effectiveDateTime": "2011-03-31T12:44:52-04:00", + "issued": "2011-03-31T12:44:52.558-04:00", + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } ], + "presentedForm": [ { + "contentType": "text/plain; charset=utf-8", + "data": "CjIwMTEtMDMtMzEKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgNjAgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuIFBhdGllbnQgaGFzIGEgaGlzdG9yeSBvZiBhY3V0ZSB2aXJhbCBwaGFyeW5naXRpcyAoZGlzb3JkZXIpLgoKIyBTb2NpYWwgSGlzdG9yeQpQYXRpZW50IGlzIG1hcnJpZWQuIFBhdGllbnQgaXMgYW4gYWN0aXZlIHNtb2tlciBhbmQgaXMgYW4gYWxjb2hvbGljLgogUGF0aWVudCBpZGVudGlmaWVzIGFzIGhldGVyb3NleHVhbC4KClBhdGllbnQgY29tZXMgZnJvbSBhIG1pZGRsZSBzb2Npb2Vjb25vbWljIGJhY2tncm91bmQuCiBQYXRpZW50IGhhcyBjb21wbGV0ZWQgc29tZSBjb2xsZWdlIGNvdXJzZXMuClBhdGllbnQgY3VycmVudGx5IGhhcyBIdW1hbmEuCgojIEFsbGVyZ2llcwpObyBLbm93biBBbGxlcmdpZXMuCgojIE1lZGljYXRpb25zCk5vIEFjdGl2ZSBNZWRpY2F0aW9ucy4KCiMgQXNzZXNzbWVudCBhbmQgUGxhbgoKCiMjIFBsYW4KCg==" + } ] + }, + "request": { + "method": "POST", + "url": "DiagnosticReport" + } + }, { + "fullUrl": "urn:uuid:9476dc38-71ba-724e-78ba-54a5d0e30db0", + "resource": { + "resourceType": "DocumentReference", + "id": "9476dc38-71ba-724e-78ba-54a5d0e30db0", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-documentreference" ] + }, + "identifier": [ { + "system": "urn:ietf:rfc:3986", + "value": "urn:uuid:81e29e06-93c7-d72f-7c53-c12675756720" + } ], + "status": "superseded", + "type": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "category": [ { + "coding": [ { + "system": "http://hl7.org/fhir/us/core/CodeSystem/us-core-documentreference-category", + "code": "clinical-note", + "display": "Clinical Note" + } ] + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "date": "2011-03-31T12:44:52.558-04:00", + "author": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } ], + "custodian": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "content": [ { + "attachment": { + "contentType": "text/plain; charset=utf-8", + "data": "CjIwMTEtMDMtMzEKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgNjAgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuIFBhdGllbnQgaGFzIGEgaGlzdG9yeSBvZiBhY3V0ZSB2aXJhbCBwaGFyeW5naXRpcyAoZGlzb3JkZXIpLgoKIyBTb2NpYWwgSGlzdG9yeQpQYXRpZW50IGlzIG1hcnJpZWQuIFBhdGllbnQgaXMgYW4gYWN0aXZlIHNtb2tlciBhbmQgaXMgYW4gYWxjb2hvbGljLgogUGF0aWVudCBpZGVudGlmaWVzIGFzIGhldGVyb3NleHVhbC4KClBhdGllbnQgY29tZXMgZnJvbSBhIG1pZGRsZSBzb2Npb2Vjb25vbWljIGJhY2tncm91bmQuCiBQYXRpZW50IGhhcyBjb21wbGV0ZWQgc29tZSBjb2xsZWdlIGNvdXJzZXMuClBhdGllbnQgY3VycmVudGx5IGhhcyBIdW1hbmEuCgojIEFsbGVyZ2llcwpObyBLbm93biBBbGxlcmdpZXMuCgojIE1lZGljYXRpb25zCk5vIEFjdGl2ZSBNZWRpY2F0aW9ucy4KCiMgQXNzZXNzbWVudCBhbmQgUGxhbgoKCiMjIFBsYW4KCg==" + }, + "format": { + "system": "http://ihe.net/fhir/ValueSet/IHE.FormatCode.codesystem", + "code": "urn:ihe:iti:xds:2017:mimeTypeSufficient", + "display": "mimeType Sufficient" + } + } ], + "context": { + "encounter": [ { + "reference": "urn:uuid:eb795251-02eb-7a22-68e3-28e13bcbdd62" + } ], + "period": { + "start": "2011-03-31T12:44:52-04:00", + "end": "2011-03-31T12:59:52-04:00" + } + } + }, + "request": { + "method": "POST", + "url": "DocumentReference" + } + }, { + "fullUrl": "urn:uuid:f88a8d03-5cf6-571e-5d3b-e2ec7dcc6a7e", + "resource": { + "resourceType": "Claim", + "id": "f88a8d03-5cf6-571e-5d3b-e2ec7dcc6a7e", + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Lindsay928 Gerlach374" + }, + "billablePeriod": { + "start": "2011-03-31T12:44:52-04:00", + "end": "2011-03-31T12:59:52-04:00" + }, + "created": "2011-03-31T12:59:52-04:00", + "provider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "priority": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } ] + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "insurance": [ { + "sequence": 1, + "focal": true, + "coverage": { + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "1234", + "display": "SNOMED Code" + } ], + "text": "SNOMED Code" + }, + "encounter": [ { + "reference": "urn:uuid:eb795251-02eb-7a22-68e3-28e13bcbdd62" + } ] + } ], + "total": { + "value": 129.16, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, { + "fullUrl": "urn:uuid:d07a9136-9f3f-b9c1-4a70-37b06dd5c343", + "resource": { + "resourceType": "ExplanationOfBenefit", + "id": "d07a9136-9f3f-b9c1-4a70-37b06dd5c343", + "contained": [ { + "resourceType": "ServiceRequest", + "id": "referral", + "status": "completed", + "intent": "order", + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "requester": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + } ] + }, { + "resourceType": "Coverage", + "id": "coverage", + "status": "active", + "type": { + "text": "Humana" + }, + "beneficiary": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "payor": [ { + "display": "Humana" + } ] + } ], + "identifier": [ { + "system": "https://bluebutton.cms.gov/resources/variables/clm_id", + "value": "f88a8d03-5cf6-571e-5d3b-e2ec7dcc6a7e" + }, { + "system": "https://bluebutton.cms.gov/resources/identifier/claim-group", + "value": "99999999999" + } ], + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "billablePeriod": { + "start": "2011-03-31T12:59:52-04:00", + "end": "2012-03-31T12:59:52-04:00" + }, + "created": "2011-03-31T12:59:52-04:00", + "insurer": { + "display": "Humana" + }, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "referral": { + "reference": "#referral" + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "claim": { + "reference": "urn:uuid:f88a8d03-5cf6-571e-5d3b-e2ec7dcc6a7e" + }, + "outcome": "complete", + "careTeam": [ { + "sequence": 1, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "role": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", + "code": "primary", + "display": "Primary Care Practitioner" + } ] + } + } ], + "insurance": [ { + "focal": true, + "coverage": { + "reference": "#coverage", + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } ] + }, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "1234", + "display": "SNOMED Code" + } ], + "text": "SNOMED Code" + }, + "servicedPeriod": { + "start": "2011-03-31T12:44:52-04:00", + "end": "2011-03-31T12:59:52-04:00" + }, + "locationCodeableConcept": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "21", + "display": "Inpatient Hospital" + } ] + }, + "encounter": [ { + "reference": "urn:uuid:eb795251-02eb-7a22-68e3-28e13bcbdd62" + } ] + } ], + "total": [ { + "category": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/adjudication", + "code": "submitted", + "display": "Submitted Amount" + } ], + "text": "Submitted Amount" + }, + "amount": { + "value": 129.16, + "currency": "USD" + } + } ], + "payment": { + "amount": { + "value": 0.0, + "currency": "USD" + } + } + }, + "request": { + "method": "POST", + "url": "ExplanationOfBenefit" + } + }, { + "fullUrl": "urn:uuid:1dc21efe-926d-ee90-a7ad-c667ba559da6", + "resource": { + "resourceType": "Encounter", + "id": "1dc21efe-926d-ee90-a7ad-c667ba559da6", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter", "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter" ] + }, + "identifier": [ { + "use": "official", + "system": "https://github.com/synthetichealth/synthea", + "value": "1dc21efe-926d-ee90-a7ad-c667ba559da6" + } ], + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB" + }, + "type": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "1234", + "display": "SNOMED Code" + } ], + "text": "SNOMED Code" + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Mr. Lindsay928 Gerlach374" + }, + "participant": [ { + "type": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType", + "code": "PPRF", + "display": "primary performer" + } ], + "text": "primary performer" + } ], + "period": { + "start": "2011-06-29T12:44:52-04:00", + "end": "2011-06-29T12:59:52-04:00" + }, + "individual": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } + } ], + "period": { + "start": "2011-06-29T12:44:52-04:00", + "end": "2011-06-29T12:59:52-04:00" + }, + "reasonCode": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "274531002", + "display": "Abnormal findings diagnostic imaging heart+coronary circulat (finding)" + } ] + } ], + "location": [ { + "location": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + } ], + "serviceProvider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + }, + "request": { + "method": "POST", + "url": "Encounter" + } + }, { + "fullUrl": "urn:uuid:b954b27b-4d4b-d11b-cad3-1efdc1e527e0", + "resource": { + "resourceType": "Observation", + "id": "b954b27b-4d4b-d11b-cad3-1efdc1e527e0", + "meta": { + "profile": [ "http://hl7.org/fhir/StructureDefinition/bp", "http://hl7.org/fhir/StructureDefinition/vitalsigns" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "85354-9", + "display": "Blood Pressure" + } ], + "text": "Blood Pressure" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:1dc21efe-926d-ee90-a7ad-c667ba559da6" + }, + "effectiveInstant": "2011-06-29T12:44:52-04:00", + "issued": "2011-06-29T12:44:52.558-04:00", + "component": [ { + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "8462-4", + "display": "Diastolic Blood Pressure" + } ], + "text": "Diastolic Blood Pressure" + }, + "valueQuantity": { + "value": 49, + "unit": "mm[Hg]", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + }, { + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "8480-6", + "display": "Systolic Blood Pressure" + } ], + "text": "Systolic Blood Pressure" + }, + "valueQuantity": { + "value": 136, + "unit": "mm[Hg]", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + } ] + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, { + "fullUrl": "urn:uuid:574df38b-f569-176e-99e6-79c1edfc07a2", + "resource": { + "resourceType": "DiagnosticReport", + "id": "574df38b-f569-176e-99e6-79c1edfc07a2", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-note" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:1dc21efe-926d-ee90-a7ad-c667ba559da6" + }, + "effectiveDateTime": "2011-06-29T12:44:52-04:00", + "issued": "2011-06-29T12:44:52.558-04:00", + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } ], + "presentedForm": [ { + "contentType": "text/plain; charset=utf-8", + "data": "CjIwMTEtMDYtMjkKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgNjAgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuIFBhdGllbnQgaGFzIGEgaGlzdG9yeSBvZiBhY3V0ZSB2aXJhbCBwaGFyeW5naXRpcyAoZGlzb3JkZXIpLgoKIyBTb2NpYWwgSGlzdG9yeQpQYXRpZW50IGlzIG1hcnJpZWQuIFBhdGllbnQgaXMgYW4gYWN0aXZlIHNtb2tlciBhbmQgaXMgYW4gYWxjb2hvbGljLgogUGF0aWVudCBpZGVudGlmaWVzIGFzIGhldGVyb3NleHVhbC4KClBhdGllbnQgY29tZXMgZnJvbSBhIG1pZGRsZSBzb2Npb2Vjb25vbWljIGJhY2tncm91bmQuCiBQYXRpZW50IGhhcyBjb21wbGV0ZWQgc29tZSBjb2xsZWdlIGNvdXJzZXMuClBhdGllbnQgY3VycmVudGx5IGhhcyBIdW1hbmEuCgojIEFsbGVyZ2llcwpObyBLbm93biBBbGxlcmdpZXMuCgojIE1lZGljYXRpb25zCk5vIEFjdGl2ZSBNZWRpY2F0aW9ucy4KCiMgQXNzZXNzbWVudCBhbmQgUGxhbgoKCiMjIFBsYW4KCg==" + } ] + }, + "request": { + "method": "POST", + "url": "DiagnosticReport" + } + }, { + "fullUrl": "urn:uuid:1859a4ee-c797-1596-f58d-8ea12f3fb335", + "resource": { + "resourceType": "DocumentReference", + "id": "1859a4ee-c797-1596-f58d-8ea12f3fb335", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-documentreference" ] + }, + "identifier": [ { + "system": "urn:ietf:rfc:3986", + "value": "urn:uuid:574df38b-f569-176e-99e6-79c1edfc07a2" + } ], + "status": "superseded", + "type": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "category": [ { + "coding": [ { + "system": "http://hl7.org/fhir/us/core/CodeSystem/us-core-documentreference-category", + "code": "clinical-note", + "display": "Clinical Note" + } ] + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "date": "2011-06-29T12:44:52.558-04:00", + "author": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } ], + "custodian": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "content": [ { + "attachment": { + "contentType": "text/plain; charset=utf-8", + "data": "CjIwMTEtMDYtMjkKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgNjAgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuIFBhdGllbnQgaGFzIGEgaGlzdG9yeSBvZiBhY3V0ZSB2aXJhbCBwaGFyeW5naXRpcyAoZGlzb3JkZXIpLgoKIyBTb2NpYWwgSGlzdG9yeQpQYXRpZW50IGlzIG1hcnJpZWQuIFBhdGllbnQgaXMgYW4gYWN0aXZlIHNtb2tlciBhbmQgaXMgYW4gYWxjb2hvbGljLgogUGF0aWVudCBpZGVudGlmaWVzIGFzIGhldGVyb3NleHVhbC4KClBhdGllbnQgY29tZXMgZnJvbSBhIG1pZGRsZSBzb2Npb2Vjb25vbWljIGJhY2tncm91bmQuCiBQYXRpZW50IGhhcyBjb21wbGV0ZWQgc29tZSBjb2xsZWdlIGNvdXJzZXMuClBhdGllbnQgY3VycmVudGx5IGhhcyBIdW1hbmEuCgojIEFsbGVyZ2llcwpObyBLbm93biBBbGxlcmdpZXMuCgojIE1lZGljYXRpb25zCk5vIEFjdGl2ZSBNZWRpY2F0aW9ucy4KCiMgQXNzZXNzbWVudCBhbmQgUGxhbgoKCiMjIFBsYW4KCg==" + }, + "format": { + "system": "http://ihe.net/fhir/ValueSet/IHE.FormatCode.codesystem", + "code": "urn:ihe:iti:xds:2017:mimeTypeSufficient", + "display": "mimeType Sufficient" + } + } ], + "context": { + "encounter": [ { + "reference": "urn:uuid:1dc21efe-926d-ee90-a7ad-c667ba559da6" + } ], + "period": { + "start": "2011-06-29T12:44:52-04:00", + "end": "2011-06-29T12:59:52-04:00" + } + } + }, + "request": { + "method": "POST", + "url": "DocumentReference" + } + }, { + "fullUrl": "urn:uuid:26c2f08c-eb6f-b563-6ccf-2b96bf0cb8e3", + "resource": { + "resourceType": "Claim", + "id": "26c2f08c-eb6f-b563-6ccf-2b96bf0cb8e3", + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Lindsay928 Gerlach374" + }, + "billablePeriod": { + "start": "2011-06-29T12:44:52-04:00", + "end": "2011-06-29T12:59:52-04:00" + }, + "created": "2011-06-29T12:59:52-04:00", + "provider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "priority": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } ] + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "insurance": [ { + "sequence": 1, + "focal": true, + "coverage": { + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "1234", + "display": "SNOMED Code" + } ], + "text": "SNOMED Code" + }, + "encounter": [ { + "reference": "urn:uuid:1dc21efe-926d-ee90-a7ad-c667ba559da6" + } ] + } ], + "total": { + "value": 129.16, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, { + "fullUrl": "urn:uuid:fc3ba510-46ed-a66e-cbb3-3e61ac429895", + "resource": { + "resourceType": "ExplanationOfBenefit", + "id": "fc3ba510-46ed-a66e-cbb3-3e61ac429895", + "contained": [ { + "resourceType": "ServiceRequest", + "id": "referral", + "status": "completed", + "intent": "order", + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "requester": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + } ] + }, { + "resourceType": "Coverage", + "id": "coverage", + "status": "active", + "type": { + "text": "Humana" + }, + "beneficiary": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "payor": [ { + "display": "Humana" + } ] + } ], + "identifier": [ { + "system": "https://bluebutton.cms.gov/resources/variables/clm_id", + "value": "26c2f08c-eb6f-b563-6ccf-2b96bf0cb8e3" + }, { + "system": "https://bluebutton.cms.gov/resources/identifier/claim-group", + "value": "99999999999" + } ], + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "billablePeriod": { + "start": "2011-06-29T12:59:52-04:00", + "end": "2012-06-29T12:59:52-04:00" + }, + "created": "2011-06-29T12:59:52-04:00", + "insurer": { + "display": "Humana" + }, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "referral": { + "reference": "#referral" + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "claim": { + "reference": "urn:uuid:26c2f08c-eb6f-b563-6ccf-2b96bf0cb8e3" + }, + "outcome": "complete", + "careTeam": [ { + "sequence": 1, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "role": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", + "code": "primary", + "display": "Primary Care Practitioner" + } ] + } + } ], + "insurance": [ { + "focal": true, + "coverage": { + "reference": "#coverage", + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } ] + }, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "1234", + "display": "SNOMED Code" + } ], + "text": "SNOMED Code" + }, + "servicedPeriod": { + "start": "2011-06-29T12:44:52-04:00", + "end": "2011-06-29T12:59:52-04:00" + }, + "locationCodeableConcept": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "21", + "display": "Inpatient Hospital" + } ] + }, + "encounter": [ { + "reference": "urn:uuid:1dc21efe-926d-ee90-a7ad-c667ba559da6" + } ] + } ], + "total": [ { + "category": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/adjudication", + "code": "submitted", + "display": "Submitted Amount" + } ], + "text": "Submitted Amount" + }, + "amount": { + "value": 129.16, + "currency": "USD" + } + } ], + "payment": { + "amount": { + "value": 0.0, + "currency": "USD" + } + } + }, + "request": { + "method": "POST", + "url": "ExplanationOfBenefit" + } + }, { + "fullUrl": "urn:uuid:556138b9-2209-0a5d-4e6d-45777ec113bd", + "resource": { + "resourceType": "Encounter", + "id": "556138b9-2209-0a5d-4e6d-45777ec113bd", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter", "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter" ] + }, + "identifier": [ { + "use": "official", + "system": "https://github.com/synthetichealth/synthea", + "value": "556138b9-2209-0a5d-4e6d-45777ec113bd" + } ], + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB" + }, + "type": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "185345009", + "display": "Encounter for symptom" + } ], + "text": "Encounter for symptom" + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Mr. Lindsay928 Gerlach374" + }, + "participant": [ { + "type": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType", + "code": "PPRF", + "display": "primary performer" + } ], + "text": "primary performer" + } ], + "period": { + "start": "2011-09-04T20:44:52-04:00", + "end": "2011-09-04T20:59:52-04:00" + }, + "individual": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } + } ], + "period": { + "start": "2011-09-04T20:44:52-04:00", + "end": "2011-09-04T20:59:52-04:00" + }, + "reasonCode": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "444814009", + "display": "Viral sinusitis (disorder)" + } ] + } ], + "location": [ { + "location": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + } ], + "serviceProvider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + }, + "request": { + "method": "POST", + "url": "Encounter" + } + }, { + "fullUrl": "urn:uuid:c20ea570-5fbc-2165-9d08-5c394a901775", + "resource": { + "resourceType": "Condition", + "id": "c20ea570-5fbc-2165-9d08-5c394a901775", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-condition" ] + }, + "clinicalStatus": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/condition-clinical", + "code": "resolved" + } ] + }, + "verificationStatus": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status", + "code": "confirmed" + } ] + }, + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/condition-category", + "code": "encounter-diagnosis", + "display": "Encounter Diagnosis" + } ] + } ], + "code": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "444814009", + "display": "Viral sinusitis (disorder)" + } ], + "text": "Viral sinusitis (disorder)" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:556138b9-2209-0a5d-4e6d-45777ec113bd" + }, + "onsetDateTime": "2011-09-04T20:44:52-04:00", + "abatementDateTime": "2011-09-26T20:44:52-04:00", + "recordedDate": "2011-09-04T20:44:52-04:00" + }, + "request": { + "method": "POST", + "url": "Condition" + } + }, { + "fullUrl": "urn:uuid:bae7721c-0607-bb10-9f4b-5667bf99a4e8", + "resource": { + "resourceType": "DiagnosticReport", + "id": "bae7721c-0607-bb10-9f4b-5667bf99a4e8", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-note" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:556138b9-2209-0a5d-4e6d-45777ec113bd" + }, + "effectiveDateTime": "2011-09-04T20:44:52-04:00", + "issued": "2011-09-04T20:44:52.558-04:00", + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } ], + "presentedForm": [ { + "contentType": "text/plain; charset=utf-8", + "data": "CjIwMTEtMDktMDQKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgNjAgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuIFBhdGllbnQgaGFzIGEgaGlzdG9yeSBvZiBhY3V0ZSB2aXJhbCBwaGFyeW5naXRpcyAoZGlzb3JkZXIpLgoKIyBTb2NpYWwgSGlzdG9yeQpQYXRpZW50IGlzIG1hcnJpZWQuIFBhdGllbnQgaXMgYW4gYWN0aXZlIHNtb2tlciBhbmQgaXMgYW4gYWxjb2hvbGljLgogUGF0aWVudCBpZGVudGlmaWVzIGFzIGhldGVyb3NleHVhbC4KClBhdGllbnQgY29tZXMgZnJvbSBhIG1pZGRsZSBzb2Npb2Vjb25vbWljIGJhY2tncm91bmQuCiBQYXRpZW50IGhhcyBjb21wbGV0ZWQgc29tZSBjb2xsZWdlIGNvdXJzZXMuClBhdGllbnQgY3VycmVudGx5IGhhcyBIdW1hbmEuCgojIEFsbGVyZ2llcwpObyBLbm93biBBbGxlcmdpZXMuCgojIE1lZGljYXRpb25zCk5vIEFjdGl2ZSBNZWRpY2F0aW9ucy4KCiMgQXNzZXNzbWVudCBhbmQgUGxhbgpQYXRpZW50IGlzIHByZXNlbnRpbmcgd2l0aCB2aXJhbCBzaW51c2l0aXMgKGRpc29yZGVyKS4gCgojIyBQbGFuCgo=" + } ] + }, + "request": { + "method": "POST", + "url": "DiagnosticReport" + } + }, { + "fullUrl": "urn:uuid:4e797d34-69c7-6f40-d8fe-9ed69f6f5bf1", + "resource": { + "resourceType": "DocumentReference", + "id": "4e797d34-69c7-6f40-d8fe-9ed69f6f5bf1", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-documentreference" ] + }, + "identifier": [ { + "system": "urn:ietf:rfc:3986", + "value": "urn:uuid:bae7721c-0607-bb10-9f4b-5667bf99a4e8" + } ], + "status": "superseded", + "type": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "category": [ { + "coding": [ { + "system": "http://hl7.org/fhir/us/core/CodeSystem/us-core-documentreference-category", + "code": "clinical-note", + "display": "Clinical Note" + } ] + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "date": "2011-09-04T20:44:52.558-04:00", + "author": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } ], + "custodian": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "content": [ { + "attachment": { + "contentType": "text/plain; charset=utf-8", + "data": "CjIwMTEtMDktMDQKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgNjAgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuIFBhdGllbnQgaGFzIGEgaGlzdG9yeSBvZiBhY3V0ZSB2aXJhbCBwaGFyeW5naXRpcyAoZGlzb3JkZXIpLgoKIyBTb2NpYWwgSGlzdG9yeQpQYXRpZW50IGlzIG1hcnJpZWQuIFBhdGllbnQgaXMgYW4gYWN0aXZlIHNtb2tlciBhbmQgaXMgYW4gYWxjb2hvbGljLgogUGF0aWVudCBpZGVudGlmaWVzIGFzIGhldGVyb3NleHVhbC4KClBhdGllbnQgY29tZXMgZnJvbSBhIG1pZGRsZSBzb2Npb2Vjb25vbWljIGJhY2tncm91bmQuCiBQYXRpZW50IGhhcyBjb21wbGV0ZWQgc29tZSBjb2xsZWdlIGNvdXJzZXMuClBhdGllbnQgY3VycmVudGx5IGhhcyBIdW1hbmEuCgojIEFsbGVyZ2llcwpObyBLbm93biBBbGxlcmdpZXMuCgojIE1lZGljYXRpb25zCk5vIEFjdGl2ZSBNZWRpY2F0aW9ucy4KCiMgQXNzZXNzbWVudCBhbmQgUGxhbgpQYXRpZW50IGlzIHByZXNlbnRpbmcgd2l0aCB2aXJhbCBzaW51c2l0aXMgKGRpc29yZGVyKS4gCgojIyBQbGFuCgo=" + }, + "format": { + "system": "http://ihe.net/fhir/ValueSet/IHE.FormatCode.codesystem", + "code": "urn:ihe:iti:xds:2017:mimeTypeSufficient", + "display": "mimeType Sufficient" + } + } ], + "context": { + "encounter": [ { + "reference": "urn:uuid:556138b9-2209-0a5d-4e6d-45777ec113bd" + } ], + "period": { + "start": "2011-09-04T20:44:52-04:00", + "end": "2011-09-04T20:59:52-04:00" + } + } + }, + "request": { + "method": "POST", + "url": "DocumentReference" + } + }, { + "fullUrl": "urn:uuid:c8185c95-81a1-e373-6b24-cd60ee0b8c01", + "resource": { + "resourceType": "Claim", + "id": "c8185c95-81a1-e373-6b24-cd60ee0b8c01", + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Lindsay928 Gerlach374" + }, + "billablePeriod": { + "start": "2011-09-04T20:44:52-04:00", + "end": "2011-09-04T20:59:52-04:00" + }, + "created": "2011-09-04T20:59:52-04:00", + "provider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "priority": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } ] + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "diagnosis": [ { + "sequence": 1, + "diagnosisReference": { + "reference": "urn:uuid:c20ea570-5fbc-2165-9d08-5c394a901775" + } + } ], + "insurance": [ { + "sequence": 1, + "focal": true, + "coverage": { + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "185345009", + "display": "Encounter for symptom" + } ], + "text": "Encounter for symptom" + }, + "encounter": [ { + "reference": "urn:uuid:556138b9-2209-0a5d-4e6d-45777ec113bd" + } ] + }, { + "sequence": 2, + "diagnosisSequence": [ 1 ], + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "444814009", + "display": "Viral sinusitis (disorder)" + } ], + "text": "Viral sinusitis (disorder)" + } + } ], + "total": { + "value": 77.49, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, { + "fullUrl": "urn:uuid:316e6697-1561-a047-5a52-281cb717ef44", + "resource": { + "resourceType": "ExplanationOfBenefit", + "id": "316e6697-1561-a047-5a52-281cb717ef44", + "contained": [ { + "resourceType": "ServiceRequest", + "id": "referral", + "status": "completed", + "intent": "order", + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "requester": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + } ] + }, { + "resourceType": "Coverage", + "id": "coverage", + "status": "active", + "type": { + "text": "Humana" + }, + "beneficiary": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "payor": [ { + "display": "Humana" + } ] + } ], + "identifier": [ { + "system": "https://bluebutton.cms.gov/resources/variables/clm_id", + "value": "c8185c95-81a1-e373-6b24-cd60ee0b8c01" + }, { + "system": "https://bluebutton.cms.gov/resources/identifier/claim-group", + "value": "99999999999" + } ], + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "billablePeriod": { + "start": "2011-09-04T20:59:52-04:00", + "end": "2012-09-04T20:59:52-04:00" + }, + "created": "2011-09-04T20:59:52-04:00", + "insurer": { + "display": "Humana" + }, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "referral": { + "reference": "#referral" + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "claim": { + "reference": "urn:uuid:c8185c95-81a1-e373-6b24-cd60ee0b8c01" + }, + "outcome": "complete", + "careTeam": [ { + "sequence": 1, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "role": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", + "code": "primary", + "display": "Primary Care Practitioner" + } ] + } + } ], + "diagnosis": [ { + "sequence": 1, + "diagnosisReference": { + "reference": "urn:uuid:c20ea570-5fbc-2165-9d08-5c394a901775" + }, + "type": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-diagnosistype", + "code": "principal" + } ] + } ] + } ], + "insurance": [ { + "focal": true, + "coverage": { + "reference": "#coverage", + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } ] + }, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "185345009", + "display": "Encounter for symptom" + } ], + "text": "Encounter for symptom" + }, + "servicedPeriod": { + "start": "2011-09-04T20:44:52-04:00", + "end": "2011-09-04T20:59:52-04:00" + }, + "locationCodeableConcept": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "21", + "display": "Inpatient Hospital" + } ] + }, + "encounter": [ { + "reference": "urn:uuid:556138b9-2209-0a5d-4e6d-45777ec113bd" + } ] + }, { + "sequence": 2, + "diagnosisSequence": [ 1 ], + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } ] + }, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "444814009", + "display": "Viral sinusitis (disorder)" + } ], + "text": "Viral sinusitis (disorder)" + }, + "servicedPeriod": { + "start": "2011-09-04T20:44:52-04:00", + "end": "2011-09-04T20:59:52-04:00" + }, + "locationCodeableConcept": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "21", + "display": "Inpatient Hospital" + } ] + } + } ], + "total": [ { + "category": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/adjudication", + "code": "submitted", + "display": "Submitted Amount" + } ], + "text": "Submitted Amount" + }, + "amount": { + "value": 77.49, + "currency": "USD" + } + } ], + "payment": { + "amount": { + "value": 0.0, + "currency": "USD" + } + } + }, + "request": { + "method": "POST", + "url": "ExplanationOfBenefit" + } + }, { + "fullUrl": "urn:uuid:9aecb859-e8c7-3b40-145e-83d04d427406", + "resource": { + "resourceType": "Encounter", + "id": "9aecb859-e8c7-3b40-145e-83d04d427406", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter", "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter" ] + }, + "identifier": [ { + "use": "official", + "system": "https://github.com/synthetichealth/synthea", + "value": "9aecb859-e8c7-3b40-145e-83d04d427406" + } ], + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB" + }, + "type": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "1234", + "display": "SNOMED Code" + } ], + "text": "SNOMED Code" + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Mr. Lindsay928 Gerlach374" + }, + "participant": [ { + "type": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType", + "code": "PPRF", + "display": "primary performer" + } ], + "text": "primary performer" + } ], + "period": { + "start": "2011-09-27T12:44:52-04:00", + "end": "2011-09-27T12:59:52-04:00" + }, + "individual": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } + } ], + "period": { + "start": "2011-09-27T12:44:52-04:00", + "end": "2011-09-27T12:59:52-04:00" + }, + "reasonCode": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "274531002", + "display": "Abnormal findings diagnostic imaging heart+coronary circulat (finding)" + } ] + } ], + "location": [ { + "location": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + } ], + "serviceProvider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + }, + "request": { + "method": "POST", + "url": "Encounter" + } + }, { + "fullUrl": "urn:uuid:a004cd64-daad-d8c9-d370-37a30ecab853", + "resource": { + "resourceType": "Observation", + "id": "a004cd64-daad-d8c9-d370-37a30ecab853", + "meta": { + "profile": [ "http://hl7.org/fhir/StructureDefinition/bp", "http://hl7.org/fhir/StructureDefinition/vitalsigns" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "85354-9", + "display": "Blood Pressure" + } ], + "text": "Blood Pressure" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:9aecb859-e8c7-3b40-145e-83d04d427406" + }, + "effectiveInstant": "2011-09-27T12:44:52-04:00", + "issued": "2011-09-27T12:44:52.558-04:00", + "component": [ { + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "8462-4", + "display": "Diastolic Blood Pressure" + } ], + "text": "Diastolic Blood Pressure" + }, + "valueQuantity": { + "value": 49, + "unit": "mm[Hg]", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + }, { + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "8480-6", + "display": "Systolic Blood Pressure" + } ], + "text": "Systolic Blood Pressure" + }, + "valueQuantity": { + "value": 136, + "unit": "mm[Hg]", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + } ] + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, { + "fullUrl": "urn:uuid:67ab7c70-b767-4a78-d116-18156ff91bde", + "resource": { + "resourceType": "DiagnosticReport", + "id": "67ab7c70-b767-4a78-d116-18156ff91bde", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-note" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:9aecb859-e8c7-3b40-145e-83d04d427406" + }, + "effectiveDateTime": "2011-09-27T12:44:52-04:00", + "issued": "2011-09-27T12:44:52.558-04:00", + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } ], + "presentedForm": [ { + "contentType": "text/plain; charset=utf-8", + "data": "CjIwMTEtMDktMjcKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgNjAgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuIFBhdGllbnQgaGFzIGEgaGlzdG9yeSBvZiBhY3V0ZSB2aXJhbCBwaGFyeW5naXRpcyAoZGlzb3JkZXIpLCB2aXJhbCBzaW51c2l0aXMgKGRpc29yZGVyKS4KCiMgU29jaWFsIEhpc3RvcnkKUGF0aWVudCBpcyBtYXJyaWVkLiBQYXRpZW50IGlzIGFuIGFjdGl2ZSBzbW9rZXIgYW5kIGlzIGFuIGFsY29ob2xpYy4KIFBhdGllbnQgaWRlbnRpZmllcyBhcyBoZXRlcm9zZXh1YWwuCgpQYXRpZW50IGNvbWVzIGZyb20gYSBtaWRkbGUgc29jaW9lY29ub21pYyBiYWNrZ3JvdW5kLgogUGF0aWVudCBoYXMgY29tcGxldGVkIHNvbWUgY29sbGVnZSBjb3Vyc2VzLgpQYXRpZW50IGN1cnJlbnRseSBoYXMgSHVtYW5hLgoKIyBBbGxlcmdpZXMKTm8gS25vd24gQWxsZXJnaWVzLgoKIyBNZWRpY2F0aW9ucwpObyBBY3RpdmUgTWVkaWNhdGlvbnMuCgojIEFzc2Vzc21lbnQgYW5kIFBsYW4KCgojIyBQbGFuCgo=" + } ] + }, + "request": { + "method": "POST", + "url": "DiagnosticReport" + } + }, { + "fullUrl": "urn:uuid:494e6d81-2fc5-4d96-dd11-ad31ebda8c23", + "resource": { + "resourceType": "DocumentReference", + "id": "494e6d81-2fc5-4d96-dd11-ad31ebda8c23", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-documentreference" ] + }, + "identifier": [ { + "system": "urn:ietf:rfc:3986", + "value": "urn:uuid:67ab7c70-b767-4a78-d116-18156ff91bde" + } ], + "status": "superseded", + "type": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "category": [ { + "coding": [ { + "system": "http://hl7.org/fhir/us/core/CodeSystem/us-core-documentreference-category", + "code": "clinical-note", + "display": "Clinical Note" + } ] + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "date": "2011-09-27T12:44:52.558-04:00", + "author": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } ], + "custodian": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "content": [ { + "attachment": { + "contentType": "text/plain; charset=utf-8", + "data": "CjIwMTEtMDktMjcKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgNjAgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuIFBhdGllbnQgaGFzIGEgaGlzdG9yeSBvZiBhY3V0ZSB2aXJhbCBwaGFyeW5naXRpcyAoZGlzb3JkZXIpLCB2aXJhbCBzaW51c2l0aXMgKGRpc29yZGVyKS4KCiMgU29jaWFsIEhpc3RvcnkKUGF0aWVudCBpcyBtYXJyaWVkLiBQYXRpZW50IGlzIGFuIGFjdGl2ZSBzbW9rZXIgYW5kIGlzIGFuIGFsY29ob2xpYy4KIFBhdGllbnQgaWRlbnRpZmllcyBhcyBoZXRlcm9zZXh1YWwuCgpQYXRpZW50IGNvbWVzIGZyb20gYSBtaWRkbGUgc29jaW9lY29ub21pYyBiYWNrZ3JvdW5kLgogUGF0aWVudCBoYXMgY29tcGxldGVkIHNvbWUgY29sbGVnZSBjb3Vyc2VzLgpQYXRpZW50IGN1cnJlbnRseSBoYXMgSHVtYW5hLgoKIyBBbGxlcmdpZXMKTm8gS25vd24gQWxsZXJnaWVzLgoKIyBNZWRpY2F0aW9ucwpObyBBY3RpdmUgTWVkaWNhdGlvbnMuCgojIEFzc2Vzc21lbnQgYW5kIFBsYW4KCgojIyBQbGFuCgo=" + }, + "format": { + "system": "http://ihe.net/fhir/ValueSet/IHE.FormatCode.codesystem", + "code": "urn:ihe:iti:xds:2017:mimeTypeSufficient", + "display": "mimeType Sufficient" + } + } ], + "context": { + "encounter": [ { + "reference": "urn:uuid:9aecb859-e8c7-3b40-145e-83d04d427406" + } ], + "period": { + "start": "2011-09-27T12:44:52-04:00", + "end": "2011-09-27T12:59:52-04:00" + } + } + }, + "request": { + "method": "POST", + "url": "DocumentReference" + } + }, { + "fullUrl": "urn:uuid:6f625d34-c999-addd-e7d2-180483aa6ecf", + "resource": { + "resourceType": "Claim", + "id": "6f625d34-c999-addd-e7d2-180483aa6ecf", + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Lindsay928 Gerlach374" + }, + "billablePeriod": { + "start": "2011-09-27T12:44:52-04:00", + "end": "2011-09-27T12:59:52-04:00" + }, + "created": "2011-09-27T12:59:52-04:00", + "provider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "priority": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } ] + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "insurance": [ { + "sequence": 1, + "focal": true, + "coverage": { + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "1234", + "display": "SNOMED Code" + } ], + "text": "SNOMED Code" + }, + "encounter": [ { + "reference": "urn:uuid:9aecb859-e8c7-3b40-145e-83d04d427406" + } ] + } ], + "total": { + "value": 129.16, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, { + "fullUrl": "urn:uuid:0c41c15f-7acf-5083-2bb3-5b4a48064e5f", + "resource": { + "resourceType": "ExplanationOfBenefit", + "id": "0c41c15f-7acf-5083-2bb3-5b4a48064e5f", + "contained": [ { + "resourceType": "ServiceRequest", + "id": "referral", + "status": "completed", + "intent": "order", + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "requester": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + } ] + }, { + "resourceType": "Coverage", + "id": "coverage", + "status": "active", + "type": { + "text": "Humana" + }, + "beneficiary": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "payor": [ { + "display": "Humana" + } ] + } ], + "identifier": [ { + "system": "https://bluebutton.cms.gov/resources/variables/clm_id", + "value": "6f625d34-c999-addd-e7d2-180483aa6ecf" + }, { + "system": "https://bluebutton.cms.gov/resources/identifier/claim-group", + "value": "99999999999" + } ], + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "billablePeriod": { + "start": "2011-09-27T12:59:52-04:00", + "end": "2012-09-27T12:59:52-04:00" + }, + "created": "2011-09-27T12:59:52-04:00", + "insurer": { + "display": "Humana" + }, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "referral": { + "reference": "#referral" + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "claim": { + "reference": "urn:uuid:6f625d34-c999-addd-e7d2-180483aa6ecf" + }, + "outcome": "complete", + "careTeam": [ { + "sequence": 1, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "role": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", + "code": "primary", + "display": "Primary Care Practitioner" + } ] + } + } ], + "insurance": [ { + "focal": true, + "coverage": { + "reference": "#coverage", + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } ] + }, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "1234", + "display": "SNOMED Code" + } ], + "text": "SNOMED Code" + }, + "servicedPeriod": { + "start": "2011-09-27T12:44:52-04:00", + "end": "2011-09-27T12:59:52-04:00" + }, + "locationCodeableConcept": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "21", + "display": "Inpatient Hospital" + } ] + }, + "encounter": [ { + "reference": "urn:uuid:9aecb859-e8c7-3b40-145e-83d04d427406" + } ] + } ], + "total": [ { + "category": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/adjudication", + "code": "submitted", + "display": "Submitted Amount" + } ], + "text": "Submitted Amount" + }, + "amount": { + "value": 129.16, + "currency": "USD" + } + } ], + "payment": { + "amount": { + "value": 0.0, + "currency": "USD" + } + } + }, + "request": { + "method": "POST", + "url": "ExplanationOfBenefit" + } + }, { + "fullUrl": "urn:uuid:9178a2d6-01da-6b77-911c-fb668a9d2d06", + "resource": { + "resourceType": "Encounter", + "id": "9178a2d6-01da-6b77-911c-fb668a9d2d06", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter", "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter" ] + }, + "identifier": [ { + "use": "official", + "system": "https://github.com/synthetichealth/synthea", + "value": "9178a2d6-01da-6b77-911c-fb668a9d2d06" + } ], + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB" + }, + "type": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "1234", + "display": "SNOMED Code" + } ], + "text": "SNOMED Code" + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Mr. Lindsay928 Gerlach374" + }, + "participant": [ { + "type": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType", + "code": "PPRF", + "display": "primary performer" + } ], + "text": "primary performer" + } ], + "period": { + "start": "2011-12-26T11:44:52-05:00", + "end": "2011-12-26T11:59:52-05:00" + }, + "individual": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } + } ], + "period": { + "start": "2011-12-26T11:44:52-05:00", + "end": "2011-12-26T11:59:52-05:00" + }, + "reasonCode": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "274531002", + "display": "Abnormal findings diagnostic imaging heart+coronary circulat (finding)" + } ] + } ], + "location": [ { + "location": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + } ], + "serviceProvider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + }, + "request": { + "method": "POST", + "url": "Encounter" + } + }, { + "fullUrl": "urn:uuid:7e13c089-855e-6cea-9bd6-299d75c6a1d3", + "resource": { + "resourceType": "Observation", + "id": "7e13c089-855e-6cea-9bd6-299d75c6a1d3", + "meta": { + "profile": [ "http://hl7.org/fhir/StructureDefinition/bp", "http://hl7.org/fhir/StructureDefinition/vitalsigns" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "85354-9", + "display": "Blood Pressure" + } ], + "text": "Blood Pressure" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:9178a2d6-01da-6b77-911c-fb668a9d2d06" + }, + "effectiveInstant": "2011-12-26T11:44:52-05:00", + "issued": "2011-12-26T11:44:52.558-05:00", + "component": [ { + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "8462-4", + "display": "Diastolic Blood Pressure" + } ], + "text": "Diastolic Blood Pressure" + }, + "valueQuantity": { + "value": 49, + "unit": "mm[Hg]", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + }, { + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "8480-6", + "display": "Systolic Blood Pressure" + } ], + "text": "Systolic Blood Pressure" + }, + "valueQuantity": { + "value": 136, + "unit": "mm[Hg]", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + } ] + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, { + "fullUrl": "urn:uuid:c3564fd7-e5cc-5710-0294-ee79ef8c2413", + "resource": { + "resourceType": "DiagnosticReport", + "id": "c3564fd7-e5cc-5710-0294-ee79ef8c2413", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-note" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:9178a2d6-01da-6b77-911c-fb668a9d2d06" + }, + "effectiveDateTime": "2011-12-26T11:44:52-05:00", + "issued": "2011-12-26T11:44:52.558-05:00", + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } ], + "presentedForm": [ { + "contentType": "text/plain; charset=utf-8", + "data": "CjIwMTEtMTItMjYKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgNjEgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuIFBhdGllbnQgaGFzIGEgaGlzdG9yeSBvZiBhY3V0ZSB2aXJhbCBwaGFyeW5naXRpcyAoZGlzb3JkZXIpLCB2aXJhbCBzaW51c2l0aXMgKGRpc29yZGVyKS4KCiMgU29jaWFsIEhpc3RvcnkKUGF0aWVudCBpcyBtYXJyaWVkLiBQYXRpZW50IGlzIGFuIGFjdGl2ZSBzbW9rZXIgYW5kIGlzIGFuIGFsY29ob2xpYy4KIFBhdGllbnQgaWRlbnRpZmllcyBhcyBoZXRlcm9zZXh1YWwuCgpQYXRpZW50IGNvbWVzIGZyb20gYSBtaWRkbGUgc29jaW9lY29ub21pYyBiYWNrZ3JvdW5kLgogUGF0aWVudCBoYXMgY29tcGxldGVkIHNvbWUgY29sbGVnZSBjb3Vyc2VzLgpQYXRpZW50IGN1cnJlbnRseSBoYXMgSHVtYW5hLgoKIyBBbGxlcmdpZXMKTm8gS25vd24gQWxsZXJnaWVzLgoKIyBNZWRpY2F0aW9ucwpObyBBY3RpdmUgTWVkaWNhdGlvbnMuCgojIEFzc2Vzc21lbnQgYW5kIFBsYW4KCgojIyBQbGFuCgo=" + } ] + }, + "request": { + "method": "POST", + "url": "DiagnosticReport" + } + }, { + "fullUrl": "urn:uuid:019aee1e-cea4-9427-1831-0791917128f3", + "resource": { + "resourceType": "DocumentReference", + "id": "019aee1e-cea4-9427-1831-0791917128f3", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-documentreference" ] + }, + "identifier": [ { + "system": "urn:ietf:rfc:3986", + "value": "urn:uuid:c3564fd7-e5cc-5710-0294-ee79ef8c2413" + } ], + "status": "superseded", + "type": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "category": [ { + "coding": [ { + "system": "http://hl7.org/fhir/us/core/CodeSystem/us-core-documentreference-category", + "code": "clinical-note", + "display": "Clinical Note" + } ] + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "date": "2011-12-26T11:44:52.558-05:00", + "author": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } ], + "custodian": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "content": [ { + "attachment": { + "contentType": "text/plain; charset=utf-8", + "data": "CjIwMTEtMTItMjYKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgNjEgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuIFBhdGllbnQgaGFzIGEgaGlzdG9yeSBvZiBhY3V0ZSB2aXJhbCBwaGFyeW5naXRpcyAoZGlzb3JkZXIpLCB2aXJhbCBzaW51c2l0aXMgKGRpc29yZGVyKS4KCiMgU29jaWFsIEhpc3RvcnkKUGF0aWVudCBpcyBtYXJyaWVkLiBQYXRpZW50IGlzIGFuIGFjdGl2ZSBzbW9rZXIgYW5kIGlzIGFuIGFsY29ob2xpYy4KIFBhdGllbnQgaWRlbnRpZmllcyBhcyBoZXRlcm9zZXh1YWwuCgpQYXRpZW50IGNvbWVzIGZyb20gYSBtaWRkbGUgc29jaW9lY29ub21pYyBiYWNrZ3JvdW5kLgogUGF0aWVudCBoYXMgY29tcGxldGVkIHNvbWUgY29sbGVnZSBjb3Vyc2VzLgpQYXRpZW50IGN1cnJlbnRseSBoYXMgSHVtYW5hLgoKIyBBbGxlcmdpZXMKTm8gS25vd24gQWxsZXJnaWVzLgoKIyBNZWRpY2F0aW9ucwpObyBBY3RpdmUgTWVkaWNhdGlvbnMuCgojIEFzc2Vzc21lbnQgYW5kIFBsYW4KCgojIyBQbGFuCgo=" + }, + "format": { + "system": "http://ihe.net/fhir/ValueSet/IHE.FormatCode.codesystem", + "code": "urn:ihe:iti:xds:2017:mimeTypeSufficient", + "display": "mimeType Sufficient" + } + } ], + "context": { + "encounter": [ { + "reference": "urn:uuid:9178a2d6-01da-6b77-911c-fb668a9d2d06" + } ], + "period": { + "start": "2011-12-26T11:44:52-05:00", + "end": "2011-12-26T11:59:52-05:00" + } + } + }, + "request": { + "method": "POST", + "url": "DocumentReference" + } + }, { + "fullUrl": "urn:uuid:5e599792-9633-86b8-6f3a-6c6db3ecf76a", + "resource": { + "resourceType": "Claim", + "id": "5e599792-9633-86b8-6f3a-6c6db3ecf76a", + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Lindsay928 Gerlach374" + }, + "billablePeriod": { + "start": "2011-12-26T11:44:52-05:00", + "end": "2011-12-26T11:59:52-05:00" + }, + "created": "2011-12-26T11:59:52-05:00", + "provider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "priority": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } ] + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "insurance": [ { + "sequence": 1, + "focal": true, + "coverage": { + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "1234", + "display": "SNOMED Code" + } ], + "text": "SNOMED Code" + }, + "encounter": [ { + "reference": "urn:uuid:9178a2d6-01da-6b77-911c-fb668a9d2d06" + } ] + } ], + "total": { + "value": 129.16, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, { + "fullUrl": "urn:uuid:e995b751-7a50-5a1c-d83e-aec2ce535655", + "resource": { + "resourceType": "ExplanationOfBenefit", + "id": "e995b751-7a50-5a1c-d83e-aec2ce535655", + "contained": [ { + "resourceType": "ServiceRequest", + "id": "referral", + "status": "completed", + "intent": "order", + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "requester": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + } ] + }, { + "resourceType": "Coverage", + "id": "coverage", + "status": "active", + "type": { + "text": "Humana" + }, + "beneficiary": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "payor": [ { + "display": "Humana" + } ] + } ], + "identifier": [ { + "system": "https://bluebutton.cms.gov/resources/variables/clm_id", + "value": "5e599792-9633-86b8-6f3a-6c6db3ecf76a" + }, { + "system": "https://bluebutton.cms.gov/resources/identifier/claim-group", + "value": "99999999999" + } ], + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "billablePeriod": { + "start": "2011-12-26T11:59:52-05:00", + "end": "2012-12-26T11:59:52-05:00" + }, + "created": "2011-12-26T11:59:52-05:00", + "insurer": { + "display": "Humana" + }, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "referral": { + "reference": "#referral" + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "claim": { + "reference": "urn:uuid:5e599792-9633-86b8-6f3a-6c6db3ecf76a" + }, + "outcome": "complete", + "careTeam": [ { + "sequence": 1, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "role": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", + "code": "primary", + "display": "Primary Care Practitioner" + } ] + } + } ], + "insurance": [ { + "focal": true, + "coverage": { + "reference": "#coverage", + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } ] + }, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "1234", + "display": "SNOMED Code" + } ], + "text": "SNOMED Code" + }, + "servicedPeriod": { + "start": "2011-12-26T11:44:52-05:00", + "end": "2011-12-26T11:59:52-05:00" + }, + "locationCodeableConcept": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "21", + "display": "Inpatient Hospital" + } ] + }, + "encounter": [ { + "reference": "urn:uuid:9178a2d6-01da-6b77-911c-fb668a9d2d06" + } ] + } ], + "total": [ { + "category": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/adjudication", + "code": "submitted", + "display": "Submitted Amount" + } ], + "text": "Submitted Amount" + }, + "amount": { + "value": 129.16, + "currency": "USD" + } + } ], + "payment": { + "amount": { + "value": 0.0, + "currency": "USD" + } + } + }, + "request": { + "method": "POST", + "url": "ExplanationOfBenefit" + } + }, { + "fullUrl": "urn:uuid:4194a4b1-ab19-d741-b807-a9e5d81778e3", + "resource": { + "resourceType": "Encounter", + "id": "4194a4b1-ab19-d741-b807-a9e5d81778e3", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter", "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter" ] + }, + "identifier": [ { + "use": "official", + "system": "https://github.com/synthetichealth/synthea", + "value": "4194a4b1-ab19-d741-b807-a9e5d81778e3" + } ], + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB" + }, + "type": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "185349003", + "display": "Encounter for 'check-up'" + } ], + "text": "Encounter for 'check-up'" + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Mr. Lindsay928 Gerlach374" + }, + "participant": [ { + "type": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType", + "code": "PPRF", + "display": "primary performer" + } ], + "text": "primary performer" + } ], + "period": { + "start": "2012-01-26T13:13:18-05:00", + "end": "2012-01-26T13:52:24-05:00" + }, + "individual": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } + } ], + "period": { + "start": "2012-01-26T13:13:18-05:00", + "end": "2012-01-26T13:52:24-05:00" + }, + "location": [ { + "location": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + } ], + "serviceProvider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + }, + "request": { + "method": "POST", + "url": "Encounter" + } + }, { + "fullUrl": "urn:uuid:c0ee21e2-c225-41ad-18d1-357eb126cd32", + "resource": { + "resourceType": "Procedure", + "id": "c0ee21e2-c225-41ad-18d1-357eb126cd32", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-procedure" ] + }, + "status": "completed", + "code": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "73761001", + "display": "Colonoscopy" + } ], + "text": "Colonoscopy" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:4194a4b1-ab19-d741-b807-a9e5d81778e3" + }, + "performedPeriod": { + "start": "2012-01-26T13:13:18-05:00", + "end": "2012-01-26T13:52:24-05:00" + }, + "location": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + }, + "request": { + "method": "POST", + "url": "Procedure" + } + }, { + "fullUrl": "urn:uuid:3a0dafb4-e94f-80c3-1f1a-cf7b82cf913a", + "resource": { + "resourceType": "DiagnosticReport", + "id": "3a0dafb4-e94f-80c3-1f1a-cf7b82cf913a", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-note" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:4194a4b1-ab19-d741-b807-a9e5d81778e3" + }, + "effectiveDateTime": "2012-01-26T13:13:18-05:00", + "issued": "2012-01-26T13:13:18.558-05:00", + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } ], + "presentedForm": [ { + "contentType": "text/plain; charset=utf-8", + "data": "CjIwMTItMDEtMjYKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgNjEgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuIFBhdGllbnQgaGFzIGEgaGlzdG9yeSBvZiBhY3V0ZSB2aXJhbCBwaGFyeW5naXRpcyAoZGlzb3JkZXIpLCB2aXJhbCBzaW51c2l0aXMgKGRpc29yZGVyKS4KCiMgU29jaWFsIEhpc3RvcnkKUGF0aWVudCBpcyBtYXJyaWVkLiBQYXRpZW50IGlzIGFuIGFjdGl2ZSBzbW9rZXIgYW5kIGlzIGFuIGFsY29ob2xpYy4KIFBhdGllbnQgaWRlbnRpZmllcyBhcyBoZXRlcm9zZXh1YWwuCgpQYXRpZW50IGNvbWVzIGZyb20gYSBtaWRkbGUgc29jaW9lY29ub21pYyBiYWNrZ3JvdW5kLgogUGF0aWVudCBoYXMgY29tcGxldGVkIHNvbWUgY29sbGVnZSBjb3Vyc2VzLgpQYXRpZW50IGN1cnJlbnRseSBoYXMgSHVtYW5hLgoKIyBBbGxlcmdpZXMKTm8gS25vd24gQWxsZXJnaWVzLgoKIyBNZWRpY2F0aW9ucwpObyBBY3RpdmUgTWVkaWNhdGlvbnMuCgojIEFzc2Vzc21lbnQgYW5kIFBsYW4KCgojIyBQbGFuCgpUaGUgZm9sbG93aW5nIHByb2NlZHVyZXMgd2VyZSBjb25kdWN0ZWQ6Ci0gY29sb25vc2NvcHkK" + } ] + }, + "request": { + "method": "POST", + "url": "DiagnosticReport" + } + }, { + "fullUrl": "urn:uuid:5d54cab0-c0a1-1945-3b95-7149538151e9", + "resource": { + "resourceType": "DocumentReference", + "id": "5d54cab0-c0a1-1945-3b95-7149538151e9", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-documentreference" ] + }, + "identifier": [ { + "system": "urn:ietf:rfc:3986", + "value": "urn:uuid:3a0dafb4-e94f-80c3-1f1a-cf7b82cf913a" + } ], + "status": "superseded", + "type": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "category": [ { + "coding": [ { + "system": "http://hl7.org/fhir/us/core/CodeSystem/us-core-documentreference-category", + "code": "clinical-note", + "display": "Clinical Note" + } ] + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "date": "2012-01-26T13:13:18.558-05:00", + "author": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } ], + "custodian": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "content": [ { + "attachment": { + "contentType": "text/plain; charset=utf-8", + "data": "CjIwMTItMDEtMjYKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgNjEgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuIFBhdGllbnQgaGFzIGEgaGlzdG9yeSBvZiBhY3V0ZSB2aXJhbCBwaGFyeW5naXRpcyAoZGlzb3JkZXIpLCB2aXJhbCBzaW51c2l0aXMgKGRpc29yZGVyKS4KCiMgU29jaWFsIEhpc3RvcnkKUGF0aWVudCBpcyBtYXJyaWVkLiBQYXRpZW50IGlzIGFuIGFjdGl2ZSBzbW9rZXIgYW5kIGlzIGFuIGFsY29ob2xpYy4KIFBhdGllbnQgaWRlbnRpZmllcyBhcyBoZXRlcm9zZXh1YWwuCgpQYXRpZW50IGNvbWVzIGZyb20gYSBtaWRkbGUgc29jaW9lY29ub21pYyBiYWNrZ3JvdW5kLgogUGF0aWVudCBoYXMgY29tcGxldGVkIHNvbWUgY29sbGVnZSBjb3Vyc2VzLgpQYXRpZW50IGN1cnJlbnRseSBoYXMgSHVtYW5hLgoKIyBBbGxlcmdpZXMKTm8gS25vd24gQWxsZXJnaWVzLgoKIyBNZWRpY2F0aW9ucwpObyBBY3RpdmUgTWVkaWNhdGlvbnMuCgojIEFzc2Vzc21lbnQgYW5kIFBsYW4KCgojIyBQbGFuCgpUaGUgZm9sbG93aW5nIHByb2NlZHVyZXMgd2VyZSBjb25kdWN0ZWQ6Ci0gY29sb25vc2NvcHkK" + }, + "format": { + "system": "http://ihe.net/fhir/ValueSet/IHE.FormatCode.codesystem", + "code": "urn:ihe:iti:xds:2017:mimeTypeSufficient", + "display": "mimeType Sufficient" + } + } ], + "context": { + "encounter": [ { + "reference": "urn:uuid:4194a4b1-ab19-d741-b807-a9e5d81778e3" + } ], + "period": { + "start": "2012-01-26T13:13:18-05:00", + "end": "2012-01-26T13:52:24-05:00" + } + } + }, + "request": { + "method": "POST", + "url": "DocumentReference" + } + }, { + "fullUrl": "urn:uuid:017b656f-7ab9-bb1a-8efd-043cdbf3b890", + "resource": { + "resourceType": "Claim", + "id": "017b656f-7ab9-bb1a-8efd-043cdbf3b890", + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Lindsay928 Gerlach374" + }, + "billablePeriod": { + "start": "2012-01-26T13:13:18-05:00", + "end": "2012-01-26T13:52:24-05:00" + }, + "created": "2012-01-26T13:52:24-05:00", + "provider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "priority": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } ] + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "procedure": [ { + "sequence": 1, + "procedureReference": { + "reference": "urn:uuid:c0ee21e2-c225-41ad-18d1-357eb126cd32" + } + } ], + "insurance": [ { + "sequence": 1, + "focal": true, + "coverage": { + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "185349003", + "display": "Encounter for 'check-up'" + } ], + "text": "Encounter for 'check-up'" + }, + "encounter": [ { + "reference": "urn:uuid:4194a4b1-ab19-d741-b807-a9e5d81778e3" + } ] + }, { + "sequence": 2, + "procedureSequence": [ 1 ], + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "73761001", + "display": "Colonoscopy" + } ], + "text": "Colonoscopy" + }, + "net": { + "value": 11518.88, + "currency": "USD" + } + } ], + "total": { + "value": 77.49, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, { + "fullUrl": "urn:uuid:d1cd3427-2340-6750-2db0-2956de224a7d", + "resource": { + "resourceType": "ExplanationOfBenefit", + "id": "d1cd3427-2340-6750-2db0-2956de224a7d", + "contained": [ { + "resourceType": "ServiceRequest", + "id": "referral", + "status": "completed", + "intent": "order", + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "requester": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + } ] + }, { + "resourceType": "Coverage", + "id": "coverage", + "status": "active", + "type": { + "text": "Humana" + }, + "beneficiary": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "payor": [ { + "display": "Humana" + } ] + } ], + "identifier": [ { + "system": "https://bluebutton.cms.gov/resources/variables/clm_id", + "value": "017b656f-7ab9-bb1a-8efd-043cdbf3b890" + }, { + "system": "https://bluebutton.cms.gov/resources/identifier/claim-group", + "value": "99999999999" + } ], + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "billablePeriod": { + "start": "2012-01-26T13:52:24-05:00", + "end": "2013-01-26T13:52:24-05:00" + }, + "created": "2012-01-26T13:52:24-05:00", + "insurer": { + "display": "Humana" + }, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "referral": { + "reference": "#referral" + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "claim": { + "reference": "urn:uuid:017b656f-7ab9-bb1a-8efd-043cdbf3b890" + }, + "outcome": "complete", + "careTeam": [ { + "sequence": 1, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "role": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", + "code": "primary", + "display": "Primary Care Practitioner" + } ] + } + } ], + "insurance": [ { + "focal": true, + "coverage": { + "reference": "#coverage", + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } ] + }, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "185349003", + "display": "Encounter for 'check-up'" + } ], + "text": "Encounter for 'check-up'" + }, + "servicedPeriod": { + "start": "2012-01-26T13:13:18-05:00", + "end": "2012-01-26T13:52:24-05:00" + }, + "locationCodeableConcept": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "21", + "display": "Inpatient Hospital" + } ] + }, + "encounter": [ { + "reference": "urn:uuid:4194a4b1-ab19-d741-b807-a9e5d81778e3" + } ] + }, { + "sequence": 2, + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } ] + }, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "73761001", + "display": "Colonoscopy" + } ], + "text": "Colonoscopy" + }, + "servicedPeriod": { + "start": "2012-01-26T13:13:18-05:00", + "end": "2012-01-26T13:52:24-05:00" + }, + "locationCodeableConcept": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "21", + "display": "Inpatient Hospital" + } ] + }, + "net": { + "value": 11518.88, + "currency": "USD" + }, + "adjudication": [ { + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_coinsrnc_amt", + "display": "Line Beneficiary Coinsurance Amount" + } ] + }, + "amount": { + "value": 2303.776, + "currency": "USD" + } + }, { + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_prvdr_pmt_amt", + "display": "Line Provider Payment Amount" + } ] + }, + "amount": { + "value": 9215.104, + "currency": "USD" + } + }, { + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_sbmtd_chrg_amt", + "display": "Line Submitted Charge Amount" + } ] + }, + "amount": { + "value": 11518.88, + "currency": "USD" + } + }, { + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_alowd_chrg_amt", + "display": "Line Allowed Charge Amount" + } ] + }, + "amount": { + "value": 11518.88, + "currency": "USD" + } + }, { + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_bene_ptb_ddctbl_amt", + "display": "Line Beneficiary Part B Deductible Amount" + } ] + }, + "amount": { + "value": 0, + "currency": "USD" + } + }, { + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_prcsg_ind_cd", + "display": "Line Processing Indicator Code" + } ] + } + } ] + } ], + "total": [ { + "category": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/adjudication", + "code": "submitted", + "display": "Submitted Amount" + } ], + "text": "Submitted Amount" + }, + "amount": { + "value": 77.49, + "currency": "USD" + } + } ], + "payment": { + "amount": { + "value": 9215.104, + "currency": "USD" + } + } + }, + "request": { + "method": "POST", + "url": "ExplanationOfBenefit" + } + }, { + "fullUrl": "urn:uuid:68b79d88-4f21-7263-eed0-48288451fee8", + "resource": { + "resourceType": "Encounter", + "id": "68b79d88-4f21-7263-eed0-48288451fee8", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter", "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter" ] + }, + "identifier": [ { + "use": "official", + "system": "https://github.com/synthetichealth/synthea", + "value": "68b79d88-4f21-7263-eed0-48288451fee8" + } ], + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB" + }, + "type": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "1234", + "display": "SNOMED Code" + } ], + "text": "SNOMED Code" + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Mr. Lindsay928 Gerlach374" + }, + "participant": [ { + "type": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType", + "code": "PPRF", + "display": "primary performer" + } ], + "text": "primary performer" + } ], + "period": { + "start": "2012-03-25T12:44:52-04:00", + "end": "2012-03-25T12:59:52-04:00" + }, + "individual": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } + } ], + "period": { + "start": "2012-03-25T12:44:52-04:00", + "end": "2012-03-25T12:59:52-04:00" + }, + "reasonCode": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "274531002", + "display": "Abnormal findings diagnostic imaging heart+coronary circulat (finding)" + } ] + } ], + "location": [ { + "location": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + } ], + "serviceProvider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + }, + "request": { + "method": "POST", + "url": "Encounter" + } + }, { + "fullUrl": "urn:uuid:b00564c7-d333-e6bf-10df-1912823fcf12", + "resource": { + "resourceType": "Observation", + "id": "b00564c7-d333-e6bf-10df-1912823fcf12", + "meta": { + "profile": [ "http://hl7.org/fhir/StructureDefinition/bp", "http://hl7.org/fhir/StructureDefinition/vitalsigns" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "85354-9", + "display": "Blood Pressure" + } ], + "text": "Blood Pressure" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:68b79d88-4f21-7263-eed0-48288451fee8" + }, + "effectiveInstant": "2012-03-25T12:44:52-04:00", + "issued": "2012-03-25T12:44:52.558-04:00", + "component": [ { + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "8462-4", + "display": "Diastolic Blood Pressure" + } ], + "text": "Diastolic Blood Pressure" + }, + "valueQuantity": { + "value": 49, + "unit": "mm[Hg]", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + }, { + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "8480-6", + "display": "Systolic Blood Pressure" + } ], + "text": "Systolic Blood Pressure" + }, + "valueQuantity": { + "value": 136, + "unit": "mm[Hg]", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + } ] + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, { + "fullUrl": "urn:uuid:f06260fa-8f74-0b83-8b6e-1eb412e5a4ab", + "resource": { + "resourceType": "DiagnosticReport", + "id": "f06260fa-8f74-0b83-8b6e-1eb412e5a4ab", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-note" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:68b79d88-4f21-7263-eed0-48288451fee8" + }, + "effectiveDateTime": "2012-03-25T12:44:52-04:00", + "issued": "2012-03-25T12:44:52.558-04:00", + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } ], + "presentedForm": [ { + "contentType": "text/plain; charset=utf-8", + "data": "CjIwMTItMDMtMjUKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgNjEgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuIFBhdGllbnQgaGFzIGEgaGlzdG9yeSBvZiBhY3V0ZSB2aXJhbCBwaGFyeW5naXRpcyAoZGlzb3JkZXIpLCB2aXJhbCBzaW51c2l0aXMgKGRpc29yZGVyKS4KCiMgU29jaWFsIEhpc3RvcnkKUGF0aWVudCBpcyBtYXJyaWVkLiBQYXRpZW50IGlzIGFuIGFjdGl2ZSBzbW9rZXIgYW5kIGlzIGFuIGFsY29ob2xpYy4KIFBhdGllbnQgaWRlbnRpZmllcyBhcyBoZXRlcm9zZXh1YWwuCgpQYXRpZW50IGNvbWVzIGZyb20gYSBtaWRkbGUgc29jaW9lY29ub21pYyBiYWNrZ3JvdW5kLgogUGF0aWVudCBoYXMgY29tcGxldGVkIHNvbWUgY29sbGVnZSBjb3Vyc2VzLgpQYXRpZW50IGN1cnJlbnRseSBoYXMgSHVtYW5hLgoKIyBBbGxlcmdpZXMKTm8gS25vd24gQWxsZXJnaWVzLgoKIyBNZWRpY2F0aW9ucwpObyBBY3RpdmUgTWVkaWNhdGlvbnMuCgojIEFzc2Vzc21lbnQgYW5kIFBsYW4KCgojIyBQbGFuCgo=" + } ] + }, + "request": { + "method": "POST", + "url": "DiagnosticReport" + } + }, { + "fullUrl": "urn:uuid:4892d5a7-eb99-1387-65c7-c29e5c354a73", + "resource": { + "resourceType": "DocumentReference", + "id": "4892d5a7-eb99-1387-65c7-c29e5c354a73", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-documentreference" ] + }, + "identifier": [ { + "system": "urn:ietf:rfc:3986", + "value": "urn:uuid:f06260fa-8f74-0b83-8b6e-1eb412e5a4ab" + } ], + "status": "superseded", + "type": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "category": [ { + "coding": [ { + "system": "http://hl7.org/fhir/us/core/CodeSystem/us-core-documentreference-category", + "code": "clinical-note", + "display": "Clinical Note" + } ] + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "date": "2012-03-25T12:44:52.558-04:00", + "author": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } ], + "custodian": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "content": [ { + "attachment": { + "contentType": "text/plain; charset=utf-8", + "data": "CjIwMTItMDMtMjUKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgNjEgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuIFBhdGllbnQgaGFzIGEgaGlzdG9yeSBvZiBhY3V0ZSB2aXJhbCBwaGFyeW5naXRpcyAoZGlzb3JkZXIpLCB2aXJhbCBzaW51c2l0aXMgKGRpc29yZGVyKS4KCiMgU29jaWFsIEhpc3RvcnkKUGF0aWVudCBpcyBtYXJyaWVkLiBQYXRpZW50IGlzIGFuIGFjdGl2ZSBzbW9rZXIgYW5kIGlzIGFuIGFsY29ob2xpYy4KIFBhdGllbnQgaWRlbnRpZmllcyBhcyBoZXRlcm9zZXh1YWwuCgpQYXRpZW50IGNvbWVzIGZyb20gYSBtaWRkbGUgc29jaW9lY29ub21pYyBiYWNrZ3JvdW5kLgogUGF0aWVudCBoYXMgY29tcGxldGVkIHNvbWUgY29sbGVnZSBjb3Vyc2VzLgpQYXRpZW50IGN1cnJlbnRseSBoYXMgSHVtYW5hLgoKIyBBbGxlcmdpZXMKTm8gS25vd24gQWxsZXJnaWVzLgoKIyBNZWRpY2F0aW9ucwpObyBBY3RpdmUgTWVkaWNhdGlvbnMuCgojIEFzc2Vzc21lbnQgYW5kIFBsYW4KCgojIyBQbGFuCgo=" + }, + "format": { + "system": "http://ihe.net/fhir/ValueSet/IHE.FormatCode.codesystem", + "code": "urn:ihe:iti:xds:2017:mimeTypeSufficient", + "display": "mimeType Sufficient" + } + } ], + "context": { + "encounter": [ { + "reference": "urn:uuid:68b79d88-4f21-7263-eed0-48288451fee8" + } ], + "period": { + "start": "2012-03-25T12:44:52-04:00", + "end": "2012-03-25T12:59:52-04:00" + } + } + }, + "request": { + "method": "POST", + "url": "DocumentReference" + } + }, { + "fullUrl": "urn:uuid:276f4098-99a8-38a0-d4c1-094805ff4324", + "resource": { + "resourceType": "Claim", + "id": "276f4098-99a8-38a0-d4c1-094805ff4324", + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Lindsay928 Gerlach374" + }, + "billablePeriod": { + "start": "2012-03-25T12:44:52-04:00", + "end": "2012-03-25T12:59:52-04:00" + }, + "created": "2012-03-25T12:59:52-04:00", + "provider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "priority": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } ] + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "insurance": [ { + "sequence": 1, + "focal": true, + "coverage": { + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "1234", + "display": "SNOMED Code" + } ], + "text": "SNOMED Code" + }, + "encounter": [ { + "reference": "urn:uuid:68b79d88-4f21-7263-eed0-48288451fee8" + } ] + } ], + "total": { + "value": 129.16, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, { + "fullUrl": "urn:uuid:c36eb0f3-6487-c722-615e-1147d435aa8f", + "resource": { + "resourceType": "ExplanationOfBenefit", + "id": "c36eb0f3-6487-c722-615e-1147d435aa8f", + "contained": [ { + "resourceType": "ServiceRequest", + "id": "referral", + "status": "completed", + "intent": "order", + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "requester": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + } ] + }, { + "resourceType": "Coverage", + "id": "coverage", + "status": "active", + "type": { + "text": "Humana" + }, + "beneficiary": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "payor": [ { + "display": "Humana" + } ] + } ], + "identifier": [ { + "system": "https://bluebutton.cms.gov/resources/variables/clm_id", + "value": "276f4098-99a8-38a0-d4c1-094805ff4324" + }, { + "system": "https://bluebutton.cms.gov/resources/identifier/claim-group", + "value": "99999999999" + } ], + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "billablePeriod": { + "start": "2012-03-25T12:59:52-04:00", + "end": "2013-03-25T12:59:52-04:00" + }, + "created": "2012-03-25T12:59:52-04:00", + "insurer": { + "display": "Humana" + }, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "referral": { + "reference": "#referral" + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "claim": { + "reference": "urn:uuid:276f4098-99a8-38a0-d4c1-094805ff4324" + }, + "outcome": "complete", + "careTeam": [ { + "sequence": 1, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "role": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", + "code": "primary", + "display": "Primary Care Practitioner" + } ] + } + } ], + "insurance": [ { + "focal": true, + "coverage": { + "reference": "#coverage", + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } ] + }, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "1234", + "display": "SNOMED Code" + } ], + "text": "SNOMED Code" + }, + "servicedPeriod": { + "start": "2012-03-25T12:44:52-04:00", + "end": "2012-03-25T12:59:52-04:00" + }, + "locationCodeableConcept": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "21", + "display": "Inpatient Hospital" + } ] + }, + "encounter": [ { + "reference": "urn:uuid:68b79d88-4f21-7263-eed0-48288451fee8" + } ] + } ], + "total": [ { + "category": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/adjudication", + "code": "submitted", + "display": "Submitted Amount" + } ], + "text": "Submitted Amount" + }, + "amount": { + "value": 129.16, + "currency": "USD" + } + } ], + "payment": { + "amount": { + "value": 0.0, + "currency": "USD" + } + } + }, + "request": { + "method": "POST", + "url": "ExplanationOfBenefit" + } + }, { + "fullUrl": "urn:uuid:a496fb84-cfb8-dda5-8de2-d1c125198505", + "resource": { + "resourceType": "Encounter", + "id": "a496fb84-cfb8-dda5-8de2-d1c125198505", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter", "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter" ] + }, + "identifier": [ { + "use": "official", + "system": "https://github.com/synthetichealth/synthea", + "value": "a496fb84-cfb8-dda5-8de2-d1c125198505" + } ], + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB" + }, + "type": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "1234", + "display": "SNOMED Code" + } ], + "text": "SNOMED Code" + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Mr. Lindsay928 Gerlach374" + }, + "participant": [ { + "type": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType", + "code": "PPRF", + "display": "primary performer" + } ], + "text": "primary performer" + } ], + "period": { + "start": "2012-06-23T12:44:52-04:00", + "end": "2012-06-23T12:59:52-04:00" + }, + "individual": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } + } ], + "period": { + "start": "2012-06-23T12:44:52-04:00", + "end": "2012-06-23T12:59:52-04:00" + }, + "reasonCode": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "274531002", + "display": "Abnormal findings diagnostic imaging heart+coronary circulat (finding)" + } ] + } ], + "location": [ { + "location": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + } ], + "serviceProvider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + }, + "request": { + "method": "POST", + "url": "Encounter" + } + }, { + "fullUrl": "urn:uuid:fb4b6063-b286-e50c-aa8c-cc1943e320f8", + "resource": { + "resourceType": "Observation", + "id": "fb4b6063-b286-e50c-aa8c-cc1943e320f8", + "meta": { + "profile": [ "http://hl7.org/fhir/StructureDefinition/bp", "http://hl7.org/fhir/StructureDefinition/vitalsigns" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "85354-9", + "display": "Blood Pressure" + } ], + "text": "Blood Pressure" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:a496fb84-cfb8-dda5-8de2-d1c125198505" + }, + "effectiveInstant": "2012-06-23T12:44:52-04:00", + "issued": "2012-06-23T12:44:52.558-04:00", + "component": [ { + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "8462-4", + "display": "Diastolic Blood Pressure" + } ], + "text": "Diastolic Blood Pressure" + }, + "valueQuantity": { + "value": 49, + "unit": "mm[Hg]", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + }, { + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "8480-6", + "display": "Systolic Blood Pressure" + } ], + "text": "Systolic Blood Pressure" + }, + "valueQuantity": { + "value": 136, + "unit": "mm[Hg]", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + } ] + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, { + "fullUrl": "urn:uuid:54e775b6-a068-04c2-15c9-a4ef665c6ee1", + "resource": { + "resourceType": "DiagnosticReport", + "id": "54e775b6-a068-04c2-15c9-a4ef665c6ee1", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-note" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:a496fb84-cfb8-dda5-8de2-d1c125198505" + }, + "effectiveDateTime": "2012-06-23T12:44:52-04:00", + "issued": "2012-06-23T12:44:52.558-04:00", + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } ], + "presentedForm": [ { + "contentType": "text/plain; charset=utf-8", + "data": "CjIwMTItMDYtMjMKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgNjEgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuIFBhdGllbnQgaGFzIGEgaGlzdG9yeSBvZiBhY3V0ZSB2aXJhbCBwaGFyeW5naXRpcyAoZGlzb3JkZXIpLCB2aXJhbCBzaW51c2l0aXMgKGRpc29yZGVyKS4KCiMgU29jaWFsIEhpc3RvcnkKUGF0aWVudCBpcyBtYXJyaWVkLiBQYXRpZW50IGlzIGFuIGFjdGl2ZSBzbW9rZXIgYW5kIGlzIGFuIGFsY29ob2xpYy4KIFBhdGllbnQgaWRlbnRpZmllcyBhcyBoZXRlcm9zZXh1YWwuCgpQYXRpZW50IGNvbWVzIGZyb20gYSBtaWRkbGUgc29jaW9lY29ub21pYyBiYWNrZ3JvdW5kLgogUGF0aWVudCBoYXMgY29tcGxldGVkIHNvbWUgY29sbGVnZSBjb3Vyc2VzLgpQYXRpZW50IGN1cnJlbnRseSBoYXMgSHVtYW5hLgoKIyBBbGxlcmdpZXMKTm8gS25vd24gQWxsZXJnaWVzLgoKIyBNZWRpY2F0aW9ucwpObyBBY3RpdmUgTWVkaWNhdGlvbnMuCgojIEFzc2Vzc21lbnQgYW5kIFBsYW4KCgojIyBQbGFuCgo=" + } ] + }, + "request": { + "method": "POST", + "url": "DiagnosticReport" + } + }, { + "fullUrl": "urn:uuid:ff9d6bce-3a3a-1747-7889-d84be1ee7363", + "resource": { + "resourceType": "DocumentReference", + "id": "ff9d6bce-3a3a-1747-7889-d84be1ee7363", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-documentreference" ] + }, + "identifier": [ { + "system": "urn:ietf:rfc:3986", + "value": "urn:uuid:54e775b6-a068-04c2-15c9-a4ef665c6ee1" + } ], + "status": "superseded", + "type": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "category": [ { + "coding": [ { + "system": "http://hl7.org/fhir/us/core/CodeSystem/us-core-documentreference-category", + "code": "clinical-note", + "display": "Clinical Note" + } ] + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "date": "2012-06-23T12:44:52.558-04:00", + "author": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } ], + "custodian": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "content": [ { + "attachment": { + "contentType": "text/plain; charset=utf-8", + "data": "CjIwMTItMDYtMjMKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgNjEgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuIFBhdGllbnQgaGFzIGEgaGlzdG9yeSBvZiBhY3V0ZSB2aXJhbCBwaGFyeW5naXRpcyAoZGlzb3JkZXIpLCB2aXJhbCBzaW51c2l0aXMgKGRpc29yZGVyKS4KCiMgU29jaWFsIEhpc3RvcnkKUGF0aWVudCBpcyBtYXJyaWVkLiBQYXRpZW50IGlzIGFuIGFjdGl2ZSBzbW9rZXIgYW5kIGlzIGFuIGFsY29ob2xpYy4KIFBhdGllbnQgaWRlbnRpZmllcyBhcyBoZXRlcm9zZXh1YWwuCgpQYXRpZW50IGNvbWVzIGZyb20gYSBtaWRkbGUgc29jaW9lY29ub21pYyBiYWNrZ3JvdW5kLgogUGF0aWVudCBoYXMgY29tcGxldGVkIHNvbWUgY29sbGVnZSBjb3Vyc2VzLgpQYXRpZW50IGN1cnJlbnRseSBoYXMgSHVtYW5hLgoKIyBBbGxlcmdpZXMKTm8gS25vd24gQWxsZXJnaWVzLgoKIyBNZWRpY2F0aW9ucwpObyBBY3RpdmUgTWVkaWNhdGlvbnMuCgojIEFzc2Vzc21lbnQgYW5kIFBsYW4KCgojIyBQbGFuCgo=" + }, + "format": { + "system": "http://ihe.net/fhir/ValueSet/IHE.FormatCode.codesystem", + "code": "urn:ihe:iti:xds:2017:mimeTypeSufficient", + "display": "mimeType Sufficient" + } + } ], + "context": { + "encounter": [ { + "reference": "urn:uuid:a496fb84-cfb8-dda5-8de2-d1c125198505" + } ], + "period": { + "start": "2012-06-23T12:44:52-04:00", + "end": "2012-06-23T12:59:52-04:00" + } + } + }, + "request": { + "method": "POST", + "url": "DocumentReference" + } + }, { + "fullUrl": "urn:uuid:26ebfe78-94bb-e2ea-9d8d-fd18091137af", + "resource": { + "resourceType": "Claim", + "id": "26ebfe78-94bb-e2ea-9d8d-fd18091137af", + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Lindsay928 Gerlach374" + }, + "billablePeriod": { + "start": "2012-06-23T12:44:52-04:00", + "end": "2012-06-23T12:59:52-04:00" + }, + "created": "2012-06-23T12:59:52-04:00", + "provider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "priority": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } ] + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "insurance": [ { + "sequence": 1, + "focal": true, + "coverage": { + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "1234", + "display": "SNOMED Code" + } ], + "text": "SNOMED Code" + }, + "encounter": [ { + "reference": "urn:uuid:a496fb84-cfb8-dda5-8de2-d1c125198505" + } ] + } ], + "total": { + "value": 129.16, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, { + "fullUrl": "urn:uuid:0271a796-e05a-9ad7-ed80-4bce371fdc2a", + "resource": { + "resourceType": "ExplanationOfBenefit", + "id": "0271a796-e05a-9ad7-ed80-4bce371fdc2a", + "contained": [ { + "resourceType": "ServiceRequest", + "id": "referral", + "status": "completed", + "intent": "order", + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "requester": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + } ] + }, { + "resourceType": "Coverage", + "id": "coverage", + "status": "active", + "type": { + "text": "Humana" + }, + "beneficiary": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "payor": [ { + "display": "Humana" + } ] + } ], + "identifier": [ { + "system": "https://bluebutton.cms.gov/resources/variables/clm_id", + "value": "26ebfe78-94bb-e2ea-9d8d-fd18091137af" + }, { + "system": "https://bluebutton.cms.gov/resources/identifier/claim-group", + "value": "99999999999" + } ], + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "billablePeriod": { + "start": "2012-06-23T12:59:52-04:00", + "end": "2013-06-23T12:59:52-04:00" + }, + "created": "2012-06-23T12:59:52-04:00", + "insurer": { + "display": "Humana" + }, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "referral": { + "reference": "#referral" + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "claim": { + "reference": "urn:uuid:26ebfe78-94bb-e2ea-9d8d-fd18091137af" + }, + "outcome": "complete", + "careTeam": [ { + "sequence": 1, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "role": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", + "code": "primary", + "display": "Primary Care Practitioner" + } ] + } + } ], + "insurance": [ { + "focal": true, + "coverage": { + "reference": "#coverage", + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } ] + }, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "1234", + "display": "SNOMED Code" + } ], + "text": "SNOMED Code" + }, + "servicedPeriod": { + "start": "2012-06-23T12:44:52-04:00", + "end": "2012-06-23T12:59:52-04:00" + }, + "locationCodeableConcept": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "21", + "display": "Inpatient Hospital" + } ] + }, + "encounter": [ { + "reference": "urn:uuid:a496fb84-cfb8-dda5-8de2-d1c125198505" + } ] + } ], + "total": [ { + "category": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/adjudication", + "code": "submitted", + "display": "Submitted Amount" + } ], + "text": "Submitted Amount" + }, + "amount": { + "value": 129.16, + "currency": "USD" + } + } ], + "payment": { + "amount": { + "value": 0.0, + "currency": "USD" + } + } + }, + "request": { + "method": "POST", + "url": "ExplanationOfBenefit" + } + }, { + "fullUrl": "urn:uuid:cf27e6ec-d967-ec54-f893-5c72bc88b14d", + "resource": { + "resourceType": "Encounter", + "id": "cf27e6ec-d967-ec54-f893-5c72bc88b14d", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter", "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter" ] + }, + "identifier": [ { + "use": "official", + "system": "https://github.com/synthetichealth/synthea", + "value": "cf27e6ec-d967-ec54-f893-5c72bc88b14d" + } ], + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB" + }, + "type": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "1234", + "display": "SNOMED Code" + } ], + "text": "SNOMED Code" + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Mr. Lindsay928 Gerlach374" + }, + "participant": [ { + "type": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType", + "code": "PPRF", + "display": "primary performer" + } ], + "text": "primary performer" + } ], + "period": { + "start": "2012-09-21T12:44:52-04:00", + "end": "2012-09-21T12:59:52-04:00" + }, + "individual": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } + } ], + "period": { + "start": "2012-09-21T12:44:52-04:00", + "end": "2012-09-21T12:59:52-04:00" + }, + "reasonCode": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "274531002", + "display": "Abnormal findings diagnostic imaging heart+coronary circulat (finding)" + } ] + } ], + "location": [ { + "location": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + } ], + "serviceProvider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + }, + "request": { + "method": "POST", + "url": "Encounter" + } + }, { + "fullUrl": "urn:uuid:406ab338-2e4d-1c47-947a-4fc2aa6b7acd", + "resource": { + "resourceType": "Observation", + "id": "406ab338-2e4d-1c47-947a-4fc2aa6b7acd", + "meta": { + "profile": [ "http://hl7.org/fhir/StructureDefinition/bp", "http://hl7.org/fhir/StructureDefinition/vitalsigns" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "85354-9", + "display": "Blood Pressure" + } ], + "text": "Blood Pressure" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:cf27e6ec-d967-ec54-f893-5c72bc88b14d" + }, + "effectiveInstant": "2012-09-21T12:44:52-04:00", + "issued": "2012-09-21T12:44:52.558-04:00", + "component": [ { + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "8462-4", + "display": "Diastolic Blood Pressure" + } ], + "text": "Diastolic Blood Pressure" + }, + "valueQuantity": { + "value": 49, + "unit": "mm[Hg]", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + }, { + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "8480-6", + "display": "Systolic Blood Pressure" + } ], + "text": "Systolic Blood Pressure" + }, + "valueQuantity": { + "value": 136, + "unit": "mm[Hg]", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + } ] + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, { + "fullUrl": "urn:uuid:7fdd6883-af93-f8fb-321d-d7ad593640fb", + "resource": { + "resourceType": "DiagnosticReport", + "id": "7fdd6883-af93-f8fb-321d-d7ad593640fb", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-note" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:cf27e6ec-d967-ec54-f893-5c72bc88b14d" + }, + "effectiveDateTime": "2012-09-21T12:44:52-04:00", + "issued": "2012-09-21T12:44:52.558-04:00", + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } ], + "presentedForm": [ { + "contentType": "text/plain; charset=utf-8", + "data": "CjIwMTItMDktMjEKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgNjEgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuIFBhdGllbnQgaGFzIGEgaGlzdG9yeSBvZiBhY3V0ZSB2aXJhbCBwaGFyeW5naXRpcyAoZGlzb3JkZXIpLCB2aXJhbCBzaW51c2l0aXMgKGRpc29yZGVyKS4KCiMgU29jaWFsIEhpc3RvcnkKUGF0aWVudCBpcyBtYXJyaWVkLiBQYXRpZW50IGlzIGFuIGFjdGl2ZSBzbW9rZXIgYW5kIGlzIGFuIGFsY29ob2xpYy4KIFBhdGllbnQgaWRlbnRpZmllcyBhcyBoZXRlcm9zZXh1YWwuCgpQYXRpZW50IGNvbWVzIGZyb20gYSBtaWRkbGUgc29jaW9lY29ub21pYyBiYWNrZ3JvdW5kLgogUGF0aWVudCBoYXMgY29tcGxldGVkIHNvbWUgY29sbGVnZSBjb3Vyc2VzLgpQYXRpZW50IGN1cnJlbnRseSBoYXMgSHVtYW5hLgoKIyBBbGxlcmdpZXMKTm8gS25vd24gQWxsZXJnaWVzLgoKIyBNZWRpY2F0aW9ucwpObyBBY3RpdmUgTWVkaWNhdGlvbnMuCgojIEFzc2Vzc21lbnQgYW5kIFBsYW4KCgojIyBQbGFuCgo=" + } ] + }, + "request": { + "method": "POST", + "url": "DiagnosticReport" + } + }, { + "fullUrl": "urn:uuid:227fc7be-7be6-a423-1cb4-d30203f3546c", + "resource": { + "resourceType": "DocumentReference", + "id": "227fc7be-7be6-a423-1cb4-d30203f3546c", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-documentreference" ] + }, + "identifier": [ { + "system": "urn:ietf:rfc:3986", + "value": "urn:uuid:7fdd6883-af93-f8fb-321d-d7ad593640fb" + } ], + "status": "superseded", + "type": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "category": [ { + "coding": [ { + "system": "http://hl7.org/fhir/us/core/CodeSystem/us-core-documentreference-category", + "code": "clinical-note", + "display": "Clinical Note" + } ] + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "date": "2012-09-21T12:44:52.558-04:00", + "author": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } ], + "custodian": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "content": [ { + "attachment": { + "contentType": "text/plain; charset=utf-8", + "data": "CjIwMTItMDktMjEKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgNjEgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuIFBhdGllbnQgaGFzIGEgaGlzdG9yeSBvZiBhY3V0ZSB2aXJhbCBwaGFyeW5naXRpcyAoZGlzb3JkZXIpLCB2aXJhbCBzaW51c2l0aXMgKGRpc29yZGVyKS4KCiMgU29jaWFsIEhpc3RvcnkKUGF0aWVudCBpcyBtYXJyaWVkLiBQYXRpZW50IGlzIGFuIGFjdGl2ZSBzbW9rZXIgYW5kIGlzIGFuIGFsY29ob2xpYy4KIFBhdGllbnQgaWRlbnRpZmllcyBhcyBoZXRlcm9zZXh1YWwuCgpQYXRpZW50IGNvbWVzIGZyb20gYSBtaWRkbGUgc29jaW9lY29ub21pYyBiYWNrZ3JvdW5kLgogUGF0aWVudCBoYXMgY29tcGxldGVkIHNvbWUgY29sbGVnZSBjb3Vyc2VzLgpQYXRpZW50IGN1cnJlbnRseSBoYXMgSHVtYW5hLgoKIyBBbGxlcmdpZXMKTm8gS25vd24gQWxsZXJnaWVzLgoKIyBNZWRpY2F0aW9ucwpObyBBY3RpdmUgTWVkaWNhdGlvbnMuCgojIEFzc2Vzc21lbnQgYW5kIFBsYW4KCgojIyBQbGFuCgo=" + }, + "format": { + "system": "http://ihe.net/fhir/ValueSet/IHE.FormatCode.codesystem", + "code": "urn:ihe:iti:xds:2017:mimeTypeSufficient", + "display": "mimeType Sufficient" + } + } ], + "context": { + "encounter": [ { + "reference": "urn:uuid:cf27e6ec-d967-ec54-f893-5c72bc88b14d" + } ], + "period": { + "start": "2012-09-21T12:44:52-04:00", + "end": "2012-09-21T12:59:52-04:00" + } + } + }, + "request": { + "method": "POST", + "url": "DocumentReference" + } + }, { + "fullUrl": "urn:uuid:f35adb88-6cb3-791e-3b1e-7067e80167dc", + "resource": { + "resourceType": "Claim", + "id": "f35adb88-6cb3-791e-3b1e-7067e80167dc", + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Lindsay928 Gerlach374" + }, + "billablePeriod": { + "start": "2012-09-21T12:44:52-04:00", + "end": "2012-09-21T12:59:52-04:00" + }, + "created": "2012-09-21T12:59:52-04:00", + "provider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "priority": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } ] + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "insurance": [ { + "sequence": 1, + "focal": true, + "coverage": { + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "1234", + "display": "SNOMED Code" + } ], + "text": "SNOMED Code" + }, + "encounter": [ { + "reference": "urn:uuid:cf27e6ec-d967-ec54-f893-5c72bc88b14d" + } ] + } ], + "total": { + "value": 129.16, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, { + "fullUrl": "urn:uuid:7256d64c-4f32-937c-c7c7-0c942118e44f", + "resource": { + "resourceType": "ExplanationOfBenefit", + "id": "7256d64c-4f32-937c-c7c7-0c942118e44f", + "contained": [ { + "resourceType": "ServiceRequest", + "id": "referral", + "status": "completed", + "intent": "order", + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "requester": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + } ] + }, { + "resourceType": "Coverage", + "id": "coverage", + "status": "active", + "type": { + "text": "Humana" + }, + "beneficiary": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "payor": [ { + "display": "Humana" + } ] + } ], + "identifier": [ { + "system": "https://bluebutton.cms.gov/resources/variables/clm_id", + "value": "f35adb88-6cb3-791e-3b1e-7067e80167dc" + }, { + "system": "https://bluebutton.cms.gov/resources/identifier/claim-group", + "value": "99999999999" + } ], + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "billablePeriod": { + "start": "2012-09-21T12:59:52-04:00", + "end": "2013-09-21T12:59:52-04:00" + }, + "created": "2012-09-21T12:59:52-04:00", + "insurer": { + "display": "Humana" + }, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "referral": { + "reference": "#referral" + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "claim": { + "reference": "urn:uuid:f35adb88-6cb3-791e-3b1e-7067e80167dc" + }, + "outcome": "complete", + "careTeam": [ { + "sequence": 1, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "role": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", + "code": "primary", + "display": "Primary Care Practitioner" + } ] + } + } ], + "insurance": [ { + "focal": true, + "coverage": { + "reference": "#coverage", + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } ] + }, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "1234", + "display": "SNOMED Code" + } ], + "text": "SNOMED Code" + }, + "servicedPeriod": { + "start": "2012-09-21T12:44:52-04:00", + "end": "2012-09-21T12:59:52-04:00" + }, + "locationCodeableConcept": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "21", + "display": "Inpatient Hospital" + } ] + }, + "encounter": [ { + "reference": "urn:uuid:cf27e6ec-d967-ec54-f893-5c72bc88b14d" + } ] + } ], + "total": [ { + "category": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/adjudication", + "code": "submitted", + "display": "Submitted Amount" + } ], + "text": "Submitted Amount" + }, + "amount": { + "value": 129.16, + "currency": "USD" + } + } ], + "payment": { + "amount": { + "value": 0.0, + "currency": "USD" + } + } + }, + "request": { + "method": "POST", + "url": "ExplanationOfBenefit" + } + }, { + "fullUrl": "urn:uuid:15483d93-355e-b9c0-d240-3fb7720fdb78", + "resource": { + "resourceType": "Encounter", + "id": "15483d93-355e-b9c0-d240-3fb7720fdb78", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter", "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter" ] + }, + "identifier": [ { + "use": "official", + "system": "https://github.com/synthetichealth/synthea", + "value": "15483d93-355e-b9c0-d240-3fb7720fdb78" + } ], + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB" + }, + "type": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "1234", + "display": "SNOMED Code" + } ], + "text": "SNOMED Code" + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Mr. Lindsay928 Gerlach374" + }, + "participant": [ { + "type": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType", + "code": "PPRF", + "display": "primary performer" + } ], + "text": "primary performer" + } ], + "period": { + "start": "2012-12-20T11:44:52-05:00", + "end": "2012-12-20T11:59:52-05:00" + }, + "individual": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } + } ], + "period": { + "start": "2012-12-20T11:44:52-05:00", + "end": "2012-12-20T11:59:52-05:00" + }, + "reasonCode": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "274531002", + "display": "Abnormal findings diagnostic imaging heart+coronary circulat (finding)" + } ] + } ], + "location": [ { + "location": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + } ], + "serviceProvider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + }, + "request": { + "method": "POST", + "url": "Encounter" + } + }, { + "fullUrl": "urn:uuid:fb53f696-ab4b-b067-8347-ce3976003c5f", + "resource": { + "resourceType": "Observation", + "id": "fb53f696-ab4b-b067-8347-ce3976003c5f", + "meta": { + "profile": [ "http://hl7.org/fhir/StructureDefinition/bp", "http://hl7.org/fhir/StructureDefinition/vitalsigns" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "85354-9", + "display": "Blood Pressure" + } ], + "text": "Blood Pressure" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:15483d93-355e-b9c0-d240-3fb7720fdb78" + }, + "effectiveInstant": "2012-12-20T11:44:52-05:00", + "issued": "2012-12-20T11:44:52.558-05:00", + "component": [ { + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "8462-4", + "display": "Diastolic Blood Pressure" + } ], + "text": "Diastolic Blood Pressure" + }, + "valueQuantity": { + "value": 49, + "unit": "mm[Hg]", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + }, { + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "8480-6", + "display": "Systolic Blood Pressure" + } ], + "text": "Systolic Blood Pressure" + }, + "valueQuantity": { + "value": 136, + "unit": "mm[Hg]", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + } ] + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, { + "fullUrl": "urn:uuid:ecaf0816-6b60-3929-3f80-70a4598a2e3d", + "resource": { + "resourceType": "DiagnosticReport", + "id": "ecaf0816-6b60-3929-3f80-70a4598a2e3d", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-note" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:15483d93-355e-b9c0-d240-3fb7720fdb78" + }, + "effectiveDateTime": "2012-12-20T11:44:52-05:00", + "issued": "2012-12-20T11:44:52.558-05:00", + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } ], + "presentedForm": [ { + "contentType": "text/plain; charset=utf-8", + "data": "CjIwMTItMTItMjAKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgNjIgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuIFBhdGllbnQgaGFzIGEgaGlzdG9yeSBvZiBhY3V0ZSB2aXJhbCBwaGFyeW5naXRpcyAoZGlzb3JkZXIpLCB2aXJhbCBzaW51c2l0aXMgKGRpc29yZGVyKS4KCiMgU29jaWFsIEhpc3RvcnkKUGF0aWVudCBpcyBtYXJyaWVkLiBQYXRpZW50IGlzIGFuIGFjdGl2ZSBzbW9rZXIgYW5kIGlzIGFuIGFsY29ob2xpYy4KIFBhdGllbnQgaWRlbnRpZmllcyBhcyBoZXRlcm9zZXh1YWwuCgpQYXRpZW50IGNvbWVzIGZyb20gYSBtaWRkbGUgc29jaW9lY29ub21pYyBiYWNrZ3JvdW5kLgogUGF0aWVudCBoYXMgY29tcGxldGVkIHNvbWUgY29sbGVnZSBjb3Vyc2VzLgpQYXRpZW50IGN1cnJlbnRseSBoYXMgSHVtYW5hLgoKIyBBbGxlcmdpZXMKTm8gS25vd24gQWxsZXJnaWVzLgoKIyBNZWRpY2F0aW9ucwpObyBBY3RpdmUgTWVkaWNhdGlvbnMuCgojIEFzc2Vzc21lbnQgYW5kIFBsYW4KCgojIyBQbGFuCgo=" + } ] + }, + "request": { + "method": "POST", + "url": "DiagnosticReport" + } + }, { + "fullUrl": "urn:uuid:5bb82568-579a-427e-51da-a6e26326b5aa", + "resource": { + "resourceType": "DocumentReference", + "id": "5bb82568-579a-427e-51da-a6e26326b5aa", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-documentreference" ] + }, + "identifier": [ { + "system": "urn:ietf:rfc:3986", + "value": "urn:uuid:ecaf0816-6b60-3929-3f80-70a4598a2e3d" + } ], + "status": "superseded", + "type": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "category": [ { + "coding": [ { + "system": "http://hl7.org/fhir/us/core/CodeSystem/us-core-documentreference-category", + "code": "clinical-note", + "display": "Clinical Note" + } ] + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "date": "2012-12-20T11:44:52.558-05:00", + "author": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } ], + "custodian": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "content": [ { + "attachment": { + "contentType": "text/plain; charset=utf-8", + "data": "CjIwMTItMTItMjAKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgNjIgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuIFBhdGllbnQgaGFzIGEgaGlzdG9yeSBvZiBhY3V0ZSB2aXJhbCBwaGFyeW5naXRpcyAoZGlzb3JkZXIpLCB2aXJhbCBzaW51c2l0aXMgKGRpc29yZGVyKS4KCiMgU29jaWFsIEhpc3RvcnkKUGF0aWVudCBpcyBtYXJyaWVkLiBQYXRpZW50IGlzIGFuIGFjdGl2ZSBzbW9rZXIgYW5kIGlzIGFuIGFsY29ob2xpYy4KIFBhdGllbnQgaWRlbnRpZmllcyBhcyBoZXRlcm9zZXh1YWwuCgpQYXRpZW50IGNvbWVzIGZyb20gYSBtaWRkbGUgc29jaW9lY29ub21pYyBiYWNrZ3JvdW5kLgogUGF0aWVudCBoYXMgY29tcGxldGVkIHNvbWUgY29sbGVnZSBjb3Vyc2VzLgpQYXRpZW50IGN1cnJlbnRseSBoYXMgSHVtYW5hLgoKIyBBbGxlcmdpZXMKTm8gS25vd24gQWxsZXJnaWVzLgoKIyBNZWRpY2F0aW9ucwpObyBBY3RpdmUgTWVkaWNhdGlvbnMuCgojIEFzc2Vzc21lbnQgYW5kIFBsYW4KCgojIyBQbGFuCgo=" + }, + "format": { + "system": "http://ihe.net/fhir/ValueSet/IHE.FormatCode.codesystem", + "code": "urn:ihe:iti:xds:2017:mimeTypeSufficient", + "display": "mimeType Sufficient" + } + } ], + "context": { + "encounter": [ { + "reference": "urn:uuid:15483d93-355e-b9c0-d240-3fb7720fdb78" + } ], + "period": { + "start": "2012-12-20T11:44:52-05:00", + "end": "2012-12-20T11:59:52-05:00" + } + } + }, + "request": { + "method": "POST", + "url": "DocumentReference" + } + }, { + "fullUrl": "urn:uuid:25b656d3-db68-0b63-9bdb-0aaaca1d07f9", + "resource": { + "resourceType": "Claim", + "id": "25b656d3-db68-0b63-9bdb-0aaaca1d07f9", + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Lindsay928 Gerlach374" + }, + "billablePeriod": { + "start": "2012-12-20T11:44:52-05:00", + "end": "2012-12-20T11:59:52-05:00" + }, + "created": "2012-12-20T11:59:52-05:00", + "provider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "priority": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } ] + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "insurance": [ { + "sequence": 1, + "focal": true, + "coverage": { + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "1234", + "display": "SNOMED Code" + } ], + "text": "SNOMED Code" + }, + "encounter": [ { + "reference": "urn:uuid:15483d93-355e-b9c0-d240-3fb7720fdb78" + } ] + } ], + "total": { + "value": 129.16, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, { + "fullUrl": "urn:uuid:1a69531e-4109-3f5d-7ace-d537d7ef30e2", + "resource": { + "resourceType": "ExplanationOfBenefit", + "id": "1a69531e-4109-3f5d-7ace-d537d7ef30e2", + "contained": [ { + "resourceType": "ServiceRequest", + "id": "referral", + "status": "completed", + "intent": "order", + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "requester": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + } ] + }, { + "resourceType": "Coverage", + "id": "coverage", + "status": "active", + "type": { + "text": "Humana" + }, + "beneficiary": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "payor": [ { + "display": "Humana" + } ] + } ], + "identifier": [ { + "system": "https://bluebutton.cms.gov/resources/variables/clm_id", + "value": "25b656d3-db68-0b63-9bdb-0aaaca1d07f9" + }, { + "system": "https://bluebutton.cms.gov/resources/identifier/claim-group", + "value": "99999999999" + } ], + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "billablePeriod": { + "start": "2012-12-20T11:59:52-05:00", + "end": "2013-12-20T11:59:52-05:00" + }, + "created": "2012-12-20T11:59:52-05:00", + "insurer": { + "display": "Humana" + }, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "referral": { + "reference": "#referral" + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "claim": { + "reference": "urn:uuid:25b656d3-db68-0b63-9bdb-0aaaca1d07f9" + }, + "outcome": "complete", + "careTeam": [ { + "sequence": 1, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "role": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", + "code": "primary", + "display": "Primary Care Practitioner" + } ] + } + } ], + "insurance": [ { + "focal": true, + "coverage": { + "reference": "#coverage", + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } ] + }, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "1234", + "display": "SNOMED Code" + } ], + "text": "SNOMED Code" + }, + "servicedPeriod": { + "start": "2012-12-20T11:44:52-05:00", + "end": "2012-12-20T11:59:52-05:00" + }, + "locationCodeableConcept": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "21", + "display": "Inpatient Hospital" + } ] + }, + "encounter": [ { + "reference": "urn:uuid:15483d93-355e-b9c0-d240-3fb7720fdb78" + } ] + } ], + "total": [ { + "category": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/adjudication", + "code": "submitted", + "display": "Submitted Amount" + } ], + "text": "Submitted Amount" + }, + "amount": { + "value": 129.16, + "currency": "USD" + } + } ], + "payment": { + "amount": { + "value": 0.0, + "currency": "USD" + } + } + }, + "request": { + "method": "POST", + "url": "ExplanationOfBenefit" + } + }, { + "fullUrl": "urn:uuid:bf4d5e64-1317-4ebe-24d6-8c3c2638ee62", + "resource": { + "resourceType": "Encounter", + "id": "bf4d5e64-1317-4ebe-24d6-8c3c2638ee62", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter", "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter" ] + }, + "identifier": [ { + "use": "official", + "system": "https://github.com/synthetichealth/synthea", + "value": "bf4d5e64-1317-4ebe-24d6-8c3c2638ee62" + } ], + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB" + }, + "type": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "1234", + "display": "SNOMED Code" + } ], + "text": "SNOMED Code" + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Mr. Lindsay928 Gerlach374" + }, + "participant": [ { + "type": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType", + "code": "PPRF", + "display": "primary performer" + } ], + "text": "primary performer" + } ], + "period": { + "start": "2013-03-20T12:44:52-04:00", + "end": "2013-03-20T12:59:52-04:00" + }, + "individual": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } + } ], + "period": { + "start": "2013-03-20T12:44:52-04:00", + "end": "2013-03-20T12:59:52-04:00" + }, + "reasonCode": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "274531002", + "display": "Abnormal findings diagnostic imaging heart+coronary circulat (finding)" + } ] + } ], + "location": [ { + "location": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + } ], + "serviceProvider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + }, + "request": { + "method": "POST", + "url": "Encounter" + } + }, { + "fullUrl": "urn:uuid:4f3dc228-f704-8726-f2ba-0a143545e6df", + "resource": { + "resourceType": "Observation", + "id": "4f3dc228-f704-8726-f2ba-0a143545e6df", + "meta": { + "profile": [ "http://hl7.org/fhir/StructureDefinition/bp", "http://hl7.org/fhir/StructureDefinition/vitalsigns" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "85354-9", + "display": "Blood Pressure" + } ], + "text": "Blood Pressure" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:bf4d5e64-1317-4ebe-24d6-8c3c2638ee62" + }, + "effectiveInstant": "2013-03-20T12:44:52-04:00", + "issued": "2013-03-20T12:44:52.558-04:00", + "component": [ { + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "8462-4", + "display": "Diastolic Blood Pressure" + } ], + "text": "Diastolic Blood Pressure" + }, + "valueQuantity": { + "value": 49, + "unit": "mm[Hg]", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + }, { + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "8480-6", + "display": "Systolic Blood Pressure" + } ], + "text": "Systolic Blood Pressure" + }, + "valueQuantity": { + "value": 136, + "unit": "mm[Hg]", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + } ] + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, { + "fullUrl": "urn:uuid:ee3e32b1-ec55-b04c-8af8-553c34529d8e", + "resource": { + "resourceType": "DiagnosticReport", + "id": "ee3e32b1-ec55-b04c-8af8-553c34529d8e", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-note" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:bf4d5e64-1317-4ebe-24d6-8c3c2638ee62" + }, + "effectiveDateTime": "2013-03-20T12:44:52-04:00", + "issued": "2013-03-20T12:44:52.558-04:00", + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } ], + "presentedForm": [ { + "contentType": "text/plain; charset=utf-8", + "data": "CjIwMTMtMDMtMjAKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgNjIgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuIFBhdGllbnQgaGFzIGEgaGlzdG9yeSBvZiBhY3V0ZSB2aXJhbCBwaGFyeW5naXRpcyAoZGlzb3JkZXIpLCB2aXJhbCBzaW51c2l0aXMgKGRpc29yZGVyKS4KCiMgU29jaWFsIEhpc3RvcnkKUGF0aWVudCBpcyBtYXJyaWVkLiBQYXRpZW50IGlzIGFuIGFjdGl2ZSBzbW9rZXIgYW5kIGlzIGFuIGFsY29ob2xpYy4KIFBhdGllbnQgaWRlbnRpZmllcyBhcyBoZXRlcm9zZXh1YWwuCgpQYXRpZW50IGNvbWVzIGZyb20gYSBtaWRkbGUgc29jaW9lY29ub21pYyBiYWNrZ3JvdW5kLgogUGF0aWVudCBoYXMgY29tcGxldGVkIHNvbWUgY29sbGVnZSBjb3Vyc2VzLgpQYXRpZW50IGN1cnJlbnRseSBoYXMgSHVtYW5hLgoKIyBBbGxlcmdpZXMKTm8gS25vd24gQWxsZXJnaWVzLgoKIyBNZWRpY2F0aW9ucwpObyBBY3RpdmUgTWVkaWNhdGlvbnMuCgojIEFzc2Vzc21lbnQgYW5kIFBsYW4KCgojIyBQbGFuCgo=" + } ] + }, + "request": { + "method": "POST", + "url": "DiagnosticReport" + } + }, { + "fullUrl": "urn:uuid:4ce4b58f-ee52-30fe-92b8-fb04e5bdc918", + "resource": { + "resourceType": "DocumentReference", + "id": "4ce4b58f-ee52-30fe-92b8-fb04e5bdc918", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-documentreference" ] + }, + "identifier": [ { + "system": "urn:ietf:rfc:3986", + "value": "urn:uuid:ee3e32b1-ec55-b04c-8af8-553c34529d8e" + } ], + "status": "superseded", + "type": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "category": [ { + "coding": [ { + "system": "http://hl7.org/fhir/us/core/CodeSystem/us-core-documentreference-category", + "code": "clinical-note", + "display": "Clinical Note" + } ] + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "date": "2013-03-20T12:44:52.558-04:00", + "author": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } ], + "custodian": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "content": [ { + "attachment": { + "contentType": "text/plain; charset=utf-8", + "data": "CjIwMTMtMDMtMjAKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgNjIgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuIFBhdGllbnQgaGFzIGEgaGlzdG9yeSBvZiBhY3V0ZSB2aXJhbCBwaGFyeW5naXRpcyAoZGlzb3JkZXIpLCB2aXJhbCBzaW51c2l0aXMgKGRpc29yZGVyKS4KCiMgU29jaWFsIEhpc3RvcnkKUGF0aWVudCBpcyBtYXJyaWVkLiBQYXRpZW50IGlzIGFuIGFjdGl2ZSBzbW9rZXIgYW5kIGlzIGFuIGFsY29ob2xpYy4KIFBhdGllbnQgaWRlbnRpZmllcyBhcyBoZXRlcm9zZXh1YWwuCgpQYXRpZW50IGNvbWVzIGZyb20gYSBtaWRkbGUgc29jaW9lY29ub21pYyBiYWNrZ3JvdW5kLgogUGF0aWVudCBoYXMgY29tcGxldGVkIHNvbWUgY29sbGVnZSBjb3Vyc2VzLgpQYXRpZW50IGN1cnJlbnRseSBoYXMgSHVtYW5hLgoKIyBBbGxlcmdpZXMKTm8gS25vd24gQWxsZXJnaWVzLgoKIyBNZWRpY2F0aW9ucwpObyBBY3RpdmUgTWVkaWNhdGlvbnMuCgojIEFzc2Vzc21lbnQgYW5kIFBsYW4KCgojIyBQbGFuCgo=" + }, + "format": { + "system": "http://ihe.net/fhir/ValueSet/IHE.FormatCode.codesystem", + "code": "urn:ihe:iti:xds:2017:mimeTypeSufficient", + "display": "mimeType Sufficient" + } + } ], + "context": { + "encounter": [ { + "reference": "urn:uuid:bf4d5e64-1317-4ebe-24d6-8c3c2638ee62" + } ], + "period": { + "start": "2013-03-20T12:44:52-04:00", + "end": "2013-03-20T12:59:52-04:00" + } + } + }, + "request": { + "method": "POST", + "url": "DocumentReference" + } + }, { + "fullUrl": "urn:uuid:3c62dd7e-4723-0065-416b-e18435a5f07b", + "resource": { + "resourceType": "Claim", + "id": "3c62dd7e-4723-0065-416b-e18435a5f07b", + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Lindsay928 Gerlach374" + }, + "billablePeriod": { + "start": "2013-03-20T12:44:52-04:00", + "end": "2013-03-20T12:59:52-04:00" + }, + "created": "2013-03-20T12:59:52-04:00", + "provider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "priority": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } ] + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "insurance": [ { + "sequence": 1, + "focal": true, + "coverage": { + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "1234", + "display": "SNOMED Code" + } ], + "text": "SNOMED Code" + }, + "encounter": [ { + "reference": "urn:uuid:bf4d5e64-1317-4ebe-24d6-8c3c2638ee62" + } ] + } ], + "total": { + "value": 129.16, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, { + "fullUrl": "urn:uuid:c4c66f6b-a418-e78e-ff3f-c4ccaac9722e", + "resource": { + "resourceType": "ExplanationOfBenefit", + "id": "c4c66f6b-a418-e78e-ff3f-c4ccaac9722e", + "contained": [ { + "resourceType": "ServiceRequest", + "id": "referral", + "status": "completed", + "intent": "order", + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "requester": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + } ] + }, { + "resourceType": "Coverage", + "id": "coverage", + "status": "active", + "type": { + "text": "Humana" + }, + "beneficiary": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "payor": [ { + "display": "Humana" + } ] + } ], + "identifier": [ { + "system": "https://bluebutton.cms.gov/resources/variables/clm_id", + "value": "3c62dd7e-4723-0065-416b-e18435a5f07b" + }, { + "system": "https://bluebutton.cms.gov/resources/identifier/claim-group", + "value": "99999999999" + } ], + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "billablePeriod": { + "start": "2013-03-20T12:59:52-04:00", + "end": "2014-03-20T12:59:52-04:00" + }, + "created": "2013-03-20T12:59:52-04:00", + "insurer": { + "display": "Humana" + }, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "referral": { + "reference": "#referral" + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "claim": { + "reference": "urn:uuid:3c62dd7e-4723-0065-416b-e18435a5f07b" + }, + "outcome": "complete", + "careTeam": [ { + "sequence": 1, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "role": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", + "code": "primary", + "display": "Primary Care Practitioner" + } ] + } + } ], + "insurance": [ { + "focal": true, + "coverage": { + "reference": "#coverage", + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } ] + }, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "1234", + "display": "SNOMED Code" + } ], + "text": "SNOMED Code" + }, + "servicedPeriod": { + "start": "2013-03-20T12:44:52-04:00", + "end": "2013-03-20T12:59:52-04:00" + }, + "locationCodeableConcept": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "21", + "display": "Inpatient Hospital" + } ] + }, + "encounter": [ { + "reference": "urn:uuid:bf4d5e64-1317-4ebe-24d6-8c3c2638ee62" + } ] + } ], + "total": [ { + "category": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/adjudication", + "code": "submitted", + "display": "Submitted Amount" + } ], + "text": "Submitted Amount" + }, + "amount": { + "value": 129.16, + "currency": "USD" + } + } ], + "payment": { + "amount": { + "value": 0.0, + "currency": "USD" + } + } + }, + "request": { + "method": "POST", + "url": "ExplanationOfBenefit" + } + }, { + "fullUrl": "urn:uuid:47f6c4db-1f56-d725-9466-d360fe3d5988", + "resource": { + "resourceType": "Encounter", + "id": "47f6c4db-1f56-d725-9466-d360fe3d5988", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter", "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter" ] + }, + "identifier": [ { + "use": "official", + "system": "https://github.com/synthetichealth/synthea", + "value": "47f6c4db-1f56-d725-9466-d360fe3d5988" + } ], + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB" + }, + "type": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "1234", + "display": "SNOMED Code" + } ], + "text": "SNOMED Code" + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Mr. Lindsay928 Gerlach374" + }, + "participant": [ { + "type": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType", + "code": "PPRF", + "display": "primary performer" + } ], + "text": "primary performer" + } ], + "period": { + "start": "2013-06-18T12:44:52-04:00", + "end": "2013-06-18T12:59:52-04:00" + }, + "individual": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } + } ], + "period": { + "start": "2013-06-18T12:44:52-04:00", + "end": "2013-06-18T12:59:52-04:00" + }, + "reasonCode": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "274531002", + "display": "Abnormal findings diagnostic imaging heart+coronary circulat (finding)" + } ] + } ], + "location": [ { + "location": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + } ], + "serviceProvider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + }, + "request": { + "method": "POST", + "url": "Encounter" + } + }, { + "fullUrl": "urn:uuid:ce757f6a-f3a5-5582-92a4-1de430f1a662", + "resource": { + "resourceType": "Observation", + "id": "ce757f6a-f3a5-5582-92a4-1de430f1a662", + "meta": { + "profile": [ "http://hl7.org/fhir/StructureDefinition/bp", "http://hl7.org/fhir/StructureDefinition/vitalsigns" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "85354-9", + "display": "Blood Pressure" + } ], + "text": "Blood Pressure" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:47f6c4db-1f56-d725-9466-d360fe3d5988" + }, + "effectiveInstant": "2013-06-18T12:44:52-04:00", + "issued": "2013-06-18T12:44:52.558-04:00", + "component": [ { + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "8462-4", + "display": "Diastolic Blood Pressure" + } ], + "text": "Diastolic Blood Pressure" + }, + "valueQuantity": { + "value": 49, + "unit": "mm[Hg]", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + }, { + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "8480-6", + "display": "Systolic Blood Pressure" + } ], + "text": "Systolic Blood Pressure" + }, + "valueQuantity": { + "value": 136, + "unit": "mm[Hg]", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + } ] + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, { + "fullUrl": "urn:uuid:4c3e61b0-a800-48e9-b313-ce129c3feafa", + "resource": { + "resourceType": "DiagnosticReport", + "id": "4c3e61b0-a800-48e9-b313-ce129c3feafa", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-note" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:47f6c4db-1f56-d725-9466-d360fe3d5988" + }, + "effectiveDateTime": "2013-06-18T12:44:52-04:00", + "issued": "2013-06-18T12:44:52.558-04:00", + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } ], + "presentedForm": [ { + "contentType": "text/plain; charset=utf-8", + "data": "CjIwMTMtMDYtMTgKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgNjIgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuIFBhdGllbnQgaGFzIGEgaGlzdG9yeSBvZiBhY3V0ZSB2aXJhbCBwaGFyeW5naXRpcyAoZGlzb3JkZXIpLCB2aXJhbCBzaW51c2l0aXMgKGRpc29yZGVyKS4KCiMgU29jaWFsIEhpc3RvcnkKUGF0aWVudCBpcyBtYXJyaWVkLiBQYXRpZW50IGlzIGFuIGFjdGl2ZSBzbW9rZXIgYW5kIGlzIGFuIGFsY29ob2xpYy4KIFBhdGllbnQgaWRlbnRpZmllcyBhcyBoZXRlcm9zZXh1YWwuCgpQYXRpZW50IGNvbWVzIGZyb20gYSBtaWRkbGUgc29jaW9lY29ub21pYyBiYWNrZ3JvdW5kLgogUGF0aWVudCBoYXMgY29tcGxldGVkIHNvbWUgY29sbGVnZSBjb3Vyc2VzLgpQYXRpZW50IGN1cnJlbnRseSBoYXMgSHVtYW5hLgoKIyBBbGxlcmdpZXMKTm8gS25vd24gQWxsZXJnaWVzLgoKIyBNZWRpY2F0aW9ucwpObyBBY3RpdmUgTWVkaWNhdGlvbnMuCgojIEFzc2Vzc21lbnQgYW5kIFBsYW4KCgojIyBQbGFuCgo=" + } ] + }, + "request": { + "method": "POST", + "url": "DiagnosticReport" + } + }, { + "fullUrl": "urn:uuid:158b614d-f1c0-a20d-3acb-58f4172b641a", + "resource": { + "resourceType": "DocumentReference", + "id": "158b614d-f1c0-a20d-3acb-58f4172b641a", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-documentreference" ] + }, + "identifier": [ { + "system": "urn:ietf:rfc:3986", + "value": "urn:uuid:4c3e61b0-a800-48e9-b313-ce129c3feafa" + } ], + "status": "superseded", + "type": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "category": [ { + "coding": [ { + "system": "http://hl7.org/fhir/us/core/CodeSystem/us-core-documentreference-category", + "code": "clinical-note", + "display": "Clinical Note" + } ] + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "date": "2013-06-18T12:44:52.558-04:00", + "author": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } ], + "custodian": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "content": [ { + "attachment": { + "contentType": "text/plain; charset=utf-8", + "data": "CjIwMTMtMDYtMTgKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgNjIgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuIFBhdGllbnQgaGFzIGEgaGlzdG9yeSBvZiBhY3V0ZSB2aXJhbCBwaGFyeW5naXRpcyAoZGlzb3JkZXIpLCB2aXJhbCBzaW51c2l0aXMgKGRpc29yZGVyKS4KCiMgU29jaWFsIEhpc3RvcnkKUGF0aWVudCBpcyBtYXJyaWVkLiBQYXRpZW50IGlzIGFuIGFjdGl2ZSBzbW9rZXIgYW5kIGlzIGFuIGFsY29ob2xpYy4KIFBhdGllbnQgaWRlbnRpZmllcyBhcyBoZXRlcm9zZXh1YWwuCgpQYXRpZW50IGNvbWVzIGZyb20gYSBtaWRkbGUgc29jaW9lY29ub21pYyBiYWNrZ3JvdW5kLgogUGF0aWVudCBoYXMgY29tcGxldGVkIHNvbWUgY29sbGVnZSBjb3Vyc2VzLgpQYXRpZW50IGN1cnJlbnRseSBoYXMgSHVtYW5hLgoKIyBBbGxlcmdpZXMKTm8gS25vd24gQWxsZXJnaWVzLgoKIyBNZWRpY2F0aW9ucwpObyBBY3RpdmUgTWVkaWNhdGlvbnMuCgojIEFzc2Vzc21lbnQgYW5kIFBsYW4KCgojIyBQbGFuCgo=" + }, + "format": { + "system": "http://ihe.net/fhir/ValueSet/IHE.FormatCode.codesystem", + "code": "urn:ihe:iti:xds:2017:mimeTypeSufficient", + "display": "mimeType Sufficient" + } + } ], + "context": { + "encounter": [ { + "reference": "urn:uuid:47f6c4db-1f56-d725-9466-d360fe3d5988" + } ], + "period": { + "start": "2013-06-18T12:44:52-04:00", + "end": "2013-06-18T12:59:52-04:00" + } + } + }, + "request": { + "method": "POST", + "url": "DocumentReference" + } + }, { + "fullUrl": "urn:uuid:c9ff463b-da57-aad6-e90e-204e1ac7ef79", + "resource": { + "resourceType": "Claim", + "id": "c9ff463b-da57-aad6-e90e-204e1ac7ef79", + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Lindsay928 Gerlach374" + }, + "billablePeriod": { + "start": "2013-06-18T12:44:52-04:00", + "end": "2013-06-18T12:59:52-04:00" + }, + "created": "2013-06-18T12:59:52-04:00", + "provider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "priority": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } ] + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "insurance": [ { + "sequence": 1, + "focal": true, + "coverage": { + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "1234", + "display": "SNOMED Code" + } ], + "text": "SNOMED Code" + }, + "encounter": [ { + "reference": "urn:uuid:47f6c4db-1f56-d725-9466-d360fe3d5988" + } ] + } ], + "total": { + "value": 129.16, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, { + "fullUrl": "urn:uuid:320a6b6b-68a9-fd64-fca6-375b37af8460", + "resource": { + "resourceType": "ExplanationOfBenefit", + "id": "320a6b6b-68a9-fd64-fca6-375b37af8460", + "contained": [ { + "resourceType": "ServiceRequest", + "id": "referral", + "status": "completed", + "intent": "order", + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "requester": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + } ] + }, { + "resourceType": "Coverage", + "id": "coverage", + "status": "active", + "type": { + "text": "Humana" + }, + "beneficiary": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "payor": [ { + "display": "Humana" + } ] + } ], + "identifier": [ { + "system": "https://bluebutton.cms.gov/resources/variables/clm_id", + "value": "c9ff463b-da57-aad6-e90e-204e1ac7ef79" + }, { + "system": "https://bluebutton.cms.gov/resources/identifier/claim-group", + "value": "99999999999" + } ], + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "billablePeriod": { + "start": "2013-06-18T12:59:52-04:00", + "end": "2014-06-18T12:59:52-04:00" + }, + "created": "2013-06-18T12:59:52-04:00", + "insurer": { + "display": "Humana" + }, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "referral": { + "reference": "#referral" + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "claim": { + "reference": "urn:uuid:c9ff463b-da57-aad6-e90e-204e1ac7ef79" + }, + "outcome": "complete", + "careTeam": [ { + "sequence": 1, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "role": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", + "code": "primary", + "display": "Primary Care Practitioner" + } ] + } + } ], + "insurance": [ { + "focal": true, + "coverage": { + "reference": "#coverage", + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } ] + }, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "1234", + "display": "SNOMED Code" + } ], + "text": "SNOMED Code" + }, + "servicedPeriod": { + "start": "2013-06-18T12:44:52-04:00", + "end": "2013-06-18T12:59:52-04:00" + }, + "locationCodeableConcept": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "21", + "display": "Inpatient Hospital" + } ] + }, + "encounter": [ { + "reference": "urn:uuid:47f6c4db-1f56-d725-9466-d360fe3d5988" + } ] + } ], + "total": [ { + "category": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/adjudication", + "code": "submitted", + "display": "Submitted Amount" + } ], + "text": "Submitted Amount" + }, + "amount": { + "value": 129.16, + "currency": "USD" + } + } ], + "payment": { + "amount": { + "value": 0.0, + "currency": "USD" + } + } + }, + "request": { + "method": "POST", + "url": "ExplanationOfBenefit" + } + }, { + "fullUrl": "urn:uuid:3b82748b-f274-6752-fab8-3ebb72c41290", + "resource": { + "resourceType": "Encounter", + "id": "3b82748b-f274-6752-fab8-3ebb72c41290", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter", "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter" ] + }, + "identifier": [ { + "use": "official", + "system": "https://github.com/synthetichealth/synthea", + "value": "3b82748b-f274-6752-fab8-3ebb72c41290" + } ], + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB" + }, + "type": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "1234", + "display": "SNOMED Code" + } ], + "text": "SNOMED Code" + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Mr. Lindsay928 Gerlach374" + }, + "participant": [ { + "type": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType", + "code": "PPRF", + "display": "primary performer" + } ], + "text": "primary performer" + } ], + "period": { + "start": "2013-09-16T12:44:52-04:00", + "end": "2013-09-16T12:59:52-04:00" + }, + "individual": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } + } ], + "period": { + "start": "2013-09-16T12:44:52-04:00", + "end": "2013-09-16T12:59:52-04:00" + }, + "reasonCode": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "274531002", + "display": "Abnormal findings diagnostic imaging heart+coronary circulat (finding)" + } ] + } ], + "location": [ { + "location": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + } ], + "serviceProvider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + }, + "request": { + "method": "POST", + "url": "Encounter" + } + }, { + "fullUrl": "urn:uuid:d89f0d2a-a005-3d3e-bb64-8babaaf5eb62", + "resource": { + "resourceType": "Observation", + "id": "d89f0d2a-a005-3d3e-bb64-8babaaf5eb62", + "meta": { + "profile": [ "http://hl7.org/fhir/StructureDefinition/bp", "http://hl7.org/fhir/StructureDefinition/vitalsigns" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "85354-9", + "display": "Blood Pressure" + } ], + "text": "Blood Pressure" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:3b82748b-f274-6752-fab8-3ebb72c41290" + }, + "effectiveInstant": "2013-09-16T12:44:52-04:00", + "issued": "2013-09-16T12:44:52.558-04:00", + "component": [ { + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "8462-4", + "display": "Diastolic Blood Pressure" + } ], + "text": "Diastolic Blood Pressure" + }, + "valueQuantity": { + "value": 49, + "unit": "mm[Hg]", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + }, { + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "8480-6", + "display": "Systolic Blood Pressure" + } ], + "text": "Systolic Blood Pressure" + }, + "valueQuantity": { + "value": 136, + "unit": "mm[Hg]", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + } ] + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, { + "fullUrl": "urn:uuid:bd1b0502-a838-e289-f6f7-0e77caa51930", + "resource": { + "resourceType": "DiagnosticReport", + "id": "bd1b0502-a838-e289-f6f7-0e77caa51930", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-note" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:3b82748b-f274-6752-fab8-3ebb72c41290" + }, + "effectiveDateTime": "2013-09-16T12:44:52-04:00", + "issued": "2013-09-16T12:44:52.558-04:00", + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } ], + "presentedForm": [ { + "contentType": "text/plain; charset=utf-8", + "data": "CjIwMTMtMDktMTYKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgNjIgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuIFBhdGllbnQgaGFzIGEgaGlzdG9yeSBvZiBhY3V0ZSB2aXJhbCBwaGFyeW5naXRpcyAoZGlzb3JkZXIpLCB2aXJhbCBzaW51c2l0aXMgKGRpc29yZGVyKS4KCiMgU29jaWFsIEhpc3RvcnkKUGF0aWVudCBpcyBtYXJyaWVkLiBQYXRpZW50IGlzIGFuIGFjdGl2ZSBzbW9rZXIgYW5kIGlzIGFuIGFsY29ob2xpYy4KIFBhdGllbnQgaWRlbnRpZmllcyBhcyBoZXRlcm9zZXh1YWwuCgpQYXRpZW50IGNvbWVzIGZyb20gYSBtaWRkbGUgc29jaW9lY29ub21pYyBiYWNrZ3JvdW5kLgogUGF0aWVudCBoYXMgY29tcGxldGVkIHNvbWUgY29sbGVnZSBjb3Vyc2VzLgpQYXRpZW50IGN1cnJlbnRseSBoYXMgSHVtYW5hLgoKIyBBbGxlcmdpZXMKTm8gS25vd24gQWxsZXJnaWVzLgoKIyBNZWRpY2F0aW9ucwpObyBBY3RpdmUgTWVkaWNhdGlvbnMuCgojIEFzc2Vzc21lbnQgYW5kIFBsYW4KCgojIyBQbGFuCgo=" + } ] + }, + "request": { + "method": "POST", + "url": "DiagnosticReport" + } + }, { + "fullUrl": "urn:uuid:215a5d8d-7450-895b-f48a-ac2dafb648f3", + "resource": { + "resourceType": "DocumentReference", + "id": "215a5d8d-7450-895b-f48a-ac2dafb648f3", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-documentreference" ] + }, + "identifier": [ { + "system": "urn:ietf:rfc:3986", + "value": "urn:uuid:bd1b0502-a838-e289-f6f7-0e77caa51930" + } ], + "status": "superseded", + "type": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "category": [ { + "coding": [ { + "system": "http://hl7.org/fhir/us/core/CodeSystem/us-core-documentreference-category", + "code": "clinical-note", + "display": "Clinical Note" + } ] + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "date": "2013-09-16T12:44:52.558-04:00", + "author": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } ], + "custodian": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "content": [ { + "attachment": { + "contentType": "text/plain; charset=utf-8", + "data": "CjIwMTMtMDktMTYKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgNjIgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuIFBhdGllbnQgaGFzIGEgaGlzdG9yeSBvZiBhY3V0ZSB2aXJhbCBwaGFyeW5naXRpcyAoZGlzb3JkZXIpLCB2aXJhbCBzaW51c2l0aXMgKGRpc29yZGVyKS4KCiMgU29jaWFsIEhpc3RvcnkKUGF0aWVudCBpcyBtYXJyaWVkLiBQYXRpZW50IGlzIGFuIGFjdGl2ZSBzbW9rZXIgYW5kIGlzIGFuIGFsY29ob2xpYy4KIFBhdGllbnQgaWRlbnRpZmllcyBhcyBoZXRlcm9zZXh1YWwuCgpQYXRpZW50IGNvbWVzIGZyb20gYSBtaWRkbGUgc29jaW9lY29ub21pYyBiYWNrZ3JvdW5kLgogUGF0aWVudCBoYXMgY29tcGxldGVkIHNvbWUgY29sbGVnZSBjb3Vyc2VzLgpQYXRpZW50IGN1cnJlbnRseSBoYXMgSHVtYW5hLgoKIyBBbGxlcmdpZXMKTm8gS25vd24gQWxsZXJnaWVzLgoKIyBNZWRpY2F0aW9ucwpObyBBY3RpdmUgTWVkaWNhdGlvbnMuCgojIEFzc2Vzc21lbnQgYW5kIFBsYW4KCgojIyBQbGFuCgo=" + }, + "format": { + "system": "http://ihe.net/fhir/ValueSet/IHE.FormatCode.codesystem", + "code": "urn:ihe:iti:xds:2017:mimeTypeSufficient", + "display": "mimeType Sufficient" + } + } ], + "context": { + "encounter": [ { + "reference": "urn:uuid:3b82748b-f274-6752-fab8-3ebb72c41290" + } ], + "period": { + "start": "2013-09-16T12:44:52-04:00", + "end": "2013-09-16T12:59:52-04:00" + } + } + }, + "request": { + "method": "POST", + "url": "DocumentReference" + } + }, { + "fullUrl": "urn:uuid:f86b1cd9-8f26-6ee9-d81b-ff93bbda2a2d", + "resource": { + "resourceType": "Claim", + "id": "f86b1cd9-8f26-6ee9-d81b-ff93bbda2a2d", + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Lindsay928 Gerlach374" + }, + "billablePeriod": { + "start": "2013-09-16T12:44:52-04:00", + "end": "2013-09-16T12:59:52-04:00" + }, + "created": "2013-09-16T12:59:52-04:00", + "provider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "priority": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } ] + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "insurance": [ { + "sequence": 1, + "focal": true, + "coverage": { + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "1234", + "display": "SNOMED Code" + } ], + "text": "SNOMED Code" + }, + "encounter": [ { + "reference": "urn:uuid:3b82748b-f274-6752-fab8-3ebb72c41290" + } ] + } ], + "total": { + "value": 129.16, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, { + "fullUrl": "urn:uuid:9cbff9a1-e1b3-17fa-5d52-b55b5d106909", + "resource": { + "resourceType": "ExplanationOfBenefit", + "id": "9cbff9a1-e1b3-17fa-5d52-b55b5d106909", + "contained": [ { + "resourceType": "ServiceRequest", + "id": "referral", + "status": "completed", + "intent": "order", + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "requester": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + } ] + }, { + "resourceType": "Coverage", + "id": "coverage", + "status": "active", + "type": { + "text": "Humana" + }, + "beneficiary": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "payor": [ { + "display": "Humana" + } ] + } ], + "identifier": [ { + "system": "https://bluebutton.cms.gov/resources/variables/clm_id", + "value": "f86b1cd9-8f26-6ee9-d81b-ff93bbda2a2d" + }, { + "system": "https://bluebutton.cms.gov/resources/identifier/claim-group", + "value": "99999999999" + } ], + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "billablePeriod": { + "start": "2013-09-16T12:59:52-04:00", + "end": "2014-09-16T12:59:52-04:00" + }, + "created": "2013-09-16T12:59:52-04:00", + "insurer": { + "display": "Humana" + }, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "referral": { + "reference": "#referral" + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "claim": { + "reference": "urn:uuid:f86b1cd9-8f26-6ee9-d81b-ff93bbda2a2d" + }, + "outcome": "complete", + "careTeam": [ { + "sequence": 1, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "role": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", + "code": "primary", + "display": "Primary Care Practitioner" + } ] + } + } ], + "insurance": [ { + "focal": true, + "coverage": { + "reference": "#coverage", + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } ] + }, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "1234", + "display": "SNOMED Code" + } ], + "text": "SNOMED Code" + }, + "servicedPeriod": { + "start": "2013-09-16T12:44:52-04:00", + "end": "2013-09-16T12:59:52-04:00" + }, + "locationCodeableConcept": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "21", + "display": "Inpatient Hospital" + } ] + }, + "encounter": [ { + "reference": "urn:uuid:3b82748b-f274-6752-fab8-3ebb72c41290" + } ] + } ], + "total": [ { + "category": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/adjudication", + "code": "submitted", + "display": "Submitted Amount" + } ], + "text": "Submitted Amount" + }, + "amount": { + "value": 129.16, + "currency": "USD" + } + } ], + "payment": { + "amount": { + "value": 0.0, + "currency": "USD" + } + } + }, + "request": { + "method": "POST", + "url": "ExplanationOfBenefit" + } + }, { + "fullUrl": "urn:uuid:6de1349b-ec0b-51a6-fd07-f794735da6bf", + "resource": { + "resourceType": "Encounter", + "id": "6de1349b-ec0b-51a6-fd07-f794735da6bf", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter", "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter" ] + }, + "identifier": [ { + "use": "official", + "system": "https://github.com/synthetichealth/synthea", + "value": "6de1349b-ec0b-51a6-fd07-f794735da6bf" + } ], + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB" + }, + "type": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "1234", + "display": "SNOMED Code" + } ], + "text": "SNOMED Code" + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Mr. Lindsay928 Gerlach374" + }, + "participant": [ { + "type": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType", + "code": "PPRF", + "display": "primary performer" + } ], + "text": "primary performer" + } ], + "period": { + "start": "2013-12-15T11:44:52-05:00", + "end": "2013-12-15T11:59:52-05:00" + }, + "individual": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } + } ], + "period": { + "start": "2013-12-15T11:44:52-05:00", + "end": "2013-12-15T11:59:52-05:00" + }, + "reasonCode": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "274531002", + "display": "Abnormal findings diagnostic imaging heart+coronary circulat (finding)" + } ] + } ], + "location": [ { + "location": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + } ], + "serviceProvider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + }, + "request": { + "method": "POST", + "url": "Encounter" + } + }, { + "fullUrl": "urn:uuid:5041330f-0e36-fa60-b103-9c62c63e143d", + "resource": { + "resourceType": "Observation", + "id": "5041330f-0e36-fa60-b103-9c62c63e143d", + "meta": { + "profile": [ "http://hl7.org/fhir/StructureDefinition/bp", "http://hl7.org/fhir/StructureDefinition/vitalsigns" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "85354-9", + "display": "Blood Pressure" + } ], + "text": "Blood Pressure" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:6de1349b-ec0b-51a6-fd07-f794735da6bf" + }, + "effectiveInstant": "2013-12-15T11:44:52-05:00", + "issued": "2013-12-15T11:44:52.558-05:00", + "component": [ { + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "8462-4", + "display": "Diastolic Blood Pressure" + } ], + "text": "Diastolic Blood Pressure" + }, + "valueQuantity": { + "value": 49, + "unit": "mm[Hg]", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + }, { + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "8480-6", + "display": "Systolic Blood Pressure" + } ], + "text": "Systolic Blood Pressure" + }, + "valueQuantity": { + "value": 136, + "unit": "mm[Hg]", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + } ] + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, { + "fullUrl": "urn:uuid:6d27aea8-7bbc-d737-dad1-0bf128d49303", + "resource": { + "resourceType": "DiagnosticReport", + "id": "6d27aea8-7bbc-d737-dad1-0bf128d49303", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-note" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:6de1349b-ec0b-51a6-fd07-f794735da6bf" + }, + "effectiveDateTime": "2013-12-15T11:44:52-05:00", + "issued": "2013-12-15T11:44:52.558-05:00", + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } ], + "presentedForm": [ { + "contentType": "text/plain; charset=utf-8", + "data": "CjIwMTMtMTItMTUKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgNjMgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuIFBhdGllbnQgaGFzIGEgaGlzdG9yeSBvZiBhY3V0ZSB2aXJhbCBwaGFyeW5naXRpcyAoZGlzb3JkZXIpLCB2aXJhbCBzaW51c2l0aXMgKGRpc29yZGVyKS4KCiMgU29jaWFsIEhpc3RvcnkKUGF0aWVudCBpcyBtYXJyaWVkLiBQYXRpZW50IGlzIGFuIGFjdGl2ZSBzbW9rZXIgYW5kIGlzIGFuIGFsY29ob2xpYy4KIFBhdGllbnQgaWRlbnRpZmllcyBhcyBoZXRlcm9zZXh1YWwuCgpQYXRpZW50IGNvbWVzIGZyb20gYSBtaWRkbGUgc29jaW9lY29ub21pYyBiYWNrZ3JvdW5kLgogUGF0aWVudCBoYXMgY29tcGxldGVkIHNvbWUgY29sbGVnZSBjb3Vyc2VzLgpQYXRpZW50IGN1cnJlbnRseSBoYXMgSHVtYW5hLgoKIyBBbGxlcmdpZXMKTm8gS25vd24gQWxsZXJnaWVzLgoKIyBNZWRpY2F0aW9ucwpObyBBY3RpdmUgTWVkaWNhdGlvbnMuCgojIEFzc2Vzc21lbnQgYW5kIFBsYW4KCgojIyBQbGFuCgo=" + } ] + }, + "request": { + "method": "POST", + "url": "DiagnosticReport" + } + }, { + "fullUrl": "urn:uuid:fc7f8e8d-8fbf-f958-8b28-11a60170804e", + "resource": { + "resourceType": "DocumentReference", + "id": "fc7f8e8d-8fbf-f958-8b28-11a60170804e", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-documentreference" ] + }, + "identifier": [ { + "system": "urn:ietf:rfc:3986", + "value": "urn:uuid:6d27aea8-7bbc-d737-dad1-0bf128d49303" + } ], + "status": "superseded", + "type": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "category": [ { + "coding": [ { + "system": "http://hl7.org/fhir/us/core/CodeSystem/us-core-documentreference-category", + "code": "clinical-note", + "display": "Clinical Note" + } ] + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "date": "2013-12-15T11:44:52.558-05:00", + "author": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } ], + "custodian": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "content": [ { + "attachment": { + "contentType": "text/plain; charset=utf-8", + "data": "CjIwMTMtMTItMTUKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgNjMgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuIFBhdGllbnQgaGFzIGEgaGlzdG9yeSBvZiBhY3V0ZSB2aXJhbCBwaGFyeW5naXRpcyAoZGlzb3JkZXIpLCB2aXJhbCBzaW51c2l0aXMgKGRpc29yZGVyKS4KCiMgU29jaWFsIEhpc3RvcnkKUGF0aWVudCBpcyBtYXJyaWVkLiBQYXRpZW50IGlzIGFuIGFjdGl2ZSBzbW9rZXIgYW5kIGlzIGFuIGFsY29ob2xpYy4KIFBhdGllbnQgaWRlbnRpZmllcyBhcyBoZXRlcm9zZXh1YWwuCgpQYXRpZW50IGNvbWVzIGZyb20gYSBtaWRkbGUgc29jaW9lY29ub21pYyBiYWNrZ3JvdW5kLgogUGF0aWVudCBoYXMgY29tcGxldGVkIHNvbWUgY29sbGVnZSBjb3Vyc2VzLgpQYXRpZW50IGN1cnJlbnRseSBoYXMgSHVtYW5hLgoKIyBBbGxlcmdpZXMKTm8gS25vd24gQWxsZXJnaWVzLgoKIyBNZWRpY2F0aW9ucwpObyBBY3RpdmUgTWVkaWNhdGlvbnMuCgojIEFzc2Vzc21lbnQgYW5kIFBsYW4KCgojIyBQbGFuCgo=" + }, + "format": { + "system": "http://ihe.net/fhir/ValueSet/IHE.FormatCode.codesystem", + "code": "urn:ihe:iti:xds:2017:mimeTypeSufficient", + "display": "mimeType Sufficient" + } + } ], + "context": { + "encounter": [ { + "reference": "urn:uuid:6de1349b-ec0b-51a6-fd07-f794735da6bf" + } ], + "period": { + "start": "2013-12-15T11:44:52-05:00", + "end": "2013-12-15T11:59:52-05:00" + } + } + }, + "request": { + "method": "POST", + "url": "DocumentReference" + } + }, { + "fullUrl": "urn:uuid:aa80bdb3-1a4f-77d7-4675-0c9796028e78", + "resource": { + "resourceType": "Claim", + "id": "aa80bdb3-1a4f-77d7-4675-0c9796028e78", + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Lindsay928 Gerlach374" + }, + "billablePeriod": { + "start": "2013-12-15T11:44:52-05:00", + "end": "2013-12-15T11:59:52-05:00" + }, + "created": "2013-12-15T11:59:52-05:00", + "provider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "priority": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } ] + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "insurance": [ { + "sequence": 1, + "focal": true, + "coverage": { + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "1234", + "display": "SNOMED Code" + } ], + "text": "SNOMED Code" + }, + "encounter": [ { + "reference": "urn:uuid:6de1349b-ec0b-51a6-fd07-f794735da6bf" + } ] + } ], + "total": { + "value": 129.16, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, { + "fullUrl": "urn:uuid:40f0926d-2251-81ae-dbcf-333e55bb509e", + "resource": { + "resourceType": "ExplanationOfBenefit", + "id": "40f0926d-2251-81ae-dbcf-333e55bb509e", + "contained": [ { + "resourceType": "ServiceRequest", + "id": "referral", + "status": "completed", + "intent": "order", + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "requester": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + } ] + }, { + "resourceType": "Coverage", + "id": "coverage", + "status": "active", + "type": { + "text": "Humana" + }, + "beneficiary": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "payor": [ { + "display": "Humana" + } ] + } ], + "identifier": [ { + "system": "https://bluebutton.cms.gov/resources/variables/clm_id", + "value": "aa80bdb3-1a4f-77d7-4675-0c9796028e78" + }, { + "system": "https://bluebutton.cms.gov/resources/identifier/claim-group", + "value": "99999999999" + } ], + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "billablePeriod": { + "start": "2013-12-15T11:59:52-05:00", + "end": "2014-12-15T11:59:52-05:00" + }, + "created": "2013-12-15T11:59:52-05:00", + "insurer": { + "display": "Humana" + }, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "referral": { + "reference": "#referral" + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "claim": { + "reference": "urn:uuid:aa80bdb3-1a4f-77d7-4675-0c9796028e78" + }, + "outcome": "complete", + "careTeam": [ { + "sequence": 1, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "role": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", + "code": "primary", + "display": "Primary Care Practitioner" + } ] + } + } ], + "insurance": [ { + "focal": true, + "coverage": { + "reference": "#coverage", + "display": "Humana" + } + } ], + "item": [ { + "sequence": 1, + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } ] + }, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "1234", + "display": "SNOMED Code" + } ], + "text": "SNOMED Code" + }, + "servicedPeriod": { + "start": "2013-12-15T11:44:52-05:00", + "end": "2013-12-15T11:59:52-05:00" + }, + "locationCodeableConcept": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "21", + "display": "Inpatient Hospital" + } ] + }, + "encounter": [ { + "reference": "urn:uuid:6de1349b-ec0b-51a6-fd07-f794735da6bf" + } ] + } ], + "total": [ { + "category": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/adjudication", + "code": "submitted", + "display": "Submitted Amount" + } ], + "text": "Submitted Amount" + }, + "amount": { + "value": 129.16, + "currency": "USD" + } + } ], + "payment": { + "amount": { + "value": 0.0, + "currency": "USD" + } + } + }, + "request": { + "method": "POST", + "url": "ExplanationOfBenefit" + } + }, { + "fullUrl": "urn:uuid:64489b43-f67f-0c05-5d62-de67ce945c83", + "resource": { + "resourceType": "Encounter", + "id": "64489b43-f67f-0c05-5d62-de67ce945c83", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter", "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter" ] + }, + "identifier": [ { + "use": "official", + "system": "https://github.com/synthetichealth/synthea", + "value": "64489b43-f67f-0c05-5d62-de67ce945c83" + } ], + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB" + }, + "type": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "185345009", + "display": "Encounter for symptom" + } ], + "text": "Encounter for symptom" + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Mr. Lindsay928 Gerlach374" + }, + "participant": [ { + "type": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType", + "code": "PPRF", + "display": "primary performer" + } ], + "text": "primary performer" + } ], + "period": { + "start": "2016-01-06T16:44:52-05:00", + "end": "2016-01-06T16:59:52-05:00" + }, + "individual": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } + } ], + "period": { + "start": "2016-01-06T16:44:52-05:00", + "end": "2016-01-06T16:59:52-05:00" + }, + "reasonCode": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "195662009", + "display": "Acute viral pharyngitis (disorder)" + } ] + } ], + "location": [ { + "location": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + } ], + "serviceProvider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + }, + "request": { + "method": "POST", + "url": "Encounter" + } + }, { + "fullUrl": "urn:uuid:49bce50d-4375-a0b3-5f41-0f72ae2f26b3", + "resource": { + "resourceType": "Condition", + "id": "49bce50d-4375-a0b3-5f41-0f72ae2f26b3", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-condition" ] + }, + "clinicalStatus": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/condition-clinical", + "code": "resolved" + } ] + }, + "verificationStatus": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status", + "code": "confirmed" + } ] + }, + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/condition-category", + "code": "encounter-diagnosis", + "display": "Encounter Diagnosis" + } ] + } ], + "code": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "195662009", + "display": "Acute viral pharyngitis (disorder)" + } ], + "text": "Acute viral pharyngitis (disorder)" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:64489b43-f67f-0c05-5d62-de67ce945c83" + }, + "onsetDateTime": "2016-01-06T16:44:52-05:00", + "abatementDateTime": "2016-01-16T08:44:52-05:00", + "recordedDate": "2016-01-06T16:44:52-05:00" + }, + "request": { + "method": "POST", + "url": "Condition" + } + }, { + "fullUrl": "urn:uuid:79180e37-0139-1104-62e4-a5b71682fceb", + "resource": { + "resourceType": "Observation", + "id": "79180e37-0139-1104-62e4-a5b71682fceb", + "meta": { + "profile": [ "http://hl7.org/fhir/StructureDefinition/bodytemp", "http://hl7.org/fhir/StructureDefinition/vitalsigns" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "8310-5", + "display": "Body temperature" + }, { + "system": "http://loinc.org", + "code": "8331-1", + "display": "Oral temperature" + } ], + "text": "Body temperature" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:64489b43-f67f-0c05-5d62-de67ce945c83" + }, + "effectiveInstant": "2016-01-06T16:44:52-05:00", + "issued": "2016-01-06T16:44:52.558-05:00", + "valueQuantity": { + "value": 37.193, + "unit": "Cel", + "system": "http://unitsofmeasure.org", + "code": "Cel" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, { + "fullUrl": "urn:uuid:b5f4bb64-2fd7-10bc-85d0-f7445285c2b8", + "resource": { + "resourceType": "DiagnosticReport", + "id": "b5f4bb64-2fd7-10bc-85d0-f7445285c2b8", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-note" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:64489b43-f67f-0c05-5d62-de67ce945c83" + }, + "effectiveDateTime": "2016-01-06T16:44:52-05:00", + "issued": "2016-01-06T16:44:52.558-05:00", + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } ], + "presentedForm": [ { + "contentType": "text/plain; charset=utf-8", + "data": "CjIwMTYtMDEtMDYKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgNjUgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuIFBhdGllbnQgaGFzIGEgaGlzdG9yeSBvZiBhY3V0ZSB2aXJhbCBwaGFyeW5naXRpcyAoZGlzb3JkZXIpLCB2aXJhbCBzaW51c2l0aXMgKGRpc29yZGVyKS4KCiMgU29jaWFsIEhpc3RvcnkKUGF0aWVudCBpcyBtYXJyaWVkLiBQYXRpZW50IGlzIGFuIGFjdGl2ZSBzbW9rZXIgYW5kIGlzIGFuIGFsY29ob2xpYy4KIFBhdGllbnQgaWRlbnRpZmllcyBhcyBoZXRlcm9zZXh1YWwuCgpQYXRpZW50IGNvbWVzIGZyb20gYSBtaWRkbGUgc29jaW9lY29ub21pYyBiYWNrZ3JvdW5kLgogUGF0aWVudCBoYXMgY29tcGxldGVkIHNvbWUgY29sbGVnZSBjb3Vyc2VzLgpQYXRpZW50IGN1cnJlbnRseSBoYXMgTWVkaWNhcmUuCgojIEFsbGVyZ2llcwpObyBLbm93biBBbGxlcmdpZXMuCgojIE1lZGljYXRpb25zCk5vIEFjdGl2ZSBNZWRpY2F0aW9ucy4KCiMgQXNzZXNzbWVudCBhbmQgUGxhbgpQYXRpZW50IGlzIHByZXNlbnRpbmcgd2l0aCBhY3V0ZSB2aXJhbCBwaGFyeW5naXRpcyAoZGlzb3JkZXIpLiAKCiMjIFBsYW4KCg==" + } ] + }, + "request": { + "method": "POST", + "url": "DiagnosticReport" + } + }, { + "fullUrl": "urn:uuid:a441413a-957a-fd5c-dfb4-c0ce1b91545d", + "resource": { + "resourceType": "DocumentReference", + "id": "a441413a-957a-fd5c-dfb4-c0ce1b91545d", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-documentreference" ] + }, + "identifier": [ { + "system": "urn:ietf:rfc:3986", + "value": "urn:uuid:b5f4bb64-2fd7-10bc-85d0-f7445285c2b8" + } ], + "status": "superseded", + "type": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "category": [ { + "coding": [ { + "system": "http://hl7.org/fhir/us/core/CodeSystem/us-core-documentreference-category", + "code": "clinical-note", + "display": "Clinical Note" + } ] + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "date": "2016-01-06T16:44:52.558-05:00", + "author": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } ], + "custodian": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "content": [ { + "attachment": { + "contentType": "text/plain; charset=utf-8", + "data": "CjIwMTYtMDEtMDYKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgNjUgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuIFBhdGllbnQgaGFzIGEgaGlzdG9yeSBvZiBhY3V0ZSB2aXJhbCBwaGFyeW5naXRpcyAoZGlzb3JkZXIpLCB2aXJhbCBzaW51c2l0aXMgKGRpc29yZGVyKS4KCiMgU29jaWFsIEhpc3RvcnkKUGF0aWVudCBpcyBtYXJyaWVkLiBQYXRpZW50IGlzIGFuIGFjdGl2ZSBzbW9rZXIgYW5kIGlzIGFuIGFsY29ob2xpYy4KIFBhdGllbnQgaWRlbnRpZmllcyBhcyBoZXRlcm9zZXh1YWwuCgpQYXRpZW50IGNvbWVzIGZyb20gYSBtaWRkbGUgc29jaW9lY29ub21pYyBiYWNrZ3JvdW5kLgogUGF0aWVudCBoYXMgY29tcGxldGVkIHNvbWUgY29sbGVnZSBjb3Vyc2VzLgpQYXRpZW50IGN1cnJlbnRseSBoYXMgTWVkaWNhcmUuCgojIEFsbGVyZ2llcwpObyBLbm93biBBbGxlcmdpZXMuCgojIE1lZGljYXRpb25zCk5vIEFjdGl2ZSBNZWRpY2F0aW9ucy4KCiMgQXNzZXNzbWVudCBhbmQgUGxhbgpQYXRpZW50IGlzIHByZXNlbnRpbmcgd2l0aCBhY3V0ZSB2aXJhbCBwaGFyeW5naXRpcyAoZGlzb3JkZXIpLiAKCiMjIFBsYW4KCg==" + }, + "format": { + "system": "http://ihe.net/fhir/ValueSet/IHE.FormatCode.codesystem", + "code": "urn:ihe:iti:xds:2017:mimeTypeSufficient", + "display": "mimeType Sufficient" + } + } ], + "context": { + "encounter": [ { + "reference": "urn:uuid:64489b43-f67f-0c05-5d62-de67ce945c83" + } ], + "period": { + "start": "2016-01-06T16:44:52-05:00", + "end": "2016-01-06T16:59:52-05:00" + } + } + }, + "request": { + "method": "POST", + "url": "DocumentReference" + } + }, { + "fullUrl": "urn:uuid:4d73977b-9060-55a3-63b7-a0e4d001b3f9", + "resource": { + "resourceType": "Claim", + "id": "4d73977b-9060-55a3-63b7-a0e4d001b3f9", + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Lindsay928 Gerlach374" + }, + "billablePeriod": { + "start": "2016-01-06T16:44:52-05:00", + "end": "2016-01-06T16:59:52-05:00" + }, + "created": "2016-01-06T16:59:52-05:00", + "provider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "priority": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } ] + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "diagnosis": [ { + "sequence": 1, + "diagnosisReference": { + "reference": "urn:uuid:49bce50d-4375-a0b3-5f41-0f72ae2f26b3" + } + } ], + "insurance": [ { + "sequence": 1, + "focal": true, + "coverage": { + "display": "Medicare" + } + } ], + "item": [ { + "sequence": 1, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "185345009", + "display": "Encounter for symptom" + } ], + "text": "Encounter for symptom" + }, + "encounter": [ { + "reference": "urn:uuid:64489b43-f67f-0c05-5d62-de67ce945c83" + } ] + }, { + "sequence": 2, + "diagnosisSequence": [ 1 ], + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "195662009", + "display": "Acute viral pharyngitis (disorder)" + } ], + "text": "Acute viral pharyngitis (disorder)" + } + } ], + "total": { + "value": 77.49, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, { + "fullUrl": "urn:uuid:53a0e953-e8f6-a557-f047-926844a664e9", + "resource": { + "resourceType": "ExplanationOfBenefit", + "id": "53a0e953-e8f6-a557-f047-926844a664e9", + "contained": [ { + "resourceType": "ServiceRequest", + "id": "referral", + "status": "completed", + "intent": "order", + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "requester": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + } ] + }, { + "resourceType": "Coverage", + "id": "coverage", + "status": "active", + "type": { + "text": "Medicare" + }, + "beneficiary": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "payor": [ { + "display": "Medicare" + } ] + } ], + "identifier": [ { + "system": "https://bluebutton.cms.gov/resources/variables/clm_id", + "value": "4d73977b-9060-55a3-63b7-a0e4d001b3f9" + }, { + "system": "https://bluebutton.cms.gov/resources/identifier/claim-group", + "value": "99999999999" + } ], + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "billablePeriod": { + "start": "2016-01-06T16:59:52-05:00", + "end": "2017-01-06T16:59:52-05:00" + }, + "created": "2016-01-06T16:59:52-05:00", + "insurer": { + "display": "Medicare" + }, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "referral": { + "reference": "#referral" + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "claim": { + "reference": "urn:uuid:4d73977b-9060-55a3-63b7-a0e4d001b3f9" + }, + "outcome": "complete", + "careTeam": [ { + "sequence": 1, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "role": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", + "code": "primary", + "display": "Primary Care Practitioner" + } ] + } + } ], + "diagnosis": [ { + "sequence": 1, + "diagnosisReference": { + "reference": "urn:uuid:49bce50d-4375-a0b3-5f41-0f72ae2f26b3" + }, + "type": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-diagnosistype", + "code": "principal" + } ] + } ] + } ], + "insurance": [ { + "focal": true, + "coverage": { + "reference": "#coverage", + "display": "Medicare" + } + } ], + "item": [ { + "sequence": 1, + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } ] + }, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "185345009", + "display": "Encounter for symptom" + } ], + "text": "Encounter for symptom" + }, + "servicedPeriod": { + "start": "2016-01-06T16:44:52-05:00", + "end": "2016-01-06T16:59:52-05:00" + }, + "locationCodeableConcept": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "21", + "display": "Inpatient Hospital" + } ] + }, + "encounter": [ { + "reference": "urn:uuid:64489b43-f67f-0c05-5d62-de67ce945c83" + } ] + }, { + "sequence": 2, + "diagnosisSequence": [ 1 ], + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } ] + }, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "195662009", + "display": "Acute viral pharyngitis (disorder)" + } ], + "text": "Acute viral pharyngitis (disorder)" + }, + "servicedPeriod": { + "start": "2016-01-06T16:44:52-05:00", + "end": "2016-01-06T16:59:52-05:00" + }, + "locationCodeableConcept": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "21", + "display": "Inpatient Hospital" + } ] + } + } ], + "total": [ { + "category": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/adjudication", + "code": "submitted", + "display": "Submitted Amount" + } ], + "text": "Submitted Amount" + }, + "amount": { + "value": 77.49, + "currency": "USD" + } + } ], + "payment": { + "amount": { + "value": 0.0, + "currency": "USD" + } + } + }, + "request": { + "method": "POST", + "url": "ExplanationOfBenefit" + } + }, { + "fullUrl": "urn:uuid:ef0d56f0-bc71-e944-941f-1a3aef63996a", + "resource": { + "resourceType": "Encounter", + "id": "ef0d56f0-bc71-e944-941f-1a3aef63996a", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter", "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter" ] + }, + "identifier": [ { + "use": "official", + "system": "https://github.com/synthetichealth/synthea", + "value": "ef0d56f0-bc71-e944-941f-1a3aef63996a" + } ], + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB" + }, + "type": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "185349003", + "display": "Encounter for 'check-up'" + } ], + "text": "Encounter for 'check-up'" + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Mr. Lindsay928 Gerlach374" + }, + "participant": [ { + "type": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType", + "code": "PPRF", + "display": "primary performer" + } ], + "text": "primary performer" + } ], + "period": { + "start": "2017-01-24T13:52:24-05:00", + "end": "2017-01-24T14:20:41-05:00" + }, + "individual": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } + } ], + "period": { + "start": "2017-01-24T13:52:24-05:00", + "end": "2017-01-24T14:20:41-05:00" + }, + "location": [ { + "location": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + } ], + "serviceProvider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + }, + "request": { + "method": "POST", + "url": "Encounter" + } + }, { + "fullUrl": "urn:uuid:2efdbc58-b22e-af85-f594-1c36a0061683", + "resource": { + "resourceType": "Procedure", + "id": "2efdbc58-b22e-af85-f594-1c36a0061683", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-procedure" ] + }, + "status": "completed", + "code": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "73761001", + "display": "Colonoscopy" + } ], + "text": "Colonoscopy" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:ef0d56f0-bc71-e944-941f-1a3aef63996a" + }, + "performedPeriod": { + "start": "2017-01-24T13:52:24-05:00", + "end": "2017-01-24T14:20:41-05:00" + }, + "location": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + }, + "request": { + "method": "POST", + "url": "Procedure" + } + }, { + "fullUrl": "urn:uuid:d8de9176-d701-7801-75ca-8b618f16f221", + "resource": { + "resourceType": "DiagnosticReport", + "id": "d8de9176-d701-7801-75ca-8b618f16f221", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-note" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:ef0d56f0-bc71-e944-941f-1a3aef63996a" + }, + "effectiveDateTime": "2017-01-24T13:52:24-05:00", + "issued": "2017-01-24T13:52:24.558-05:00", + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } ], + "presentedForm": [ { + "contentType": "text/plain; charset=utf-8", + "data": "CjIwMTctMDEtMjQKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgNjYgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuIFBhdGllbnQgaGFzIGEgaGlzdG9yeSBvZiBhY3V0ZSB2aXJhbCBwaGFyeW5naXRpcyAoZGlzb3JkZXIpLCB2aXJhbCBzaW51c2l0aXMgKGRpc29yZGVyKS4KCiMgU29jaWFsIEhpc3RvcnkKUGF0aWVudCBpcyBtYXJyaWVkLiBQYXRpZW50IGlzIGFuIGFjdGl2ZSBzbW9rZXIgYW5kIGlzIGFuIGFsY29ob2xpYy4KIFBhdGllbnQgaWRlbnRpZmllcyBhcyBoZXRlcm9zZXh1YWwuCgpQYXRpZW50IGNvbWVzIGZyb20gYSBtaWRkbGUgc29jaW9lY29ub21pYyBiYWNrZ3JvdW5kLgogUGF0aWVudCBoYXMgY29tcGxldGVkIHNvbWUgY29sbGVnZSBjb3Vyc2VzLgpQYXRpZW50IGN1cnJlbnRseSBoYXMgTWVkaWNhcmUuCgojIEFsbGVyZ2llcwpObyBLbm93biBBbGxlcmdpZXMuCgojIE1lZGljYXRpb25zCk5vIEFjdGl2ZSBNZWRpY2F0aW9ucy4KCiMgQXNzZXNzbWVudCBhbmQgUGxhbgoKCiMjIFBsYW4KClRoZSBmb2xsb3dpbmcgcHJvY2VkdXJlcyB3ZXJlIGNvbmR1Y3RlZDoKLSBjb2xvbm9zY29weQo=" + } ] + }, + "request": { + "method": "POST", + "url": "DiagnosticReport" + } + }, { + "fullUrl": "urn:uuid:76703776-94fd-1938-cb65-695f57aa8f83", + "resource": { + "resourceType": "DocumentReference", + "id": "76703776-94fd-1938-cb65-695f57aa8f83", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-documentreference" ] + }, + "identifier": [ { + "system": "urn:ietf:rfc:3986", + "value": "urn:uuid:d8de9176-d701-7801-75ca-8b618f16f221" + } ], + "status": "superseded", + "type": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "category": [ { + "coding": [ { + "system": "http://hl7.org/fhir/us/core/CodeSystem/us-core-documentreference-category", + "code": "clinical-note", + "display": "Clinical Note" + } ] + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "date": "2017-01-24T13:52:24.558-05:00", + "author": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } ], + "custodian": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "content": [ { + "attachment": { + "contentType": "text/plain; charset=utf-8", + "data": "CjIwMTctMDEtMjQKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgNjYgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuIFBhdGllbnQgaGFzIGEgaGlzdG9yeSBvZiBhY3V0ZSB2aXJhbCBwaGFyeW5naXRpcyAoZGlzb3JkZXIpLCB2aXJhbCBzaW51c2l0aXMgKGRpc29yZGVyKS4KCiMgU29jaWFsIEhpc3RvcnkKUGF0aWVudCBpcyBtYXJyaWVkLiBQYXRpZW50IGlzIGFuIGFjdGl2ZSBzbW9rZXIgYW5kIGlzIGFuIGFsY29ob2xpYy4KIFBhdGllbnQgaWRlbnRpZmllcyBhcyBoZXRlcm9zZXh1YWwuCgpQYXRpZW50IGNvbWVzIGZyb20gYSBtaWRkbGUgc29jaW9lY29ub21pYyBiYWNrZ3JvdW5kLgogUGF0aWVudCBoYXMgY29tcGxldGVkIHNvbWUgY29sbGVnZSBjb3Vyc2VzLgpQYXRpZW50IGN1cnJlbnRseSBoYXMgTWVkaWNhcmUuCgojIEFsbGVyZ2llcwpObyBLbm93biBBbGxlcmdpZXMuCgojIE1lZGljYXRpb25zCk5vIEFjdGl2ZSBNZWRpY2F0aW9ucy4KCiMgQXNzZXNzbWVudCBhbmQgUGxhbgoKCiMjIFBsYW4KClRoZSBmb2xsb3dpbmcgcHJvY2VkdXJlcyB3ZXJlIGNvbmR1Y3RlZDoKLSBjb2xvbm9zY29weQo=" + }, + "format": { + "system": "http://ihe.net/fhir/ValueSet/IHE.FormatCode.codesystem", + "code": "urn:ihe:iti:xds:2017:mimeTypeSufficient", + "display": "mimeType Sufficient" + } + } ], + "context": { + "encounter": [ { + "reference": "urn:uuid:ef0d56f0-bc71-e944-941f-1a3aef63996a" + } ], + "period": { + "start": "2017-01-24T13:52:24-05:00", + "end": "2017-01-24T14:20:41-05:00" + } + } + }, + "request": { + "method": "POST", + "url": "DocumentReference" + } + }, { + "fullUrl": "urn:uuid:0dda4752-34b4-2d3f-cb03-c9283af87dd8", + "resource": { + "resourceType": "Claim", + "id": "0dda4752-34b4-2d3f-cb03-c9283af87dd8", + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Lindsay928 Gerlach374" + }, + "billablePeriod": { + "start": "2017-01-24T13:52:24-05:00", + "end": "2017-01-24T14:20:41-05:00" + }, + "created": "2017-01-24T14:20:41-05:00", + "provider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "priority": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } ] + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "procedure": [ { + "sequence": 1, + "procedureReference": { + "reference": "urn:uuid:2efdbc58-b22e-af85-f594-1c36a0061683" + } + } ], + "insurance": [ { + "sequence": 1, + "focal": true, + "coverage": { + "display": "Medicare" + } + } ], + "item": [ { + "sequence": 1, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "185349003", + "display": "Encounter for 'check-up'" + } ], + "text": "Encounter for 'check-up'" + }, + "encounter": [ { + "reference": "urn:uuid:ef0d56f0-bc71-e944-941f-1a3aef63996a" + } ] + }, { + "sequence": 2, + "procedureSequence": [ 1 ], + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "73761001", + "display": "Colonoscopy" + } ], + "text": "Colonoscopy" + }, + "net": { + "value": 12601.52, + "currency": "USD" + } + } ], + "total": { + "value": 77.49, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, { + "fullUrl": "urn:uuid:d28cb5ac-52b5-cb09-3e7e-c8f979401d25", + "resource": { + "resourceType": "ExplanationOfBenefit", + "id": "d28cb5ac-52b5-cb09-3e7e-c8f979401d25", + "contained": [ { + "resourceType": "ServiceRequest", + "id": "referral", + "status": "completed", + "intent": "order", + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "requester": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + } ] + }, { + "resourceType": "Coverage", + "id": "coverage", + "status": "active", + "type": { + "text": "Medicare" + }, + "beneficiary": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "payor": [ { + "display": "Medicare" + } ] + } ], + "identifier": [ { + "system": "https://bluebutton.cms.gov/resources/variables/clm_id", + "value": "0dda4752-34b4-2d3f-cb03-c9283af87dd8" + }, { + "system": "https://bluebutton.cms.gov/resources/identifier/claim-group", + "value": "99999999999" + } ], + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "billablePeriod": { + "start": "2017-01-24T14:20:41-05:00", + "end": "2018-01-24T14:20:41-05:00" + }, + "created": "2017-01-24T14:20:41-05:00", + "insurer": { + "display": "Medicare" + }, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "referral": { + "reference": "#referral" + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "claim": { + "reference": "urn:uuid:0dda4752-34b4-2d3f-cb03-c9283af87dd8" + }, + "outcome": "complete", + "careTeam": [ { + "sequence": 1, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "role": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", + "code": "primary", + "display": "Primary Care Practitioner" + } ] + } + } ], + "insurance": [ { + "focal": true, + "coverage": { + "reference": "#coverage", + "display": "Medicare" + } + } ], + "item": [ { + "sequence": 1, + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } ] + }, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "185349003", + "display": "Encounter for 'check-up'" + } ], + "text": "Encounter for 'check-up'" + }, + "servicedPeriod": { + "start": "2017-01-24T13:52:24-05:00", + "end": "2017-01-24T14:20:41-05:00" + }, + "locationCodeableConcept": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "21", + "display": "Inpatient Hospital" + } ] + }, + "encounter": [ { + "reference": "urn:uuid:ef0d56f0-bc71-e944-941f-1a3aef63996a" + } ] + }, { + "sequence": 2, + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } ] + }, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "73761001", + "display": "Colonoscopy" + } ], + "text": "Colonoscopy" + }, + "servicedPeriod": { + "start": "2017-01-24T13:52:24-05:00", + "end": "2017-01-24T14:20:41-05:00" + }, + "locationCodeableConcept": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "21", + "display": "Inpatient Hospital" + } ] + }, + "net": { + "value": 12601.52, + "currency": "USD" + }, + "adjudication": [ { + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_coinsrnc_amt", + "display": "Line Beneficiary Coinsurance Amount" + } ] + }, + "amount": { + "value": 2520.304, + "currency": "USD" + } + }, { + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_prvdr_pmt_amt", + "display": "Line Provider Payment Amount" + } ] + }, + "amount": { + "value": 10081.216, + "currency": "USD" + } + }, { + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_sbmtd_chrg_amt", + "display": "Line Submitted Charge Amount" + } ] + }, + "amount": { + "value": 12601.52, + "currency": "USD" + } + }, { + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_alowd_chrg_amt", + "display": "Line Allowed Charge Amount" + } ] + }, + "amount": { + "value": 12601.52, + "currency": "USD" + } + }, { + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_bene_ptb_ddctbl_amt", + "display": "Line Beneficiary Part B Deductible Amount" + } ] + }, + "amount": { + "value": 0, + "currency": "USD" + } + }, { + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_prcsg_ind_cd", + "display": "Line Processing Indicator Code" + } ] + } + } ] + } ], + "total": [ { + "category": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/adjudication", + "code": "submitted", + "display": "Submitted Amount" + } ], + "text": "Submitted Amount" + }, + "amount": { + "value": 77.49, + "currency": "USD" + } + } ], + "payment": { + "amount": { + "value": 10081.216, + "currency": "USD" + } + } + }, + "request": { + "method": "POST", + "url": "ExplanationOfBenefit" + } + }, { + "fullUrl": "urn:uuid:24eedfdd-6946-0fe7-91b8-b78f65582d6c", + "resource": { + "resourceType": "Encounter", + "id": "24eedfdd-6946-0fe7-91b8-b78f65582d6c", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter", "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter" ] + }, + "identifier": [ { + "use": "official", + "system": "https://github.com/synthetichealth/synthea", + "value": "24eedfdd-6946-0fe7-91b8-b78f65582d6c" + } ], + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB" + }, + "type": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "185345009", + "display": "Encounter for symptom" + } ], + "text": "Encounter for symptom" + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Mr. Lindsay928 Gerlach374" + }, + "participant": [ { + "type": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType", + "code": "PPRF", + "display": "primary performer" + } ], + "text": "primary performer" + } ], + "period": { + "start": "2017-08-02T08:44:52-04:00", + "end": "2017-08-02T08:59:52-04:00" + }, + "individual": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } + } ], + "period": { + "start": "2017-08-02T08:44:52-04:00", + "end": "2017-08-02T08:59:52-04:00" + }, + "reasonCode": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "444814009", + "display": "Viral sinusitis (disorder)" + } ] + } ], + "location": [ { + "location": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + } ], + "serviceProvider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + }, + "request": { + "method": "POST", + "url": "Encounter" + } + }, { + "fullUrl": "urn:uuid:0e49d64c-6f57-3d51-bc1c-d8924d85ac0a", + "resource": { + "resourceType": "Condition", + "id": "0e49d64c-6f57-3d51-bc1c-d8924d85ac0a", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-condition" ] + }, + "clinicalStatus": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/condition-clinical", + "code": "resolved" + } ] + }, + "verificationStatus": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status", + "code": "confirmed" + } ] + }, + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/condition-category", + "code": "encounter-diagnosis", + "display": "Encounter Diagnosis" + } ] + } ], + "code": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "444814009", + "display": "Viral sinusitis (disorder)" + } ], + "text": "Viral sinusitis (disorder)" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:24eedfdd-6946-0fe7-91b8-b78f65582d6c" + }, + "onsetDateTime": "2017-08-02T08:44:52-04:00", + "abatementDateTime": "2017-08-22T08:44:52-04:00", + "recordedDate": "2017-08-02T08:44:52-04:00" + }, + "request": { + "method": "POST", + "url": "Condition" + } + }, { + "fullUrl": "urn:uuid:3f5c7804-12d0-6ee6-dbf2-7c4e3718a360", + "resource": { + "resourceType": "DiagnosticReport", + "id": "3f5c7804-12d0-6ee6-dbf2-7c4e3718a360", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-note" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:24eedfdd-6946-0fe7-91b8-b78f65582d6c" + }, + "effectiveDateTime": "2017-08-02T08:44:52-04:00", + "issued": "2017-08-02T08:44:52.558-04:00", + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } ], + "presentedForm": [ { + "contentType": "text/plain; charset=utf-8", + "data": "CjIwMTctMDgtMDIKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgNjYgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuIFBhdGllbnQgaGFzIGEgaGlzdG9yeSBvZiBhY3V0ZSB2aXJhbCBwaGFyeW5naXRpcyAoZGlzb3JkZXIpLCB2aXJhbCBzaW51c2l0aXMgKGRpc29yZGVyKS4KCiMgU29jaWFsIEhpc3RvcnkKUGF0aWVudCBpcyBtYXJyaWVkLiBQYXRpZW50IGlzIGFuIGFjdGl2ZSBzbW9rZXIgYW5kIGlzIGFuIGFsY29ob2xpYy4KIFBhdGllbnQgaWRlbnRpZmllcyBhcyBoZXRlcm9zZXh1YWwuCgpQYXRpZW50IGNvbWVzIGZyb20gYSBtaWRkbGUgc29jaW9lY29ub21pYyBiYWNrZ3JvdW5kLgogUGF0aWVudCBoYXMgY29tcGxldGVkIHNvbWUgY29sbGVnZSBjb3Vyc2VzLgpQYXRpZW50IGN1cnJlbnRseSBoYXMgTWVkaWNhcmUuCgojIEFsbGVyZ2llcwpObyBLbm93biBBbGxlcmdpZXMuCgojIE1lZGljYXRpb25zCk5vIEFjdGl2ZSBNZWRpY2F0aW9ucy4KCiMgQXNzZXNzbWVudCBhbmQgUGxhbgpQYXRpZW50IGlzIHByZXNlbnRpbmcgd2l0aCB2aXJhbCBzaW51c2l0aXMgKGRpc29yZGVyKS4gCgojIyBQbGFuCgo=" + } ] + }, + "request": { + "method": "POST", + "url": "DiagnosticReport" + } + }, { + "fullUrl": "urn:uuid:77dd337f-f97b-2cb1-1b9d-5ea97113d0b6", + "resource": { + "resourceType": "DocumentReference", + "id": "77dd337f-f97b-2cb1-1b9d-5ea97113d0b6", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-documentreference" ] + }, + "identifier": [ { + "system": "urn:ietf:rfc:3986", + "value": "urn:uuid:3f5c7804-12d0-6ee6-dbf2-7c4e3718a360" + } ], + "status": "superseded", + "type": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "category": [ { + "coding": [ { + "system": "http://hl7.org/fhir/us/core/CodeSystem/us-core-documentreference-category", + "code": "clinical-note", + "display": "Clinical Note" + } ] + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "date": "2017-08-02T08:44:52.558-04:00", + "author": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } ], + "custodian": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "content": [ { + "attachment": { + "contentType": "text/plain; charset=utf-8", + "data": "CjIwMTctMDgtMDIKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgNjYgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuIFBhdGllbnQgaGFzIGEgaGlzdG9yeSBvZiBhY3V0ZSB2aXJhbCBwaGFyeW5naXRpcyAoZGlzb3JkZXIpLCB2aXJhbCBzaW51c2l0aXMgKGRpc29yZGVyKS4KCiMgU29jaWFsIEhpc3RvcnkKUGF0aWVudCBpcyBtYXJyaWVkLiBQYXRpZW50IGlzIGFuIGFjdGl2ZSBzbW9rZXIgYW5kIGlzIGFuIGFsY29ob2xpYy4KIFBhdGllbnQgaWRlbnRpZmllcyBhcyBoZXRlcm9zZXh1YWwuCgpQYXRpZW50IGNvbWVzIGZyb20gYSBtaWRkbGUgc29jaW9lY29ub21pYyBiYWNrZ3JvdW5kLgogUGF0aWVudCBoYXMgY29tcGxldGVkIHNvbWUgY29sbGVnZSBjb3Vyc2VzLgpQYXRpZW50IGN1cnJlbnRseSBoYXMgTWVkaWNhcmUuCgojIEFsbGVyZ2llcwpObyBLbm93biBBbGxlcmdpZXMuCgojIE1lZGljYXRpb25zCk5vIEFjdGl2ZSBNZWRpY2F0aW9ucy4KCiMgQXNzZXNzbWVudCBhbmQgUGxhbgpQYXRpZW50IGlzIHByZXNlbnRpbmcgd2l0aCB2aXJhbCBzaW51c2l0aXMgKGRpc29yZGVyKS4gCgojIyBQbGFuCgo=" + }, + "format": { + "system": "http://ihe.net/fhir/ValueSet/IHE.FormatCode.codesystem", + "code": "urn:ihe:iti:xds:2017:mimeTypeSufficient", + "display": "mimeType Sufficient" + } + } ], + "context": { + "encounter": [ { + "reference": "urn:uuid:24eedfdd-6946-0fe7-91b8-b78f65582d6c" + } ], + "period": { + "start": "2017-08-02T08:44:52-04:00", + "end": "2017-08-02T08:59:52-04:00" + } + } + }, + "request": { + "method": "POST", + "url": "DocumentReference" + } + }, { + "fullUrl": "urn:uuid:3d1680c8-f9c1-5dad-8c10-8151070e445b", + "resource": { + "resourceType": "Claim", + "id": "3d1680c8-f9c1-5dad-8c10-8151070e445b", + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Lindsay928 Gerlach374" + }, + "billablePeriod": { + "start": "2017-08-02T08:44:52-04:00", + "end": "2017-08-02T08:59:52-04:00" + }, + "created": "2017-08-02T08:59:52-04:00", + "provider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "priority": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } ] + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "diagnosis": [ { + "sequence": 1, + "diagnosisReference": { + "reference": "urn:uuid:0e49d64c-6f57-3d51-bc1c-d8924d85ac0a" + } + } ], + "insurance": [ { + "sequence": 1, + "focal": true, + "coverage": { + "display": "Medicare" + } + } ], + "item": [ { + "sequence": 1, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "185345009", + "display": "Encounter for symptom" + } ], + "text": "Encounter for symptom" + }, + "encounter": [ { + "reference": "urn:uuid:24eedfdd-6946-0fe7-91b8-b78f65582d6c" + } ] + }, { + "sequence": 2, + "diagnosisSequence": [ 1 ], + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "444814009", + "display": "Viral sinusitis (disorder)" + } ], + "text": "Viral sinusitis (disorder)" + } + } ], + "total": { + "value": 77.49, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, { + "fullUrl": "urn:uuid:530868c2-66f9-5e8a-f257-f5345ecc6010", + "resource": { + "resourceType": "ExplanationOfBenefit", + "id": "530868c2-66f9-5e8a-f257-f5345ecc6010", + "contained": [ { + "resourceType": "ServiceRequest", + "id": "referral", + "status": "completed", + "intent": "order", + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "requester": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + } ] + }, { + "resourceType": "Coverage", + "id": "coverage", + "status": "active", + "type": { + "text": "Medicare" + }, + "beneficiary": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "payor": [ { + "display": "Medicare" + } ] + } ], + "identifier": [ { + "system": "https://bluebutton.cms.gov/resources/variables/clm_id", + "value": "3d1680c8-f9c1-5dad-8c10-8151070e445b" + }, { + "system": "https://bluebutton.cms.gov/resources/identifier/claim-group", + "value": "99999999999" + } ], + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "billablePeriod": { + "start": "2017-08-02T08:59:52-04:00", + "end": "2018-08-02T08:59:52-04:00" + }, + "created": "2017-08-02T08:59:52-04:00", + "insurer": { + "display": "Medicare" + }, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "referral": { + "reference": "#referral" + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "claim": { + "reference": "urn:uuid:3d1680c8-f9c1-5dad-8c10-8151070e445b" + }, + "outcome": "complete", + "careTeam": [ { + "sequence": 1, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "role": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", + "code": "primary", + "display": "Primary Care Practitioner" + } ] + } + } ], + "diagnosis": [ { + "sequence": 1, + "diagnosisReference": { + "reference": "urn:uuid:0e49d64c-6f57-3d51-bc1c-d8924d85ac0a" + }, + "type": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-diagnosistype", + "code": "principal" + } ] + } ] + } ], + "insurance": [ { + "focal": true, + "coverage": { + "reference": "#coverage", + "display": "Medicare" + } + } ], + "item": [ { + "sequence": 1, + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } ] + }, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "185345009", + "display": "Encounter for symptom" + } ], + "text": "Encounter for symptom" + }, + "servicedPeriod": { + "start": "2017-08-02T08:44:52-04:00", + "end": "2017-08-02T08:59:52-04:00" + }, + "locationCodeableConcept": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "21", + "display": "Inpatient Hospital" + } ] + }, + "encounter": [ { + "reference": "urn:uuid:24eedfdd-6946-0fe7-91b8-b78f65582d6c" + } ] + }, { + "sequence": 2, + "diagnosisSequence": [ 1 ], + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } ] + }, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "444814009", + "display": "Viral sinusitis (disorder)" + } ], + "text": "Viral sinusitis (disorder)" + }, + "servicedPeriod": { + "start": "2017-08-02T08:44:52-04:00", + "end": "2017-08-02T08:59:52-04:00" + }, + "locationCodeableConcept": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "21", + "display": "Inpatient Hospital" + } ] + } + } ], + "total": [ { + "category": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/adjudication", + "code": "submitted", + "display": "Submitted Amount" + } ], + "text": "Submitted Amount" + }, + "amount": { + "value": 77.49, + "currency": "USD" + } + } ], + "payment": { + "amount": { + "value": 0.0, + "currency": "USD" + } + } + }, + "request": { + "method": "POST", + "url": "ExplanationOfBenefit" + } + }, { + "fullUrl": "urn:uuid:874aadc2-6496-40b1-1b71-4734aaffd7a5", + "resource": { + "resourceType": "Encounter", + "id": "874aadc2-6496-40b1-1b71-4734aaffd7a5", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter", "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter" ] + }, + "identifier": [ { + "use": "official", + "system": "https://github.com/synthetichealth/synthea", + "value": "874aadc2-6496-40b1-1b71-4734aaffd7a5" + } ], + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB" + }, + "type": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "185345009", + "display": "Encounter for symptom" + } ], + "text": "Encounter for symptom" + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Mr. Lindsay928 Gerlach374" + }, + "participant": [ { + "type": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType", + "code": "PPRF", + "display": "primary performer" + } ], + "text": "primary performer" + } ], + "period": { + "start": "2018-01-29T02:44:52-05:00", + "end": "2018-01-29T02:59:52-05:00" + }, + "individual": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } + } ], + "period": { + "start": "2018-01-29T02:44:52-05:00", + "end": "2018-01-29T02:59:52-05:00" + }, + "reasonCode": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "444814009", + "display": "Viral sinusitis (disorder)" + } ] + } ], + "location": [ { + "location": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + } ], + "serviceProvider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + }, + "request": { + "method": "POST", + "url": "Encounter" + } + }, { + "fullUrl": "urn:uuid:dc906963-046e-7586-18f1-841c227497e4", + "resource": { + "resourceType": "Condition", + "id": "dc906963-046e-7586-18f1-841c227497e4", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-condition" ] + }, + "clinicalStatus": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/condition-clinical", + "code": "resolved" + } ] + }, + "verificationStatus": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status", + "code": "confirmed" + } ] + }, + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/condition-category", + "code": "encounter-diagnosis", + "display": "Encounter Diagnosis" + } ] + } ], + "code": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "444814009", + "display": "Viral sinusitis (disorder)" + } ], + "text": "Viral sinusitis (disorder)" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:874aadc2-6496-40b1-1b71-4734aaffd7a5" + }, + "onsetDateTime": "2018-01-29T02:44:52-05:00", + "abatementDateTime": "2018-02-22T02:44:52-05:00", + "recordedDate": "2018-01-29T02:44:52-05:00" + }, + "request": { + "method": "POST", + "url": "Condition" + } + }, { + "fullUrl": "urn:uuid:f2673398-8eab-69ec-fd73-07ccfeeab7ae", + "resource": { + "resourceType": "DiagnosticReport", + "id": "f2673398-8eab-69ec-fd73-07ccfeeab7ae", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-note" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:874aadc2-6496-40b1-1b71-4734aaffd7a5" + }, + "effectiveDateTime": "2018-01-29T02:44:52-05:00", + "issued": "2018-01-29T02:44:52.558-05:00", + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } ], + "presentedForm": [ { + "contentType": "text/plain; charset=utf-8", + "data": "CjIwMTgtMDEtMjkKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgNjcgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuIFBhdGllbnQgaGFzIGEgaGlzdG9yeSBvZiBhY3V0ZSB2aXJhbCBwaGFyeW5naXRpcyAoZGlzb3JkZXIpLCB2aXJhbCBzaW51c2l0aXMgKGRpc29yZGVyKS4KCiMgU29jaWFsIEhpc3RvcnkKUGF0aWVudCBpcyBtYXJyaWVkLiBQYXRpZW50IGlzIGFuIGFjdGl2ZSBzbW9rZXIgYW5kIGlzIGFuIGFsY29ob2xpYy4KIFBhdGllbnQgaWRlbnRpZmllcyBhcyBoZXRlcm9zZXh1YWwuCgpQYXRpZW50IGNvbWVzIGZyb20gYSBtaWRkbGUgc29jaW9lY29ub21pYyBiYWNrZ3JvdW5kLgogUGF0aWVudCBoYXMgY29tcGxldGVkIHNvbWUgY29sbGVnZSBjb3Vyc2VzLgpQYXRpZW50IGN1cnJlbnRseSBoYXMgTWVkaWNhcmUuCgojIEFsbGVyZ2llcwpObyBLbm93biBBbGxlcmdpZXMuCgojIE1lZGljYXRpb25zCk5vIEFjdGl2ZSBNZWRpY2F0aW9ucy4KCiMgQXNzZXNzbWVudCBhbmQgUGxhbgpQYXRpZW50IGlzIHByZXNlbnRpbmcgd2l0aCB2aXJhbCBzaW51c2l0aXMgKGRpc29yZGVyKS4gCgojIyBQbGFuCgo=" + } ] + }, + "request": { + "method": "POST", + "url": "DiagnosticReport" + } + }, { + "fullUrl": "urn:uuid:dbd92706-4a18-d60d-e8b4-8bbc783bd764", + "resource": { + "resourceType": "DocumentReference", + "id": "dbd92706-4a18-d60d-e8b4-8bbc783bd764", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-documentreference" ] + }, + "identifier": [ { + "system": "urn:ietf:rfc:3986", + "value": "urn:uuid:f2673398-8eab-69ec-fd73-07ccfeeab7ae" + } ], + "status": "superseded", + "type": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "category": [ { + "coding": [ { + "system": "http://hl7.org/fhir/us/core/CodeSystem/us-core-documentreference-category", + "code": "clinical-note", + "display": "Clinical Note" + } ] + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "date": "2018-01-29T02:44:52.558-05:00", + "author": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } ], + "custodian": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "content": [ { + "attachment": { + "contentType": "text/plain; charset=utf-8", + "data": "CjIwMTgtMDEtMjkKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgNjcgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuIFBhdGllbnQgaGFzIGEgaGlzdG9yeSBvZiBhY3V0ZSB2aXJhbCBwaGFyeW5naXRpcyAoZGlzb3JkZXIpLCB2aXJhbCBzaW51c2l0aXMgKGRpc29yZGVyKS4KCiMgU29jaWFsIEhpc3RvcnkKUGF0aWVudCBpcyBtYXJyaWVkLiBQYXRpZW50IGlzIGFuIGFjdGl2ZSBzbW9rZXIgYW5kIGlzIGFuIGFsY29ob2xpYy4KIFBhdGllbnQgaWRlbnRpZmllcyBhcyBoZXRlcm9zZXh1YWwuCgpQYXRpZW50IGNvbWVzIGZyb20gYSBtaWRkbGUgc29jaW9lY29ub21pYyBiYWNrZ3JvdW5kLgogUGF0aWVudCBoYXMgY29tcGxldGVkIHNvbWUgY29sbGVnZSBjb3Vyc2VzLgpQYXRpZW50IGN1cnJlbnRseSBoYXMgTWVkaWNhcmUuCgojIEFsbGVyZ2llcwpObyBLbm93biBBbGxlcmdpZXMuCgojIE1lZGljYXRpb25zCk5vIEFjdGl2ZSBNZWRpY2F0aW9ucy4KCiMgQXNzZXNzbWVudCBhbmQgUGxhbgpQYXRpZW50IGlzIHByZXNlbnRpbmcgd2l0aCB2aXJhbCBzaW51c2l0aXMgKGRpc29yZGVyKS4gCgojIyBQbGFuCgo=" + }, + "format": { + "system": "http://ihe.net/fhir/ValueSet/IHE.FormatCode.codesystem", + "code": "urn:ihe:iti:xds:2017:mimeTypeSufficient", + "display": "mimeType Sufficient" + } + } ], + "context": { + "encounter": [ { + "reference": "urn:uuid:874aadc2-6496-40b1-1b71-4734aaffd7a5" + } ], + "period": { + "start": "2018-01-29T02:44:52-05:00", + "end": "2018-01-29T02:59:52-05:00" + } + } + }, + "request": { + "method": "POST", + "url": "DocumentReference" + } + }, { + "fullUrl": "urn:uuid:4a3a568b-09b2-c55a-c3f6-28a0316c9288", + "resource": { + "resourceType": "Claim", + "id": "4a3a568b-09b2-c55a-c3f6-28a0316c9288", + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Lindsay928 Gerlach374" + }, + "billablePeriod": { + "start": "2018-01-29T02:44:52-05:00", + "end": "2018-01-29T02:59:52-05:00" + }, + "created": "2018-01-29T02:59:52-05:00", + "provider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "priority": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } ] + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "diagnosis": [ { + "sequence": 1, + "diagnosisReference": { + "reference": "urn:uuid:dc906963-046e-7586-18f1-841c227497e4" + } + } ], + "insurance": [ { + "sequence": 1, + "focal": true, + "coverage": { + "display": "Medicare" + } + } ], + "item": [ { + "sequence": 1, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "185345009", + "display": "Encounter for symptom" + } ], + "text": "Encounter for symptom" + }, + "encounter": [ { + "reference": "urn:uuid:874aadc2-6496-40b1-1b71-4734aaffd7a5" + } ] + }, { + "sequence": 2, + "diagnosisSequence": [ 1 ], + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "444814009", + "display": "Viral sinusitis (disorder)" + } ], + "text": "Viral sinusitis (disorder)" + } + } ], + "total": { + "value": 77.49, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, { + "fullUrl": "urn:uuid:a4df8821-84bd-9ad1-3eb8-3f65b430e7a3", + "resource": { + "resourceType": "ExplanationOfBenefit", + "id": "a4df8821-84bd-9ad1-3eb8-3f65b430e7a3", + "contained": [ { + "resourceType": "ServiceRequest", + "id": "referral", + "status": "completed", + "intent": "order", + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "requester": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + } ] + }, { + "resourceType": "Coverage", + "id": "coverage", + "status": "active", + "type": { + "text": "Medicare" + }, + "beneficiary": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "payor": [ { + "display": "Medicare" + } ] + } ], + "identifier": [ { + "system": "https://bluebutton.cms.gov/resources/variables/clm_id", + "value": "4a3a568b-09b2-c55a-c3f6-28a0316c9288" + }, { + "system": "https://bluebutton.cms.gov/resources/identifier/claim-group", + "value": "99999999999" + } ], + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "billablePeriod": { + "start": "2018-01-29T02:59:52-05:00", + "end": "2019-01-29T02:59:52-05:00" + }, + "created": "2018-01-29T02:59:52-05:00", + "insurer": { + "display": "Medicare" + }, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "referral": { + "reference": "#referral" + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "claim": { + "reference": "urn:uuid:4a3a568b-09b2-c55a-c3f6-28a0316c9288" + }, + "outcome": "complete", + "careTeam": [ { + "sequence": 1, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "role": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", + "code": "primary", + "display": "Primary Care Practitioner" + } ] + } + } ], + "diagnosis": [ { + "sequence": 1, + "diagnosisReference": { + "reference": "urn:uuid:dc906963-046e-7586-18f1-841c227497e4" + }, + "type": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-diagnosistype", + "code": "principal" + } ] + } ] + } ], + "insurance": [ { + "focal": true, + "coverage": { + "reference": "#coverage", + "display": "Medicare" + } + } ], + "item": [ { + "sequence": 1, + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } ] + }, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "185345009", + "display": "Encounter for symptom" + } ], + "text": "Encounter for symptom" + }, + "servicedPeriod": { + "start": "2018-01-29T02:44:52-05:00", + "end": "2018-01-29T02:59:52-05:00" + }, + "locationCodeableConcept": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "21", + "display": "Inpatient Hospital" + } ] + }, + "encounter": [ { + "reference": "urn:uuid:874aadc2-6496-40b1-1b71-4734aaffd7a5" + } ] + }, { + "sequence": 2, + "diagnosisSequence": [ 1 ], + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } ] + }, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "444814009", + "display": "Viral sinusitis (disorder)" + } ], + "text": "Viral sinusitis (disorder)" + }, + "servicedPeriod": { + "start": "2018-01-29T02:44:52-05:00", + "end": "2018-01-29T02:59:52-05:00" + }, + "locationCodeableConcept": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "21", + "display": "Inpatient Hospital" + } ] + } + } ], + "total": [ { + "category": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/adjudication", + "code": "submitted", + "display": "Submitted Amount" + } ], + "text": "Submitted Amount" + }, + "amount": { + "value": 77.49, + "currency": "USD" + } + } ], + "payment": { + "amount": { + "value": 0.0, + "currency": "USD" + } + } + }, + "request": { + "method": "POST", + "url": "ExplanationOfBenefit" + } + }, { + "fullUrl": "urn:uuid:140548ea-71a3-957d-e5cb-7d679e74ba68", + "resource": { + "resourceType": "Encounter", + "id": "140548ea-71a3-957d-e5cb-7d679e74ba68", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter", "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter" ] + }, + "identifier": [ { + "use": "official", + "system": "https://github.com/synthetichealth/synthea", + "value": "140548ea-71a3-957d-e5cb-7d679e74ba68" + } ], + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB" + }, + "type": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "185345009", + "display": "Encounter for symptom" + } ], + "text": "Encounter for symptom" + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Mr. Lindsay928 Gerlach374" + }, + "participant": [ { + "type": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType", + "code": "PPRF", + "display": "primary performer" + } ], + "text": "primary performer" + } ], + "period": { + "start": "2019-02-23T05:44:52-05:00", + "end": "2019-02-23T05:59:52-05:00" + }, + "individual": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } + } ], + "period": { + "start": "2019-02-23T05:44:52-05:00", + "end": "2019-02-23T05:59:52-05:00" + }, + "reasonCode": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "444814009", + "display": "Viral sinusitis (disorder)" + } ] + } ], + "location": [ { + "location": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + } ], + "serviceProvider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + }, + "request": { + "method": "POST", + "url": "Encounter" + } + }, { + "fullUrl": "urn:uuid:ba0bae82-a587-9943-81e0-6fde6ae7d419", + "resource": { + "resourceType": "Condition", + "id": "ba0bae82-a587-9943-81e0-6fde6ae7d419", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-condition" ] + }, + "clinicalStatus": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/condition-clinical", + "code": "resolved" + } ] + }, + "verificationStatus": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status", + "code": "confirmed" + } ] + }, + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/condition-category", + "code": "encounter-diagnosis", + "display": "Encounter Diagnosis" + } ] + } ], + "code": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "444814009", + "display": "Viral sinusitis (disorder)" + } ], + "text": "Viral sinusitis (disorder)" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:140548ea-71a3-957d-e5cb-7d679e74ba68" + }, + "onsetDateTime": "2019-02-23T05:44:52-05:00", + "abatementDateTime": "2019-03-11T06:44:52-04:00", + "recordedDate": "2019-02-23T05:44:52-05:00" + }, + "request": { + "method": "POST", + "url": "Condition" + } + }, { + "fullUrl": "urn:uuid:f39c599b-4335-3fda-eab8-5a94439f0629", + "resource": { + "resourceType": "DiagnosticReport", + "id": "f39c599b-4335-3fda-eab8-5a94439f0629", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-note" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:140548ea-71a3-957d-e5cb-7d679e74ba68" + }, + "effectiveDateTime": "2019-02-23T05:44:52-05:00", + "issued": "2019-02-23T05:44:52.558-05:00", + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } ], + "presentedForm": [ { + "contentType": "text/plain; charset=utf-8", + "data": "CjIwMTktMDItMjMKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgNjggeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuIFBhdGllbnQgaGFzIGEgaGlzdG9yeSBvZiBhY3V0ZSB2aXJhbCBwaGFyeW5naXRpcyAoZGlzb3JkZXIpLCB2aXJhbCBzaW51c2l0aXMgKGRpc29yZGVyKS4KCiMgU29jaWFsIEhpc3RvcnkKUGF0aWVudCBpcyBtYXJyaWVkLiBQYXRpZW50IGlzIGFuIGFjdGl2ZSBzbW9rZXIgYW5kIGlzIGFuIGFsY29ob2xpYy4KIFBhdGllbnQgaWRlbnRpZmllcyBhcyBoZXRlcm9zZXh1YWwuCgpQYXRpZW50IGNvbWVzIGZyb20gYSBtaWRkbGUgc29jaW9lY29ub21pYyBiYWNrZ3JvdW5kLgogUGF0aWVudCBoYXMgY29tcGxldGVkIHNvbWUgY29sbGVnZSBjb3Vyc2VzLgpQYXRpZW50IGN1cnJlbnRseSBoYXMgTWVkaWNhcmUuCgojIEFsbGVyZ2llcwpObyBLbm93biBBbGxlcmdpZXMuCgojIE1lZGljYXRpb25zCk5vIEFjdGl2ZSBNZWRpY2F0aW9ucy4KCiMgQXNzZXNzbWVudCBhbmQgUGxhbgpQYXRpZW50IGlzIHByZXNlbnRpbmcgd2l0aCB2aXJhbCBzaW51c2l0aXMgKGRpc29yZGVyKS4gCgojIyBQbGFuCgo=" + } ] + }, + "request": { + "method": "POST", + "url": "DiagnosticReport" + } + }, { + "fullUrl": "urn:uuid:f2958dc8-b812-761b-c000-45dcfad25322", + "resource": { + "resourceType": "DocumentReference", + "id": "f2958dc8-b812-761b-c000-45dcfad25322", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-documentreference" ] + }, + "identifier": [ { + "system": "urn:ietf:rfc:3986", + "value": "urn:uuid:f39c599b-4335-3fda-eab8-5a94439f0629" + } ], + "status": "superseded", + "type": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "category": [ { + "coding": [ { + "system": "http://hl7.org/fhir/us/core/CodeSystem/us-core-documentreference-category", + "code": "clinical-note", + "display": "Clinical Note" + } ] + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "date": "2019-02-23T05:44:52.558-05:00", + "author": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } ], + "custodian": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "content": [ { + "attachment": { + "contentType": "text/plain; charset=utf-8", + "data": "CjIwMTktMDItMjMKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgNjggeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuIFBhdGllbnQgaGFzIGEgaGlzdG9yeSBvZiBhY3V0ZSB2aXJhbCBwaGFyeW5naXRpcyAoZGlzb3JkZXIpLCB2aXJhbCBzaW51c2l0aXMgKGRpc29yZGVyKS4KCiMgU29jaWFsIEhpc3RvcnkKUGF0aWVudCBpcyBtYXJyaWVkLiBQYXRpZW50IGlzIGFuIGFjdGl2ZSBzbW9rZXIgYW5kIGlzIGFuIGFsY29ob2xpYy4KIFBhdGllbnQgaWRlbnRpZmllcyBhcyBoZXRlcm9zZXh1YWwuCgpQYXRpZW50IGNvbWVzIGZyb20gYSBtaWRkbGUgc29jaW9lY29ub21pYyBiYWNrZ3JvdW5kLgogUGF0aWVudCBoYXMgY29tcGxldGVkIHNvbWUgY29sbGVnZSBjb3Vyc2VzLgpQYXRpZW50IGN1cnJlbnRseSBoYXMgTWVkaWNhcmUuCgojIEFsbGVyZ2llcwpObyBLbm93biBBbGxlcmdpZXMuCgojIE1lZGljYXRpb25zCk5vIEFjdGl2ZSBNZWRpY2F0aW9ucy4KCiMgQXNzZXNzbWVudCBhbmQgUGxhbgpQYXRpZW50IGlzIHByZXNlbnRpbmcgd2l0aCB2aXJhbCBzaW51c2l0aXMgKGRpc29yZGVyKS4gCgojIyBQbGFuCgo=" + }, + "format": { + "system": "http://ihe.net/fhir/ValueSet/IHE.FormatCode.codesystem", + "code": "urn:ihe:iti:xds:2017:mimeTypeSufficient", + "display": "mimeType Sufficient" + } + } ], + "context": { + "encounter": [ { + "reference": "urn:uuid:140548ea-71a3-957d-e5cb-7d679e74ba68" + } ], + "period": { + "start": "2019-02-23T05:44:52-05:00", + "end": "2019-02-23T05:59:52-05:00" + } + } + }, + "request": { + "method": "POST", + "url": "DocumentReference" + } + }, { + "fullUrl": "urn:uuid:e9ee7298-d537-297a-cbfa-77c723da41c8", + "resource": { + "resourceType": "Claim", + "id": "e9ee7298-d537-297a-cbfa-77c723da41c8", + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Lindsay928 Gerlach374" + }, + "billablePeriod": { + "start": "2019-02-23T05:44:52-05:00", + "end": "2019-02-23T05:59:52-05:00" + }, + "created": "2019-02-23T05:59:52-05:00", + "provider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "priority": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } ] + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "diagnosis": [ { + "sequence": 1, + "diagnosisReference": { + "reference": "urn:uuid:ba0bae82-a587-9943-81e0-6fde6ae7d419" + } + } ], + "insurance": [ { + "sequence": 1, + "focal": true, + "coverage": { + "display": "Medicare" + } + } ], + "item": [ { + "sequence": 1, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "185345009", + "display": "Encounter for symptom" + } ], + "text": "Encounter for symptom" + }, + "encounter": [ { + "reference": "urn:uuid:140548ea-71a3-957d-e5cb-7d679e74ba68" + } ] + }, { + "sequence": 2, + "diagnosisSequence": [ 1 ], + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "444814009", + "display": "Viral sinusitis (disorder)" + } ], + "text": "Viral sinusitis (disorder)" + } + } ], + "total": { + "value": 77.49, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, { + "fullUrl": "urn:uuid:2775d1e7-7213-c9d4-75a9-cc8ec40cbe7e", + "resource": { + "resourceType": "ExplanationOfBenefit", + "id": "2775d1e7-7213-c9d4-75a9-cc8ec40cbe7e", + "contained": [ { + "resourceType": "ServiceRequest", + "id": "referral", + "status": "completed", + "intent": "order", + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "requester": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + } ] + }, { + "resourceType": "Coverage", + "id": "coverage", + "status": "active", + "type": { + "text": "Medicare" + }, + "beneficiary": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "payor": [ { + "display": "Medicare" + } ] + } ], + "identifier": [ { + "system": "https://bluebutton.cms.gov/resources/variables/clm_id", + "value": "e9ee7298-d537-297a-cbfa-77c723da41c8" + }, { + "system": "https://bluebutton.cms.gov/resources/identifier/claim-group", + "value": "99999999999" + } ], + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "billablePeriod": { + "start": "2019-02-23T05:59:52-05:00", + "end": "2020-02-23T05:59:52-05:00" + }, + "created": "2019-02-23T05:59:52-05:00", + "insurer": { + "display": "Medicare" + }, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "referral": { + "reference": "#referral" + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "claim": { + "reference": "urn:uuid:e9ee7298-d537-297a-cbfa-77c723da41c8" + }, + "outcome": "complete", + "careTeam": [ { + "sequence": 1, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "role": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", + "code": "primary", + "display": "Primary Care Practitioner" + } ] + } + } ], + "diagnosis": [ { + "sequence": 1, + "diagnosisReference": { + "reference": "urn:uuid:ba0bae82-a587-9943-81e0-6fde6ae7d419" + }, + "type": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-diagnosistype", + "code": "principal" + } ] + } ] + } ], + "insurance": [ { + "focal": true, + "coverage": { + "reference": "#coverage", + "display": "Medicare" + } + } ], + "item": [ { + "sequence": 1, + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } ] + }, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "185345009", + "display": "Encounter for symptom" + } ], + "text": "Encounter for symptom" + }, + "servicedPeriod": { + "start": "2019-02-23T05:44:52-05:00", + "end": "2019-02-23T05:59:52-05:00" + }, + "locationCodeableConcept": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "21", + "display": "Inpatient Hospital" + } ] + }, + "encounter": [ { + "reference": "urn:uuid:140548ea-71a3-957d-e5cb-7d679e74ba68" + } ] + }, { + "sequence": 2, + "diagnosisSequence": [ 1 ], + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } ] + }, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "444814009", + "display": "Viral sinusitis (disorder)" + } ], + "text": "Viral sinusitis (disorder)" + }, + "servicedPeriod": { + "start": "2019-02-23T05:44:52-05:00", + "end": "2019-02-23T05:59:52-05:00" + }, + "locationCodeableConcept": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "21", + "display": "Inpatient Hospital" + } ] + } + } ], + "total": [ { + "category": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/adjudication", + "code": "submitted", + "display": "Submitted Amount" + } ], + "text": "Submitted Amount" + }, + "amount": { + "value": 77.49, + "currency": "USD" + } + } ], + "payment": { + "amount": { + "value": 0.0, + "currency": "USD" + } + } + }, + "request": { + "method": "POST", + "url": "ExplanationOfBenefit" + } + }, { + "fullUrl": "urn:uuid:548de770-6d57-a36a-8b75-a257423c2ee9", + "resource": { + "resourceType": "Encounter", + "id": "548de770-6d57-a36a-8b75-a257423c2ee9", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter", "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter" ] + }, + "identifier": [ { + "use": "official", + "system": "https://github.com/synthetichealth/synthea", + "value": "548de770-6d57-a36a-8b75-a257423c2ee9" + } ], + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB" + }, + "type": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "185345009", + "display": "Encounter for symptom (procedure)" + } ], + "text": "Encounter for symptom (procedure)" + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Mr. Lindsay928 Gerlach374" + }, + "participant": [ { + "type": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType", + "code": "PPRF", + "display": "primary performer" + } ], + "text": "primary performer" + } ], + "period": { + "start": "2020-03-14T12:44:52-04:00", + "end": "2020-03-14T14:02:53-04:00" + }, + "individual": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } + } ], + "period": { + "start": "2020-03-14T12:44:52-04:00", + "end": "2020-03-14T14:02:53-04:00" + }, + "reasonCode": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "274531002", + "display": "Abnormal findings diagnostic imaging heart+coronary circulat (finding)" + } ] + } ], + "location": [ { + "location": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + } ], + "serviceProvider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + }, + "request": { + "method": "POST", + "url": "Encounter" + } + }, { + "fullUrl": "urn:uuid:ee1d15a4-8c54-552d-bb74-4c1512a19bd3", + "resource": { + "resourceType": "Condition", + "id": "ee1d15a4-8c54-552d-bb74-4c1512a19bd3", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-condition" ] + }, + "clinicalStatus": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/condition-clinical", + "code": "resolved" + } ] + }, + "verificationStatus": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status", + "code": "confirmed" + } ] + }, + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/condition-category", + "code": "encounter-diagnosis", + "display": "Encounter Diagnosis" + } ] + } ], + "code": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "25064002", + "display": "Headache (finding)" + } ], + "text": "Headache (finding)" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:548de770-6d57-a36a-8b75-a257423c2ee9" + }, + "onsetDateTime": "2020-03-14T12:44:52-04:00", + "abatementDateTime": "2020-04-07T08:02:53-04:00", + "recordedDate": "2020-03-14T12:44:52-04:00" + }, + "request": { + "method": "POST", + "url": "Condition" + } + }, { + "fullUrl": "urn:uuid:2f1493c2-292b-e73b-5ef5-3fce36251551", + "resource": { + "resourceType": "Condition", + "id": "2f1493c2-292b-e73b-5ef5-3fce36251551", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-condition" ] + }, + "clinicalStatus": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/condition-clinical", + "code": "resolved" + } ] + }, + "verificationStatus": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status", + "code": "confirmed" + } ] + }, + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/condition-category", + "code": "encounter-diagnosis", + "display": "Encounter Diagnosis" + } ] + } ], + "code": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "49727002", + "display": "Cough (finding)" + } ], + "text": "Cough (finding)" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:548de770-6d57-a36a-8b75-a257423c2ee9" + }, + "onsetDateTime": "2020-03-14T12:44:52-04:00", + "abatementDateTime": "2020-04-07T08:02:53-04:00", + "recordedDate": "2020-03-14T12:44:52-04:00" + }, + "request": { + "method": "POST", + "url": "Condition" + } + }, { + "fullUrl": "urn:uuid:d56b691f-18eb-45a9-62c3-74047d85b526", + "resource": { + "resourceType": "Condition", + "id": "d56b691f-18eb-45a9-62c3-74047d85b526", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-condition" ] + }, + "clinicalStatus": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/condition-clinical", + "code": "resolved" + } ] + }, + "verificationStatus": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status", + "code": "confirmed" + } ] + }, + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/condition-category", + "code": "encounter-diagnosis", + "display": "Encounter Diagnosis" + } ] + } ], + "code": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "248595008", + "display": "Sputum finding (finding)" + } ], + "text": "Sputum finding (finding)" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:548de770-6d57-a36a-8b75-a257423c2ee9" + }, + "onsetDateTime": "2020-03-14T12:44:52-04:00", + "abatementDateTime": "2020-04-07T08:02:53-04:00", + "recordedDate": "2020-03-14T12:44:52-04:00" + }, + "request": { + "method": "POST", + "url": "Condition" + } + }, { + "fullUrl": "urn:uuid:987d49c5-fc8b-2382-502b-a06cbd14e36a", + "resource": { + "resourceType": "Condition", + "id": "987d49c5-fc8b-2382-502b-a06cbd14e36a", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-condition" ] + }, + "clinicalStatus": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/condition-clinical", + "code": "resolved" + } ] + }, + "verificationStatus": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status", + "code": "confirmed" + } ] + }, + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/condition-category", + "code": "encounter-diagnosis", + "display": "Encounter Diagnosis" + } ] + } ], + "code": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "267036007", + "display": "Dyspnea (finding)" + } ], + "text": "Dyspnea (finding)" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:548de770-6d57-a36a-8b75-a257423c2ee9" + }, + "onsetDateTime": "2020-03-14T12:44:52-04:00", + "abatementDateTime": "2020-04-07T08:02:53-04:00", + "recordedDate": "2020-03-14T12:44:52-04:00" + }, + "request": { + "method": "POST", + "url": "Condition" + } + }, { + "fullUrl": "urn:uuid:eea22844-d6ed-8a10-0359-55e4c2cec166", + "resource": { + "resourceType": "Condition", + "id": "eea22844-d6ed-8a10-0359-55e4c2cec166", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-condition" ] + }, + "clinicalStatus": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/condition-clinical", + "code": "resolved" + } ] + }, + "verificationStatus": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status", + "code": "confirmed" + } ] + }, + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/condition-category", + "code": "encounter-diagnosis", + "display": "Encounter Diagnosis" + } ] + } ], + "code": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "56018004", + "display": "Wheezing (finding)" + } ], + "text": "Wheezing (finding)" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:548de770-6d57-a36a-8b75-a257423c2ee9" + }, + "onsetDateTime": "2020-03-14T12:44:52-04:00", + "abatementDateTime": "2020-04-07T08:02:53-04:00", + "recordedDate": "2020-03-14T12:44:52-04:00" + }, + "request": { + "method": "POST", + "url": "Condition" + } + }, { + "fullUrl": "urn:uuid:07cc90c4-568e-9859-dd59-21a418d3dec2", + "resource": { + "resourceType": "Condition", + "id": "07cc90c4-568e-9859-dd59-21a418d3dec2", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-condition" ] + }, + "clinicalStatus": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/condition-clinical", + "code": "resolved" + } ] + }, + "verificationStatus": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status", + "code": "confirmed" + } ] + }, + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/condition-category", + "code": "encounter-diagnosis", + "display": "Encounter Diagnosis" + } ] + } ], + "code": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "43724002", + "display": "Chill (finding)" + } ], + "text": "Chill (finding)" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:548de770-6d57-a36a-8b75-a257423c2ee9" + }, + "onsetDateTime": "2020-03-14T12:44:52-04:00", + "abatementDateTime": "2020-04-07T08:02:53-04:00", + "recordedDate": "2020-03-14T12:44:52-04:00" + }, + "request": { + "method": "POST", + "url": "Condition" + } + }, { + "fullUrl": "urn:uuid:294a2158-9803-36ec-1a3d-2fb2f7e69ce1", + "resource": { + "resourceType": "Condition", + "id": "294a2158-9803-36ec-1a3d-2fb2f7e69ce1", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-condition" ] + }, + "clinicalStatus": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/condition-clinical", + "code": "resolved" + } ] + }, + "verificationStatus": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status", + "code": "confirmed" + } ] + }, + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/condition-category", + "code": "encounter-diagnosis", + "display": "Encounter Diagnosis" + } ] + } ], + "code": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "840544004", + "display": "Suspected COVID-19" + } ], + "text": "Suspected COVID-19" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:548de770-6d57-a36a-8b75-a257423c2ee9" + }, + "onsetDateTime": "2020-03-14T12:44:52-04:00", + "abatementDateTime": "2020-03-14T14:02:53-04:00", + "recordedDate": "2020-03-14T12:44:52-04:00" + }, + "request": { + "method": "POST", + "url": "Condition" + } + }, { + "fullUrl": "urn:uuid:eca2b39a-16c8-c3dd-f9c5-209b7ad0e48c", + "resource": { + "resourceType": "Condition", + "id": "eca2b39a-16c8-c3dd-f9c5-209b7ad0e48c", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-condition" ] + }, + "clinicalStatus": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/condition-clinical", + "code": "resolved" + } ] + }, + "verificationStatus": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status", + "code": "confirmed" + } ] + }, + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/condition-category", + "code": "encounter-diagnosis", + "display": "Encounter Diagnosis" + } ] + } ], + "code": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "840539006", + "display": "COVID-19" + } ], + "text": "COVID-19" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:548de770-6d57-a36a-8b75-a257423c2ee9" + }, + "onsetDateTime": "2020-03-14T14:02:53-04:00", + "abatementDateTime": "2020-04-07T08:02:53-04:00", + "recordedDate": "2020-03-14T14:02:53-04:00" + }, + "request": { + "method": "POST", + "url": "Condition" + } + }, { + "fullUrl": "urn:uuid:2e480b73-2894-fb0d-21c1-06603abd11cd", + "resource": { + "resourceType": "Observation", + "id": "2e480b73-2894-fb0d-21c1-06603abd11cd", + "meta": { + "profile": [ "http://hl7.org/fhir/StructureDefinition/bodytemp", "http://hl7.org/fhir/StructureDefinition/vitalsigns" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "8310-5", + "display": "Body temperature" + }, { + "system": "http://loinc.org", + "code": "8331-1", + "display": "Oral temperature" + } ], + "text": "Body temperature" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:548de770-6d57-a36a-8b75-a257423c2ee9" + }, + "effectiveInstant": "2020-03-14T12:44:52-04:00", + "issued": "2020-03-14T12:44:52.558-04:00", + "valueQuantity": { + "value": 41.957, + "unit": "Cel", + "system": "http://unitsofmeasure.org", + "code": "Cel" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, { + "fullUrl": "urn:uuid:b1911f3a-5c85-9eae-c872-bcad37d73a1d", + "resource": { + "resourceType": "Observation", + "id": "b1911f3a-5c85-9eae-c872-bcad37d73a1d", + "meta": { + "profile": [ "http://hl7.org/fhir/StructureDefinition/resprate", "http://hl7.org/fhir/StructureDefinition/vitalsigns" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "9279-1", + "display": "Respiratory rate" + } ], + "text": "Respiratory rate" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:548de770-6d57-a36a-8b75-a257423c2ee9" + }, + "effectiveInstant": "2020-03-14T12:44:52-04:00", + "issued": "2020-03-14T12:44:52.558-04:00", + "valueQuantity": { + "value": 34.989, + "unit": "/min", + "system": "http://unitsofmeasure.org", + "code": "/min" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, { + "fullUrl": "urn:uuid:f3994cff-cf83-a405-f9b0-104fef3a30c1", + "resource": { + "resourceType": "Observation", + "id": "f3994cff-cf83-a405-f9b0-104fef3a30c1", + "meta": { + "profile": [ "http://hl7.org/fhir/StructureDefinition/heartrate", "http://hl7.org/fhir/StructureDefinition/vitalsigns" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "8867-4", + "display": "Heart rate" + } ], + "text": "Heart rate" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:548de770-6d57-a36a-8b75-a257423c2ee9" + }, + "effectiveInstant": "2020-03-14T12:44:52-04:00", + "issued": "2020-03-14T12:44:52.558-04:00", + "valueQuantity": { + "value": 194.13, + "unit": "/min", + "system": "http://unitsofmeasure.org", + "code": "/min" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, { + "fullUrl": "urn:uuid:374d112a-6225-e872-8ebb-69e7017ded70", + "resource": { + "resourceType": "Observation", + "id": "374d112a-6225-e872-8ebb-69e7017ded70", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-pulse-oximetry" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "2708-6", + "display": "Oxygen saturation in Arterial blood" + }, { + "system": "http://loinc.org", + "code": "59408-5", + "display": "Oxygen saturation in Arterial blood by Pulse oximetry" + } ], + "text": "Oxygen saturation in Arterial blood" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:548de770-6d57-a36a-8b75-a257423c2ee9" + }, + "effectiveInstant": "2020-03-14T12:44:52-04:00", + "issued": "2020-03-14T12:44:52.558-04:00", + "valueQuantity": { + "value": 75.76, + "unit": "%", + "system": "http://unitsofmeasure.org", + "code": "%" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, { + "fullUrl": "urn:uuid:3773123f-669b-b2ad-0def-efdafa733939", + "resource": { + "resourceType": "Observation", + "id": "3773123f-669b-b2ad-0def-efdafa733939", + "meta": { + "profile": [ "http://hl7.org/fhir/StructureDefinition/bp", "http://hl7.org/fhir/StructureDefinition/vitalsigns" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "85354-9", + "display": "Blood Pressure" + } ], + "text": "Blood Pressure" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:548de770-6d57-a36a-8b75-a257423c2ee9" + }, + "effectiveInstant": "2020-03-14T12:44:52-04:00", + "issued": "2020-03-14T12:44:52.558-04:00", + "component": [ { + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "8462-4", + "display": "Diastolic Blood Pressure" + } ], + "text": "Diastolic Blood Pressure" + }, + "valueQuantity": { + "value": 49, + "unit": "mm[Hg]", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + }, { + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "8480-6", + "display": "Systolic Blood Pressure" + } ], + "text": "Systolic Blood Pressure" + }, + "valueQuantity": { + "value": 136, + "unit": "mm[Hg]", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + } ] + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, { + "fullUrl": "urn:uuid:e9199602-06e7-8451-a7b9-538cecf2c5a3", + "resource": { + "resourceType": "Observation", + "id": "e9199602-06e7-8451-a7b9-538cecf2c5a3", + "meta": { + "profile": [ "http://hl7.org/fhir/StructureDefinition/bodyweight", "http://hl7.org/fhir/StructureDefinition/vitalsigns" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "29463-7", + "display": "Body Weight" + } ], + "text": "Body Weight" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:548de770-6d57-a36a-8b75-a257423c2ee9" + }, + "effectiveInstant": "2020-03-14T12:44:52-04:00", + "issued": "2020-03-14T12:44:52.558-04:00", + "valueQuantity": { + "value": 79.7, + "unit": "kg", + "system": "http://unitsofmeasure.org", + "code": "kg" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, { + "fullUrl": "urn:uuid:6ebdb3c3-4136-ff9e-691e-bdcf5b641215", + "resource": { + "resourceType": "Observation", + "id": "6ebdb3c3-4136-ff9e-691e-bdcf5b641215", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-lab" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "laboratory", + "display": "laboratory" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "92142-9", + "display": "Influenza virus A RNA [Presence] in Respiratory specimen by NAA with probe detection" + } ], + "text": "Influenza virus A RNA [Presence] in Respiratory specimen by NAA with probe detection" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:548de770-6d57-a36a-8b75-a257423c2ee9" + }, + "effectiveInstant": "2020-03-14T12:59:46-04:00", + "issued": "2020-03-14T12:59:46.558-04:00", + "valueCodeableConcept": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "260385009", + "display": "Negative (qualifier value)" + } ], + "text": "Negative (qualifier value)" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, { + "fullUrl": "urn:uuid:7c02d7f0-e1ac-e57a-b4ab-8e95a102c378", + "resource": { + "resourceType": "Observation", + "id": "7c02d7f0-e1ac-e57a-b4ab-8e95a102c378", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-lab" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "laboratory", + "display": "laboratory" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "92141-1", + "display": "Influenza virus B RNA [Presence] in Respiratory specimen by NAA with probe detection" + } ], + "text": "Influenza virus B RNA [Presence] in Respiratory specimen by NAA with probe detection" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:548de770-6d57-a36a-8b75-a257423c2ee9" + }, + "effectiveInstant": "2020-03-14T12:59:46-04:00", + "issued": "2020-03-14T12:59:46.558-04:00", + "valueCodeableConcept": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "260385009", + "display": "Negative (qualifier value)" + } ], + "text": "Negative (qualifier value)" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, { + "fullUrl": "urn:uuid:78266cf3-92be-6fb9-47f7-e3ecf72f521a", + "resource": { + "resourceType": "Observation", + "id": "78266cf3-92be-6fb9-47f7-e3ecf72f521a", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-lab" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "laboratory", + "display": "laboratory" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "92131-2", + "display": "Respiratory syncytial virus RNA [Presence] in Respiratory specimen by NAA with probe detection" + } ], + "text": "Respiratory syncytial virus RNA [Presence] in Respiratory specimen by NAA with probe detection" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:548de770-6d57-a36a-8b75-a257423c2ee9" + }, + "effectiveInstant": "2020-03-14T12:59:46-04:00", + "issued": "2020-03-14T12:59:46.558-04:00", + "valueCodeableConcept": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "260385009", + "display": "Negative (qualifier value)" + } ], + "text": "Negative (qualifier value)" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, { + "fullUrl": "urn:uuid:43c4bd38-b795-8b9d-e1be-1c2a9f8231d5", + "resource": { + "resourceType": "Observation", + "id": "43c4bd38-b795-8b9d-e1be-1c2a9f8231d5", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-lab" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "laboratory", + "display": "laboratory" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "92140-3", + "display": "Parainfluenza virus 1 RNA [Presence] in Respiratory specimen by NAA with probe detection" + } ], + "text": "Parainfluenza virus 1 RNA [Presence] in Respiratory specimen by NAA with probe detection" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:548de770-6d57-a36a-8b75-a257423c2ee9" + }, + "effectiveInstant": "2020-03-14T12:59:46-04:00", + "issued": "2020-03-14T12:59:46.558-04:00", + "valueCodeableConcept": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "260385009", + "display": "Negative (qualifier value)" + } ], + "text": "Negative (qualifier value)" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, { + "fullUrl": "urn:uuid:9241628c-cafd-b8a0-d189-c7686d26d86f", + "resource": { + "resourceType": "Observation", + "id": "9241628c-cafd-b8a0-d189-c7686d26d86f", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-lab" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "laboratory", + "display": "laboratory" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "92139-5", + "display": "Parainfluenza virus 2 RNA [Presence] in Respiratory specimen by NAA with probe detection" + } ], + "text": "Parainfluenza virus 2 RNA [Presence] in Respiratory specimen by NAA with probe detection" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:548de770-6d57-a36a-8b75-a257423c2ee9" + }, + "effectiveInstant": "2020-03-14T12:59:46-04:00", + "issued": "2020-03-14T12:59:46.558-04:00", + "valueCodeableConcept": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "260385009", + "display": "Negative (qualifier value)" + } ], + "text": "Negative (qualifier value)" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, { + "fullUrl": "urn:uuid:c976d6ae-f979-8f70-d9df-bc2c40764644", + "resource": { + "resourceType": "Observation", + "id": "c976d6ae-f979-8f70-d9df-bc2c40764644", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-lab" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "laboratory", + "display": "laboratory" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "92138-7", + "display": "Parainfluenza virus 3 RNA [Presence] in Respiratory specimen by NAA with probe detection" + } ], + "text": "Parainfluenza virus 3 RNA [Presence] in Respiratory specimen by NAA with probe detection" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:548de770-6d57-a36a-8b75-a257423c2ee9" + }, + "effectiveInstant": "2020-03-14T12:59:46-04:00", + "issued": "2020-03-14T12:59:46.558-04:00", + "valueCodeableConcept": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "260385009", + "display": "Negative (qualifier value)" + } ], + "text": "Negative (qualifier value)" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, { + "fullUrl": "urn:uuid:a875f91f-6a7b-353a-4f86-43694d1ef522", + "resource": { + "resourceType": "Observation", + "id": "a875f91f-6a7b-353a-4f86-43694d1ef522", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-lab" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "laboratory", + "display": "laboratory" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "92130-4", + "display": "Rhinovirus RNA [Presence] in Respiratory specimen by NAA with probe detection" + } ], + "text": "Rhinovirus RNA [Presence] in Respiratory specimen by NAA with probe detection" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:548de770-6d57-a36a-8b75-a257423c2ee9" + }, + "effectiveInstant": "2020-03-14T12:59:46-04:00", + "issued": "2020-03-14T12:59:46.558-04:00", + "valueCodeableConcept": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "260385009", + "display": "Negative (qualifier value)" + } ], + "text": "Negative (qualifier value)" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, { + "fullUrl": "urn:uuid:f9579e3c-7b9a-3f2b-ef8f-8faa9fa25173", + "resource": { + "resourceType": "Observation", + "id": "f9579e3c-7b9a-3f2b-ef8f-8faa9fa25173", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-lab" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "laboratory", + "display": "laboratory" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "92134-6", + "display": "Human metapneumovirus RNA [Presence] in Respiratory specimen by NAA with probe detection" + } ], + "text": "Human metapneumovirus RNA [Presence] in Respiratory specimen by NAA with probe detection" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:548de770-6d57-a36a-8b75-a257423c2ee9" + }, + "effectiveInstant": "2020-03-14T12:59:46-04:00", + "issued": "2020-03-14T12:59:46.558-04:00", + "valueCodeableConcept": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "260385009", + "display": "Negative (qualifier value)" + } ], + "text": "Negative (qualifier value)" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, { + "fullUrl": "urn:uuid:07af7b8d-2545-ca33-a137-f38d18ce21a1", + "resource": { + "resourceType": "Observation", + "id": "07af7b8d-2545-ca33-a137-f38d18ce21a1", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-lab" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "laboratory", + "display": "laboratory" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "94040-3", + "display": "Adenovirus A+B+C+D+E DNA [Presence] in Respiratory specimen by NAA with probe detection" + } ], + "text": "Adenovirus A+B+C+D+E DNA [Presence] in Respiratory specimen by NAA with probe detection" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:548de770-6d57-a36a-8b75-a257423c2ee9" + }, + "effectiveInstant": "2020-03-14T12:59:46-04:00", + "issued": "2020-03-14T12:59:46.558-04:00", + "valueCodeableConcept": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "260385009", + "display": "Negative (qualifier value)" + } ], + "text": "Negative (qualifier value)" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, { + "fullUrl": "urn:uuid:ce51055d-f319-cb0b-13cc-8b6e6f5a7fb5", + "resource": { + "resourceType": "Observation", + "id": "ce51055d-f319-cb0b-13cc-8b6e6f5a7fb5", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-lab" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "laboratory", + "display": "laboratory" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "94531-1", + "display": "SARS-CoV-2 RNA Pnl Resp NAA+probe" + } ], + "text": "SARS-CoV-2 RNA Pnl Resp NAA+probe" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:548de770-6d57-a36a-8b75-a257423c2ee9" + }, + "effectiveInstant": "2020-03-14T14:02:53-04:00", + "issued": "2020-03-14T14:02:53.558-04:00", + "valueCodeableConcept": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "260373001", + "display": "Detected (qualifier value)" + } ], + "text": "Detected (qualifier value)" + } + }, + "request": { + "method": "POST", + "url": "Observation" + } + }, { + "fullUrl": "urn:uuid:f10c118e-c6ea-da79-aae6-4e650f3b4941", + "resource": { + "resourceType": "Procedure", + "id": "f10c118e-c6ea-da79-aae6-4e650f3b4941", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-procedure" ] + }, + "status": "completed", + "code": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "261352009", + "display": "Face mask (physical object)" + } ], + "text": "Face mask (physical object)" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:548de770-6d57-a36a-8b75-a257423c2ee9" + }, + "performedPeriod": { + "start": "2020-03-14T12:44:52-04:00", + "end": "2020-03-14T12:59:46-04:00" + }, + "location": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "reasonReference": [ { + "reference": "urn:uuid:294a2158-9803-36ec-1a3d-2fb2f7e69ce1", + "display": "Suspected COVID-19" + } ] + }, + "request": { + "method": "POST", + "url": "Procedure" + } + }, { + "fullUrl": "urn:uuid:db1053a6-e50c-01d2-6f90-ba715dbe2980", + "resource": { + "resourceType": "DiagnosticReport", + "id": "db1053a6-e50c-01d2-6f90-ba715dbe2980", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-lab" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/v2-0074", + "code": "LAB", + "display": "Laboratory" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "92143-7", + "display": "Respiratory pathogens DNA and RNA panel - Respiratory specimen by NAA with probe detection" + } ], + "text": "Respiratory pathogens DNA and RNA panel - Respiratory specimen by NAA with probe detection" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:548de770-6d57-a36a-8b75-a257423c2ee9" + }, + "effectiveDateTime": "2020-03-14T12:59:46-04:00", + "issued": "2020-03-14T12:59:46.558-04:00", + "performer": [ { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } ], + "result": [ { + "reference": "urn:uuid:6ebdb3c3-4136-ff9e-691e-bdcf5b641215", + "display": "Influenza virus A RNA [Presence] in Respiratory specimen by NAA with probe detection" + }, { + "reference": "urn:uuid:7c02d7f0-e1ac-e57a-b4ab-8e95a102c378", + "display": "Influenza virus B RNA [Presence] in Respiratory specimen by NAA with probe detection" + }, { + "reference": "urn:uuid:78266cf3-92be-6fb9-47f7-e3ecf72f521a", + "display": "Respiratory syncytial virus RNA [Presence] in Respiratory specimen by NAA with probe detection" + }, { + "reference": "urn:uuid:43c4bd38-b795-8b9d-e1be-1c2a9f8231d5", + "display": "Parainfluenza virus 1 RNA [Presence] in Respiratory specimen by NAA with probe detection" + }, { + "reference": "urn:uuid:9241628c-cafd-b8a0-d189-c7686d26d86f", + "display": "Parainfluenza virus 2 RNA [Presence] in Respiratory specimen by NAA with probe detection" + }, { + "reference": "urn:uuid:c976d6ae-f979-8f70-d9df-bc2c40764644", + "display": "Parainfluenza virus 3 RNA [Presence] in Respiratory specimen by NAA with probe detection" + }, { + "reference": "urn:uuid:a875f91f-6a7b-353a-4f86-43694d1ef522", + "display": "Rhinovirus RNA [Presence] in Respiratory specimen by NAA with probe detection" + }, { + "reference": "urn:uuid:f9579e3c-7b9a-3f2b-ef8f-8faa9fa25173", + "display": "Human metapneumovirus RNA [Presence] in Respiratory specimen by NAA with probe detection" + }, { + "reference": "urn:uuid:07af7b8d-2545-ca33-a137-f38d18ce21a1", + "display": "Adenovirus A+B+C+D+E DNA [Presence] in Respiratory specimen by NAA with probe detection" + } ] + }, + "request": { + "method": "POST", + "url": "DiagnosticReport" + } + }, { + "fullUrl": "urn:uuid:4e04062f-2e86-4bc0-32b2-8ff3df7ca1bb", + "resource": { + "resourceType": "DiagnosticReport", + "id": "4e04062f-2e86-4bc0-32b2-8ff3df7ca1bb", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-lab" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/v2-0074", + "code": "LAB", + "display": "Laboratory" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "94531-1", + "display": "SARS-CoV-2 RNA Pnl Resp NAA+probe" + } ], + "text": "SARS-CoV-2 RNA Pnl Resp NAA+probe" + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:548de770-6d57-a36a-8b75-a257423c2ee9" + }, + "effectiveDateTime": "2020-03-14T14:02:53-04:00", + "issued": "2020-03-14T14:02:53.558-04:00", + "performer": [ { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } ], + "result": [ { + "reference": "urn:uuid:ce51055d-f319-cb0b-13cc-8b6e6f5a7fb5", + "display": "SARS-CoV-2 RNA Pnl Resp NAA+probe" + } ] + }, + "request": { + "method": "POST", + "url": "DiagnosticReport" + } + }, { + "fullUrl": "urn:uuid:71cb553c-9b32-1d45-d782-50627bbbb3ed", + "resource": { + "resourceType": "CareTeam", + "id": "71cb553c-9b32-1d45-d782-50627bbbb3ed", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-careteam" ] + }, + "status": "inactive", + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:548de770-6d57-a36a-8b75-a257423c2ee9" + }, + "period": { + "start": "2020-03-14T12:59:46-04:00", + "end": "2020-03-14T14:02:53-04:00" + }, + "participant": [ { + "role": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "116154003", + "display": "Patient" + } ], + "text": "Patient" + } ], + "member": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Mr. Lindsay928 Gerlach374" + } + }, { + "role": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "223366009", + "display": "Healthcare professional (occupation)" + } ], + "text": "Healthcare professional (occupation)" + } ], + "member": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } + }, { + "role": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "224891009", + "display": "Healthcare services (qualifier value)" + } ], + "text": "Healthcare services (qualifier value)" + } ], + "member": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + } ], + "reasonCode": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "840544004", + "display": "Suspected COVID-19" + } ], + "text": "Suspected COVID-19" + } ], + "managingOrganization": [ { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } ] + }, + "request": { + "method": "POST", + "url": "CareTeam" + } + }, { + "fullUrl": "urn:uuid:fec35e4d-e61e-9aff-f337-7435064913aa", + "resource": { + "resourceType": "CarePlan", + "id": "fec35e4d-e61e-9aff-f337-7435064913aa", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-careplan" ] + }, + "text": { + "status": "generated", + "div": "
Care Plan for Infectious disease care plan (record artifact).
Activities:
  • Infectious disease care plan (record artifact)
  • Infectious disease care plan (record artifact)

Care plan is meant to treat Suspected COVID-19.
" + }, + "status": "completed", + "intent": "order", + "category": [ { + "coding": [ { + "system": "http://hl7.org/fhir/us/core/CodeSystem/careplan-category", + "code": "assess-plan" + } ] + }, { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "736376001", + "display": "Infectious disease care plan (record artifact)" + } ], + "text": "Infectious disease care plan (record artifact)" + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:548de770-6d57-a36a-8b75-a257423c2ee9" + }, + "period": { + "start": "2020-03-14T12:59:46-04:00", + "end": "2020-03-14T14:02:53-04:00" + }, + "careTeam": [ { + "reference": "urn:uuid:71cb553c-9b32-1d45-d782-50627bbbb3ed" + } ], + "addresses": [ { + "reference": "urn:uuid:294a2158-9803-36ec-1a3d-2fb2f7e69ce1" + } ], + "activity": [ { + "detail": { + "code": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "409524006", + "display": "Airborne precautions (procedure)" + } ], + "text": "Airborne precautions (procedure)" + }, + "status": "completed", + "location": { + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + } + }, { + "detail": { + "code": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "409526008", + "display": "Personal protective equipment (physical object)" + } ], + "text": "Personal protective equipment (physical object)" + }, + "status": "completed", + "location": { + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + } + } ] + }, + "request": { + "method": "POST", + "url": "CarePlan" + } + }, { + "fullUrl": "urn:uuid:750cd959-62b3-9ead-dcc4-8c23df80013c", + "resource": { + "resourceType": "CareTeam", + "id": "750cd959-62b3-9ead-dcc4-8c23df80013c", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-careteam" ] + }, + "status": "inactive", + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:548de770-6d57-a36a-8b75-a257423c2ee9" + }, + "period": { + "start": "2020-03-14T14:02:53-04:00", + "end": "2020-04-07T08:02:53-04:00" + }, + "participant": [ { + "role": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "116154003", + "display": "Patient" + } ], + "text": "Patient" + } ], + "member": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Mr. Lindsay928 Gerlach374" + } + }, { + "role": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "223366009", + "display": "Healthcare professional (occupation)" + } ], + "text": "Healthcare professional (occupation)" + } ], + "member": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } + }, { + "role": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "224891009", + "display": "Healthcare services (qualifier value)" + } ], + "text": "Healthcare services (qualifier value)" + } ], + "member": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + } ], + "reasonCode": [ { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "840539006", + "display": "COVID-19" + } ], + "text": "COVID-19" + } ], + "managingOrganization": [ { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } ] + }, + "request": { + "method": "POST", + "url": "CareTeam" + } + }, { + "fullUrl": "urn:uuid:d8afbf20-4cbf-00f1-ab75-c192c81e330e", + "resource": { + "resourceType": "CarePlan", + "id": "d8afbf20-4cbf-00f1-ab75-c192c81e330e", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-careplan" ] + }, + "text": { + "status": "generated", + "div": "
Care Plan for Infectious disease care plan (record artifact).
Activities:
  • Infectious disease care plan (record artifact)
  • Infectious disease care plan (record artifact)

Care plan is meant to treat COVID-19.
" + }, + "status": "completed", + "intent": "order", + "category": [ { + "coding": [ { + "system": "http://hl7.org/fhir/us/core/CodeSystem/careplan-category", + "code": "assess-plan" + } ] + }, { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "736376001", + "display": "Infectious disease care plan (record artifact)" + } ], + "text": "Infectious disease care plan (record artifact)" + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:548de770-6d57-a36a-8b75-a257423c2ee9" + }, + "period": { + "start": "2020-03-14T14:02:53-04:00", + "end": "2020-04-07T08:02:53-04:00" + }, + "careTeam": [ { + "reference": "urn:uuid:750cd959-62b3-9ead-dcc4-8c23df80013c" + } ], + "addresses": [ { + "reference": "urn:uuid:eca2b39a-16c8-c3dd-f9c5-209b7ad0e48c" + } ], + "activity": [ { + "detail": { + "code": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "409524006", + "display": "Airborne precautions (procedure)" + } ], + "text": "Airborne precautions (procedure)" + }, + "status": "completed", + "location": { + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + } + }, { + "detail": { + "code": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "361235007", + "display": "Isolation of infected patient (procedure)" + } ], + "text": "Isolation of infected patient (procedure)" + }, + "status": "completed", + "location": { + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + } + } + } ] + }, + "request": { + "method": "POST", + "url": "CarePlan" + } + }, { + "fullUrl": "urn:uuid:0d2280c7-d166-3b57-f112-6a4b8e33714d", + "resource": { + "resourceType": "DiagnosticReport", + "id": "0d2280c7-d166-3b57-f112-6a4b8e33714d", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-note" ] + }, + "status": "final", + "category": [ { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + } ], + "code": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "encounter": { + "reference": "urn:uuid:548de770-6d57-a36a-8b75-a257423c2ee9" + }, + "effectiveDateTime": "2020-03-14T12:44:52-04:00", + "issued": "2020-03-14T12:44:52.558-04:00", + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } ], + "presentedForm": [ { + "contentType": "text/plain; charset=utf-8", + "data": "CjIwMjAtMDMtMTQKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgNjkgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuIFBhdGllbnQgaGFzIGEgaGlzdG9yeSBvZiBhY3V0ZSB2aXJhbCBwaGFyeW5naXRpcyAoZGlzb3JkZXIpLCB2aXJhbCBzaW51c2l0aXMgKGRpc29yZGVyKS4KCiMgU29jaWFsIEhpc3RvcnkKUGF0aWVudCBpcyBtYXJyaWVkLiBQYXRpZW50IGlzIGFuIGFjdGl2ZSBzbW9rZXIgYW5kIGlzIGFuIGFsY29ob2xpYy4KIFBhdGllbnQgaWRlbnRpZmllcyBhcyBoZXRlcm9zZXh1YWwuCgpQYXRpZW50IGNvbWVzIGZyb20gYSBtaWRkbGUgc29jaW9lY29ub21pYyBiYWNrZ3JvdW5kLgogUGF0aWVudCBoYXMgY29tcGxldGVkIHNvbWUgY29sbGVnZSBjb3Vyc2VzLgpQYXRpZW50IGN1cnJlbnRseSBoYXMgTWVkaWNhcmUuCgojIEFsbGVyZ2llcwpObyBLbm93biBBbGxlcmdpZXMuCgojIE1lZGljYXRpb25zCk5vIEFjdGl2ZSBNZWRpY2F0aW9ucy4KCiMgQXNzZXNzbWVudCBhbmQgUGxhbgpQYXRpZW50IGlzIHByZXNlbnRpbmcgd2l0aCBoZWFkYWNoZSAoZmluZGluZyksIGNvdWdoIChmaW5kaW5nKSwgc3B1dHVtIGZpbmRpbmcgKGZpbmRpbmcpLCBkeXNwbmVhIChmaW5kaW5nKSwgd2hlZXppbmcgKGZpbmRpbmcpLCBjaGlsbCAoZmluZGluZyksIHN1c3BlY3RlZCBjb3ZpZC0xOSwgY292aWQtMTkuIAoKIyMgUGxhbgoKVGhlIGZvbGxvd2luZyBwcm9jZWR1cmVzIHdlcmUgY29uZHVjdGVkOgotIGZhY2UgbWFzayAocGh5c2ljYWwgb2JqZWN0KQpUaGUgcGF0aWVudCB3YXMgcGxhY2VkIG9uIGEgY2FyZXBsYW46Ci0gaW5mZWN0aW91cyBkaXNlYXNlIGNhcmUgcGxhbiAocmVjb3JkIGFydGlmYWN0KQotIGluZmVjdGlvdXMgZGlzZWFzZSBjYXJlIHBsYW4gKHJlY29yZCBhcnRpZmFjdCkK" + } ] + }, + "request": { + "method": "POST", + "url": "DiagnosticReport" + } + }, { + "fullUrl": "urn:uuid:7054a4ac-0701-a695-9ad7-a36f6ffcc7cb", + "resource": { + "resourceType": "DocumentReference", + "id": "7054a4ac-0701-a695-9ad7-a36f6ffcc7cb", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-documentreference" ] + }, + "identifier": [ { + "system": "urn:ietf:rfc:3986", + "value": "urn:uuid:0d2280c7-d166-3b57-f112-6a4b8e33714d" + } ], + "status": "current", + "type": { + "coding": [ { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History and physical note" + }, { + "system": "http://loinc.org", + "code": "51847-2", + "display": "Evaluation+Plan note" + } ] + }, + "category": [ { + "coding": [ { + "system": "http://hl7.org/fhir/us/core/CodeSystem/us-core-documentreference-category", + "code": "clinical-note", + "display": "Clinical Note" + } ] + } ], + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "date": "2020-03-14T12:44:52.558-04:00", + "author": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + } ], + "custodian": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "content": [ { + "attachment": { + "contentType": "text/plain; charset=utf-8", + "data": "CjIwMjAtMDMtMTQKCiMgQ2hpZWYgQ29tcGxhaW50Ck5vIGNvbXBsYWludHMuCgojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzCkxpbmRzYXk5MjgKIGlzIGEgNjkgeWVhci1vbGQgbm9uLWhpc3BhbmljIHdoaXRlIG1hbGUuIFBhdGllbnQgaGFzIGEgaGlzdG9yeSBvZiBhY3V0ZSB2aXJhbCBwaGFyeW5naXRpcyAoZGlzb3JkZXIpLCB2aXJhbCBzaW51c2l0aXMgKGRpc29yZGVyKS4KCiMgU29jaWFsIEhpc3RvcnkKUGF0aWVudCBpcyBtYXJyaWVkLiBQYXRpZW50IGlzIGFuIGFjdGl2ZSBzbW9rZXIgYW5kIGlzIGFuIGFsY29ob2xpYy4KIFBhdGllbnQgaWRlbnRpZmllcyBhcyBoZXRlcm9zZXh1YWwuCgpQYXRpZW50IGNvbWVzIGZyb20gYSBtaWRkbGUgc29jaW9lY29ub21pYyBiYWNrZ3JvdW5kLgogUGF0aWVudCBoYXMgY29tcGxldGVkIHNvbWUgY29sbGVnZSBjb3Vyc2VzLgpQYXRpZW50IGN1cnJlbnRseSBoYXMgTWVkaWNhcmUuCgojIEFsbGVyZ2llcwpObyBLbm93biBBbGxlcmdpZXMuCgojIE1lZGljYXRpb25zCk5vIEFjdGl2ZSBNZWRpY2F0aW9ucy4KCiMgQXNzZXNzbWVudCBhbmQgUGxhbgpQYXRpZW50IGlzIHByZXNlbnRpbmcgd2l0aCBoZWFkYWNoZSAoZmluZGluZyksIGNvdWdoIChmaW5kaW5nKSwgc3B1dHVtIGZpbmRpbmcgKGZpbmRpbmcpLCBkeXNwbmVhIChmaW5kaW5nKSwgd2hlZXppbmcgKGZpbmRpbmcpLCBjaGlsbCAoZmluZGluZyksIHN1c3BlY3RlZCBjb3ZpZC0xOSwgY292aWQtMTkuIAoKIyMgUGxhbgoKVGhlIGZvbGxvd2luZyBwcm9jZWR1cmVzIHdlcmUgY29uZHVjdGVkOgotIGZhY2UgbWFzayAocGh5c2ljYWwgb2JqZWN0KQpUaGUgcGF0aWVudCB3YXMgcGxhY2VkIG9uIGEgY2FyZXBsYW46Ci0gaW5mZWN0aW91cyBkaXNlYXNlIGNhcmUgcGxhbiAocmVjb3JkIGFydGlmYWN0KQotIGluZmVjdGlvdXMgZGlzZWFzZSBjYXJlIHBsYW4gKHJlY29yZCBhcnRpZmFjdCkK" + }, + "format": { + "system": "http://ihe.net/fhir/ValueSet/IHE.FormatCode.codesystem", + "code": "urn:ihe:iti:xds:2017:mimeTypeSufficient", + "display": "mimeType Sufficient" + } + } ], + "context": { + "encounter": [ { + "reference": "urn:uuid:548de770-6d57-a36a-8b75-a257423c2ee9" + } ], + "period": { + "start": "2020-03-14T12:44:52-04:00", + "end": "2020-03-14T14:02:53-04:00" + } + } + }, + "request": { + "method": "POST", + "url": "DocumentReference" + } + }, { + "fullUrl": "urn:uuid:9705dc6d-0e76-d914-ef8d-27a693267227", + "resource": { + "resourceType": "Claim", + "id": "9705dc6d-0e76-d914-ef8d-27a693267227", + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552", + "display": "Lindsay928 Gerlach374" + }, + "billablePeriod": { + "start": "2020-03-14T12:44:52-04:00", + "end": "2020-03-14T14:02:53-04:00" + }, + "created": "2020-03-14T14:02:53-04:00", + "provider": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|12c9daf5-a29c-36c9-ac55-28972463e566", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "priority": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/processpriority", + "code": "normal" + } ] + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "diagnosis": [ { + "sequence": 1, + "diagnosisReference": { + "reference": "urn:uuid:ee1d15a4-8c54-552d-bb74-4c1512a19bd3" + } + }, { + "sequence": 2, + "diagnosisReference": { + "reference": "urn:uuid:2f1493c2-292b-e73b-5ef5-3fce36251551" + } + }, { + "sequence": 3, + "diagnosisReference": { + "reference": "urn:uuid:d56b691f-18eb-45a9-62c3-74047d85b526" + } + }, { + "sequence": 4, + "diagnosisReference": { + "reference": "urn:uuid:987d49c5-fc8b-2382-502b-a06cbd14e36a" + } + }, { + "sequence": 5, + "diagnosisReference": { + "reference": "urn:uuid:eea22844-d6ed-8a10-0359-55e4c2cec166" + } + }, { + "sequence": 6, + "diagnosisReference": { + "reference": "urn:uuid:07cc90c4-568e-9859-dd59-21a418d3dec2" + } + }, { + "sequence": 7, + "diagnosisReference": { + "reference": "urn:uuid:294a2158-9803-36ec-1a3d-2fb2f7e69ce1" + } + }, { + "sequence": 8, + "diagnosisReference": { + "reference": "urn:uuid:eca2b39a-16c8-c3dd-f9c5-209b7ad0e48c" + } + } ], + "procedure": [ { + "sequence": 1, + "procedureReference": { + "reference": "urn:uuid:f10c118e-c6ea-da79-aae6-4e650f3b4941" + } + } ], + "insurance": [ { + "sequence": 1, + "focal": true, + "coverage": { + "display": "Medicare" + } + } ], + "item": [ { + "sequence": 1, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "185345009", + "display": "Encounter for symptom (procedure)" + } ], + "text": "Encounter for symptom (procedure)" + }, + "encounter": [ { + "reference": "urn:uuid:548de770-6d57-a36a-8b75-a257423c2ee9" + } ] + }, { + "sequence": 2, + "diagnosisSequence": [ 1 ], + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "25064002", + "display": "Headache (finding)" + } ], + "text": "Headache (finding)" + } + }, { + "sequence": 3, + "diagnosisSequence": [ 2 ], + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "49727002", + "display": "Cough (finding)" + } ], + "text": "Cough (finding)" + } + }, { + "sequence": 4, + "diagnosisSequence": [ 3 ], + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "248595008", + "display": "Sputum finding (finding)" + } ], + "text": "Sputum finding (finding)" + } + }, { + "sequence": 5, + "diagnosisSequence": [ 4 ], + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "267036007", + "display": "Dyspnea (finding)" + } ], + "text": "Dyspnea (finding)" + } + }, { + "sequence": 6, + "diagnosisSequence": [ 5 ], + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "56018004", + "display": "Wheezing (finding)" + } ], + "text": "Wheezing (finding)" + } + }, { + "sequence": 7, + "diagnosisSequence": [ 6 ], + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "43724002", + "display": "Chill (finding)" + } ], + "text": "Chill (finding)" + } + }, { + "sequence": 8, + "diagnosisSequence": [ 7 ], + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "840544004", + "display": "Suspected COVID-19" + } ], + "text": "Suspected COVID-19" + } + }, { + "sequence": 9, + "procedureSequence": [ 1 ], + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "261352009", + "display": "Face mask (physical object)" + } ], + "text": "Face mask (physical object)" + }, + "net": { + "value": 1.57, + "currency": "USD" + } + }, { + "sequence": 10, + "diagnosisSequence": [ 8 ], + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "840539006", + "display": "COVID-19" + } ], + "text": "COVID-19" + } + } ], + "total": { + "value": 77.49, + "currency": "USD" + } + }, + "request": { + "method": "POST", + "url": "Claim" + } + }, { + "fullUrl": "urn:uuid:372fe84d-6dfb-e9af-2754-d49db8fde62b", + "resource": { + "resourceType": "ExplanationOfBenefit", + "id": "372fe84d-6dfb-e9af-2754-d49db8fde62b", + "contained": [ { + "resourceType": "ServiceRequest", + "id": "referral", + "status": "completed", + "intent": "order", + "subject": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "requester": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "performer": [ { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + } ] + }, { + "resourceType": "Coverage", + "id": "coverage", + "status": "active", + "type": { + "text": "Medicare" + }, + "beneficiary": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "payor": [ { + "display": "Medicare" + } ] + } ], + "identifier": [ { + "system": "https://bluebutton.cms.gov/resources/variables/clm_id", + "value": "9705dc6d-0e76-d914-ef8d-27a693267227" + }, { + "system": "https://bluebutton.cms.gov/resources/identifier/claim-group", + "value": "99999999999" + } ], + "status": "active", + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claim-type", + "code": "institutional" + } ] + }, + "use": "claim", + "patient": { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, + "billablePeriod": { + "start": "2020-03-14T14:02:53-04:00", + "end": "2021-03-14T14:02:53-04:00" + }, + "created": "2020-03-14T14:02:53-04:00", + "insurer": { + "display": "Medicare" + }, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "referral": { + "reference": "#referral" + }, + "facility": { + "reference": "Location?identifier=https://github.com/synthetichealth/synthea|5ad4118a-3589-3537-9c3a-3e70ad4306d8", + "display": "BETH ISRAEL DEACONESS HOSPITAL-MILTON INC" + }, + "claim": { + "reference": "urn:uuid:9705dc6d-0e76-d914-ef8d-27a693267227" + }, + "outcome": "complete", + "careTeam": [ { + "sequence": 1, + "provider": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559" + }, + "role": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/claimcareteamrole", + "code": "primary", + "display": "Primary Care Practitioner" + } ] + } + } ], + "diagnosis": [ { + "sequence": 1, + "diagnosisReference": { + "reference": "urn:uuid:ee1d15a4-8c54-552d-bb74-4c1512a19bd3" + }, + "type": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-diagnosistype", + "code": "principal" + } ] + } ] + }, { + "sequence": 2, + "diagnosisReference": { + "reference": "urn:uuid:2f1493c2-292b-e73b-5ef5-3fce36251551" + }, + "type": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-diagnosistype", + "code": "principal" + } ] + } ] + }, { + "sequence": 3, + "diagnosisReference": { + "reference": "urn:uuid:d56b691f-18eb-45a9-62c3-74047d85b526" + }, + "type": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-diagnosistype", + "code": "principal" + } ] + } ] + }, { + "sequence": 4, + "diagnosisReference": { + "reference": "urn:uuid:987d49c5-fc8b-2382-502b-a06cbd14e36a" + }, + "type": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-diagnosistype", + "code": "principal" + } ] + } ] + }, { + "sequence": 5, + "diagnosisReference": { + "reference": "urn:uuid:eea22844-d6ed-8a10-0359-55e4c2cec166" + }, + "type": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-diagnosistype", + "code": "principal" + } ] + } ] + }, { + "sequence": 6, + "diagnosisReference": { + "reference": "urn:uuid:07cc90c4-568e-9859-dd59-21a418d3dec2" + }, + "type": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-diagnosistype", + "code": "principal" + } ] + } ] + }, { + "sequence": 7, + "diagnosisReference": { + "reference": "urn:uuid:294a2158-9803-36ec-1a3d-2fb2f7e69ce1" + }, + "type": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-diagnosistype", + "code": "principal" + } ] + } ] + }, { + "sequence": 8, + "diagnosisReference": { + "reference": "urn:uuid:eca2b39a-16c8-c3dd-f9c5-209b7ad0e48c" + }, + "type": [ { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-diagnosistype", + "code": "principal" + } ] + } ] + } ], + "insurance": [ { + "focal": true, + "coverage": { + "reference": "#coverage", + "display": "Medicare" + } + } ], + "item": [ { + "sequence": 1, + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } ] + }, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "185345009", + "display": "Encounter for symptom (procedure)" + } ], + "text": "Encounter for symptom (procedure)" + }, + "servicedPeriod": { + "start": "2020-03-14T12:44:52-04:00", + "end": "2020-03-14T14:02:53-04:00" + }, + "locationCodeableConcept": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "21", + "display": "Inpatient Hospital" + } ] + }, + "encounter": [ { + "reference": "urn:uuid:548de770-6d57-a36a-8b75-a257423c2ee9" + } ] + }, { + "sequence": 2, + "diagnosisSequence": [ 1 ], + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } ] + }, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "25064002", + "display": "Headache (finding)" + } ], + "text": "Headache (finding)" + }, + "servicedPeriod": { + "start": "2020-03-14T12:44:52-04:00", + "end": "2020-03-14T14:02:53-04:00" + }, + "locationCodeableConcept": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "21", + "display": "Inpatient Hospital" + } ] + } + }, { + "sequence": 3, + "diagnosisSequence": [ 2 ], + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } ] + }, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "49727002", + "display": "Cough (finding)" + } ], + "text": "Cough (finding)" + }, + "servicedPeriod": { + "start": "2020-03-14T12:44:52-04:00", + "end": "2020-03-14T14:02:53-04:00" + }, + "locationCodeableConcept": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "21", + "display": "Inpatient Hospital" + } ] + } + }, { + "sequence": 4, + "diagnosisSequence": [ 3 ], + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } ] + }, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "248595008", + "display": "Sputum finding (finding)" + } ], + "text": "Sputum finding (finding)" + }, + "servicedPeriod": { + "start": "2020-03-14T12:44:52-04:00", + "end": "2020-03-14T14:02:53-04:00" + }, + "locationCodeableConcept": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "21", + "display": "Inpatient Hospital" + } ] + } + }, { + "sequence": 5, + "diagnosisSequence": [ 4 ], + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } ] + }, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "267036007", + "display": "Dyspnea (finding)" + } ], + "text": "Dyspnea (finding)" + }, + "servicedPeriod": { + "start": "2020-03-14T12:44:52-04:00", + "end": "2020-03-14T14:02:53-04:00" + }, + "locationCodeableConcept": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "21", + "display": "Inpatient Hospital" + } ] + } + }, { + "sequence": 6, + "diagnosisSequence": [ 5 ], + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } ] + }, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "56018004", + "display": "Wheezing (finding)" + } ], + "text": "Wheezing (finding)" + }, + "servicedPeriod": { + "start": "2020-03-14T12:44:52-04:00", + "end": "2020-03-14T14:02:53-04:00" + }, + "locationCodeableConcept": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "21", + "display": "Inpatient Hospital" + } ] + } + }, { + "sequence": 7, + "diagnosisSequence": [ 6 ], + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } ] + }, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "43724002", + "display": "Chill (finding)" + } ], + "text": "Chill (finding)" + }, + "servicedPeriod": { + "start": "2020-03-14T12:44:52-04:00", + "end": "2020-03-14T14:02:53-04:00" + }, + "locationCodeableConcept": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "21", + "display": "Inpatient Hospital" + } ] + } + }, { + "sequence": 8, + "diagnosisSequence": [ 7 ], + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } ] + }, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "840544004", + "display": "Suspected COVID-19" + } ], + "text": "Suspected COVID-19" + }, + "servicedPeriod": { + "start": "2020-03-14T12:44:52-04:00", + "end": "2020-03-14T14:02:53-04:00" + }, + "locationCodeableConcept": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "21", + "display": "Inpatient Hospital" + } ] + } + }, { + "sequence": 9, + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } ] + }, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "261352009", + "display": "Face mask (physical object)" + } ], + "text": "Face mask (physical object)" + }, + "servicedPeriod": { + "start": "2020-03-14T12:44:52-04:00", + "end": "2020-03-14T14:02:53-04:00" + }, + "locationCodeableConcept": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "21", + "display": "Inpatient Hospital" + } ] + }, + "net": { + "value": 1.57, + "currency": "USD" + }, + "adjudication": [ { + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_coinsrnc_amt", + "display": "Line Beneficiary Coinsurance Amount" + } ] + }, + "amount": { + "value": 0.31400000000000006, + "currency": "USD" + } + }, { + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_prvdr_pmt_amt", + "display": "Line Provider Payment Amount" + } ] + }, + "amount": { + "value": 1.2560000000000002, + "currency": "USD" + } + }, { + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_sbmtd_chrg_amt", + "display": "Line Submitted Charge Amount" + } ] + }, + "amount": { + "value": 1.57, + "currency": "USD" + } + }, { + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_alowd_chrg_amt", + "display": "Line Allowed Charge Amount" + } ] + }, + "amount": { + "value": 1.57, + "currency": "USD" + } + }, { + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_bene_ptb_ddctbl_amt", + "display": "Line Beneficiary Part B Deductible Amount" + } ] + }, + "amount": { + "value": 0, + "currency": "USD" + } + }, { + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/codesystem/adjudication", + "code": "https://bluebutton.cms.gov/resources/variables/line_prcsg_ind_cd", + "display": "Line Processing Indicator Code" + } ] + } + } ] + }, { + "sequence": 10, + "diagnosisSequence": [ 8 ], + "category": { + "coding": [ { + "system": "https://bluebutton.cms.gov/resources/variables/line_cms_type_srvc_cd", + "code": "1", + "display": "Medical care" + } ] + }, + "productOrService": { + "coding": [ { + "system": "http://snomed.info/sct", + "code": "840539006", + "display": "COVID-19" + } ], + "text": "COVID-19" + }, + "servicedPeriod": { + "start": "2020-03-14T12:44:52-04:00", + "end": "2020-03-14T14:02:53-04:00" + }, + "locationCodeableConcept": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/ex-serviceplace", + "code": "21", + "display": "Inpatient Hospital" + } ] + } + } ], + "total": [ { + "category": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/adjudication", + "code": "submitted", + "display": "Submitted Amount" + } ], + "text": "Submitted Amount" + }, + "amount": { + "value": 77.49, + "currency": "USD" + } + } ], + "payment": { + "amount": { + "value": 1.2560000000000002, + "currency": "USD" + } + } + }, + "request": { + "method": "POST", + "url": "ExplanationOfBenefit" + } + }, { + "fullUrl": "urn:uuid:22dadbbd-2385-9aba-5ee8-93b20ccfa074", + "resource": { + "resourceType": "Provenance", + "id": "22dadbbd-2385-9aba-5ee8-93b20ccfa074", + "meta": { + "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-provenance" ] + }, + "target": [ { + "reference": "urn:uuid:d5582579-7193-4866-5560-a01e723b6552" + }, { + "reference": "urn:uuid:3699e7e7-8b1b-4a68-8011-e7a166598566" + }, { + "reference": "urn:uuid:9a01d04d-86de-75e6-5c07-a4ba74966e68" + }, { + "reference": "urn:uuid:585cb148-8912-c5f6-d96e-e3d5105e6c03" + }, { + "reference": "urn:uuid:50a0789d-acf1-9448-58f3-5edce8b59e73" + }, { + "reference": "urn:uuid:d96f0eb1-e968-03d9-fd4c-d38d5192c590" + }, { + "reference": "urn:uuid:e7f6193d-3d3a-9f9a-ee20-e746902dba0b" + }, { + "reference": "urn:uuid:d0fbb53e-5571-bf4f-50fe-f4257ee5b6f7" + }, { + "reference": "urn:uuid:35a85c2e-272c-d6ba-cea3-134ce384378b" + }, { + "reference": "urn:uuid:39ed6877-e739-12f8-1fae-f88933a96d26" + }, { + "reference": "urn:uuid:dc6aed26-e8a9-ea2a-87dc-7317047b9192" + }, { + "reference": "urn:uuid:d6aed4e0-ee78-8156-7296-a7bc4482998c" + }, { + "reference": "urn:uuid:abd27c13-3d19-0c90-fd24-581ea52e0b84" + }, { + "reference": "urn:uuid:ca1b3a6d-7643-8d54-225e-cb534d1afea0" + }, { + "reference": "urn:uuid:e5958f8f-e51f-9336-4796-2bb5590c8606" + }, { + "reference": "urn:uuid:ece9e706-21d8-e2bc-02fd-6df6a7e90c5a" + }, { + "reference": "urn:uuid:5a252771-c39d-268a-5705-157c82336385" + }, { + "reference": "urn:uuid:1cad69e7-779e-8cb8-e1c7-2f3dbecd829f" + }, { + "reference": "urn:uuid:964df1ee-29c7-7cb0-9448-21c3359bc872" + }, { + "reference": "urn:uuid:ddd94773-0a10-603b-729c-c0b00eb1c7ab" + }, { + "reference": "urn:uuid:228198d5-764d-24fa-0499-3ffd67bdc94b" + }, { + "reference": "urn:uuid:13136b82-44a9-4a67-f73e-3634e4235a87" + }, { + "reference": "urn:uuid:d9a173d0-1f2b-3f19-0c22-6a6d210135a8" + }, { + "reference": "urn:uuid:3b75960c-fab9-ce46-14d7-0d719e325532" + }, { + "reference": "urn:uuid:a2e864d4-30cc-618a-d6b9-d240a3aa9548" + }, { + "reference": "urn:uuid:8101b0a2-0637-1ae6-42eb-99bb15b1874e" + }, { + "reference": "urn:uuid:d7d9fca7-b110-0b0a-e659-a598fd845bd0" + }, { + "reference": "urn:uuid:35ddece1-bbbb-07d6-f232-869ce11206a1" + }, { + "reference": "urn:uuid:a2920167-37fd-e71e-4cff-3a095a130147" + }, { + "reference": "urn:uuid:38863302-dad7-21ad-032c-2a53d4f04f96" + }, { + "reference": "urn:uuid:7b0e4502-5ced-228c-6255-071b0103aa9a" + }, { + "reference": "urn:uuid:7861a855-6ff4-f5ba-aa6c-cbbbec91cfe0" + }, { + "reference": "urn:uuid:75b170ca-b797-6219-b4c4-d5a215fc5276" + }, { + "reference": "urn:uuid:e05842ac-38a2-5be8-c434-6208920cdff8" + }, { + "reference": "urn:uuid:d3eed5ef-539d-5c27-0772-4201602d2e7c" + }, { + "reference": "urn:uuid:741cc63e-7607-1238-6a0d-b73a204ae2cf" + }, { + "reference": "urn:uuid:3c4434bb-9d92-013a-4df9-3d149fce706a" + }, { + "reference": "urn:uuid:e01ef8b2-0ac5-b1a7-1d36-78b8474d181b" + }, { + "reference": "urn:uuid:bcf8d4a2-08e7-42da-f848-c644901bbf29" + }, { + "reference": "urn:uuid:63af689b-e11b-10d0-3f26-e54d071594ba" + }, { + "reference": "urn:uuid:700e75cf-15d4-7232-e836-78871c5d2979" + }, { + "reference": "urn:uuid:7c744762-5174-d292-3a53-4cbbe324dd73" + }, { + "reference": "urn:uuid:788f9b05-0df5-c841-15e3-6fc1f93d2a91" + }, { + "reference": "urn:uuid:2f79ba37-a1ba-7f6c-24a6-1796f46d69d7" + }, { + "reference": "urn:uuid:9f86f39f-6e45-5f0c-e286-bc48e0aab1b3" + }, { + "reference": "urn:uuid:ae0a6eea-9c60-38b2-6c19-0ef19d311511" + }, { + "reference": "urn:uuid:811a6967-f9ed-8c87-5004-addba6064aa3" + }, { + "reference": "urn:uuid:92352c70-ea81-b0b5-a1ce-c211d3d4bce1" + }, { + "reference": "urn:uuid:6a9a7725-785c-8b05-ec27-623301191651" + }, { + "reference": "urn:uuid:2a654f5a-4512-c0c8-8829-ce88a0e5ce08" + }, { + "reference": "urn:uuid:de5bda58-d5b4-786f-7536-b9aaa0864ca5" + }, { + "reference": "urn:uuid:a62a167b-9ff4-e04a-24e8-871c17be6184" + }, { + "reference": "urn:uuid:a02d8d5e-2097-aae8-5e11-3f250b4692f1" + }, { + "reference": "urn:uuid:ed98c7e6-eba3-5cdd-2e32-61e53daa679f" + }, { + "reference": "urn:uuid:eebab6dd-37a8-9d8f-cba8-7f527513794b" + }, { + "reference": "urn:uuid:2915b2c8-a6cf-e0ea-e232-be8624ae126b" + }, { + "reference": "urn:uuid:1f01bde4-0b29-1727-7ad7-ca8c92a129b0" + }, { + "reference": "urn:uuid:b06a366d-79f3-081c-7bc0-a03ae9242403" + }, { + "reference": "urn:uuid:29ce0052-49fd-ed5c-8f4c-e4b1872661d9" + }, { + "reference": "urn:uuid:b4384cc9-11a8-6db9-7c9f-6bb749e7f144" + }, { + "reference": "urn:uuid:bea32922-d48a-9643-58e4-4be99e4a5333" + }, { + "reference": "urn:uuid:51a99f1e-54c9-160e-0023-693a55c9a6d2" + }, { + "reference": "urn:uuid:52cb0676-be79-f238-f48c-b29b3352a731" + }, { + "reference": "urn:uuid:c8995bc3-34d1-f629-c45e-06f582c85f23" + }, { + "reference": "urn:uuid:0c75b07e-f682-641c-e40d-f560add6b768" + }, { + "reference": "urn:uuid:951b0865-3f22-a9df-3d65-cc906add430e" + }, { + "reference": "urn:uuid:08693800-a6fa-1dd6-efe8-ad89998fee13" + }, { + "reference": "urn:uuid:bfe69881-b53a-0845-3a8c-959ecaa1724f" + }, { + "reference": "urn:uuid:2b88a4d5-52f8-7ccd-cda5-939796a5b690" + }, { + "reference": "urn:uuid:1ec0d3ef-4340-c837-d532-9c307a987c06" + }, { + "reference": "urn:uuid:45cc446a-2e96-7670-9abe-b1c2c056fde1" + }, { + "reference": "urn:uuid:ca1a0d52-ea94-34d4-5200-5344bd216738" + }, { + "reference": "urn:uuid:a5854840-b120-14ae-578c-66744223432c" + }, { + "reference": "urn:uuid:ba5d28a9-fa42-f1ff-2c91-1150b9504b4d" + }, { + "reference": "urn:uuid:7b06b470-a849-027e-d0e0-36cbf5d5383c" + }, { + "reference": "urn:uuid:94a8f1c2-7bad-d0e0-bcd8-8abd01327890" + }, { + "reference": "urn:uuid:d237711b-0f10-f1fd-2bed-c2c14dbeb461" + }, { + "reference": "urn:uuid:c4cd1c66-903f-30b3-1782-ba12686e58bb" + }, { + "reference": "urn:uuid:0daf9f69-0b47-a903-20a9-7a9d456785b2" + }, { + "reference": "urn:uuid:bc20e61d-c4f6-ef48-ab6f-3b12bc040ca5" + }, { + "reference": "urn:uuid:e226c9f0-5733-0a04-56bb-c3a20e5b38c6" + }, { + "reference": "urn:uuid:df13b527-76f3-4249-c03f-008a3f8a301e" + }, { + "reference": "urn:uuid:0b31899f-5d3a-1659-ae0c-a9f03332e0d4" + }, { + "reference": "urn:uuid:dca7bebb-70e9-3290-f9aa-14f242a5fead" + }, { + "reference": "urn:uuid:87ff81fa-a870-d4d6-7fc3-2a8644603c60" + }, { + "reference": "urn:uuid:cedf7c57-6f4f-efe1-8812-1eb3a9aa109f" + }, { + "reference": "urn:uuid:28ec1f09-7213-e40d-d608-6d29a31fd7da" + }, { + "reference": "urn:uuid:dccb52db-ef15-b3ca-7501-fffb0ffd6cf7" + }, { + "reference": "urn:uuid:f21859b7-7fac-9a7b-266f-72ba28959189" + }, { + "reference": "urn:uuid:f6923b35-32ef-3f7d-d99e-632bf50e0275" + }, { + "reference": "urn:uuid:c5ebe674-a726-9567-80e9-993ec3b5b2d7" + }, { + "reference": "urn:uuid:679c1d2e-56f8-e993-62af-3a3b1fc95126" + }, { + "reference": "urn:uuid:a5587c04-bab7-e7dd-cf9a-7b36c0187a95" + }, { + "reference": "urn:uuid:2bc83422-33a4-96aa-2eb1-86ccff4040bc" + }, { + "reference": "urn:uuid:bab04a00-12a8-8f2b-196f-8a10c355e577" + }, { + "reference": "urn:uuid:1ba46d84-0e33-f5e3-8a3e-1cbd8326f10e" + }, { + "reference": "urn:uuid:9364bf50-87e3-f766-1520-78b1f1e20695" + }, { + "reference": "urn:uuid:2bc21759-828d-cd62-a896-349c094e1a96" + }, { + "reference": "urn:uuid:3f67a0b6-c886-8fe3-42e2-75f2d4ebefec" + }, { + "reference": "urn:uuid:e781debb-b0c0-56d2-693f-ce28cfb7fef1" + }, { + "reference": "urn:uuid:6a286f48-23d9-6fbe-8258-371f89012adb" + }, { + "reference": "urn:uuid:40f11e59-f0c2-abde-aedb-e2dbed2ae963" + }, { + "reference": "urn:uuid:46681ee9-676e-0a56-8188-d27a3377c0a7" + }, { + "reference": "urn:uuid:a8927cf4-4f47-42b9-66a0-68616c633f50" + }, { + "reference": "urn:uuid:535d1cd6-2b4b-f3cf-70e7-69b5bae0d2f7" + }, { + "reference": "urn:uuid:212bdbde-deb1-7a97-2320-2314c84720c4" + }, { + "reference": "urn:uuid:96e1a620-f762-b58e-1fb5-a47d4505c458" + }, { + "reference": "urn:uuid:acf39587-7780-3831-184a-488ab1bd98ec" + }, { + "reference": "urn:uuid:e5a66e2a-00b1-b2c1-034a-faea0b31f0ba" + }, { + "reference": "urn:uuid:02b70be6-dbbf-9246-59cb-f208ba0b5e9b" + }, { + "reference": "urn:uuid:37a3952b-d8d8-1cd5-b30a-d00eabcaf5f1" + }, { + "reference": "urn:uuid:f2d48712-5153-8e14-783d-5f0b36d724c6" + }, { + "reference": "urn:uuid:d441eeb1-4efe-f7fe-1213-5c703e798c35" + }, { + "reference": "urn:uuid:452263ad-af2d-ebe3-fcc5-07bf77377b08" + }, { + "reference": "urn:uuid:56f69817-ed4f-2fb2-b6ef-68851664eea2" + }, { + "reference": "urn:uuid:221d9173-89c1-037a-ce1a-7f882b6c3e1f" + }, { + "reference": "urn:uuid:2a4adf15-f265-bb2e-20d4-d73d4c42d3b9" + }, { + "reference": "urn:uuid:4af961b1-a341-b0a8-3d13-277bb325986d" + }, { + "reference": "urn:uuid:1c8a7831-6277-d1f0-f13a-0075e03df5dd" + }, { + "reference": "urn:uuid:7d6aa5c8-048a-4fbd-5222-b0e5e07a9278" + }, { + "reference": "urn:uuid:1e920546-d019-303b-afcb-db8581f52bd7" + }, { + "reference": "urn:uuid:61481dae-2bb0-ca0e-f879-6fc39ff1336a" + }, { + "reference": "urn:uuid:1277ec05-c8d6-6b96-960e-f9b4d3151153" + }, { + "reference": "urn:uuid:475a366c-8da1-b274-ceaa-7d48e03a3191" + }, { + "reference": "urn:uuid:cd097c71-6615-574d-7f35-50c0474e3f61" + }, { + "reference": "urn:uuid:d1f418a1-4052-71cd-b803-aa5c068232e0" + }, { + "reference": "urn:uuid:12566761-5eed-78ee-5ff2-d5579aaa14f4" + }, { + "reference": "urn:uuid:593006fe-035c-837a-c501-4218367a9d6d" + }, { + "reference": "urn:uuid:62c48502-1bea-8cce-995a-e5a135800f66" + }, { + "reference": "urn:uuid:7de90cc8-0513-c1e0-ac87-9c49b77bf7f1" + }, { + "reference": "urn:uuid:e365eb51-b9eb-1a82-1110-83b3bb8db2f2" + }, { + "reference": "urn:uuid:e7cbfc58-b269-c2e7-dacc-7ff5ca63da4b" + }, { + "reference": "urn:uuid:898b54a4-9d8d-1966-3853-601d71f30339" + }, { + "reference": "urn:uuid:9c19bd9e-9830-447e-0e1a-55d356106dfd" + }, { + "reference": "urn:uuid:f6ccd623-34da-a519-12b3-b45d1e158bbe" + }, { + "reference": "urn:uuid:b3f4ec9a-dc8c-a915-94d7-2ac9ea9b7ead" + }, { + "reference": "urn:uuid:2002e647-c928-c1ff-dc76-ed697dabf86a" + }, { + "reference": "urn:uuid:7a54c7e3-1fae-8421-8379-827abdb71aa6" + }, { + "reference": "urn:uuid:eee9b363-cf5a-31be-27f7-26297e743e08" + }, { + "reference": "urn:uuid:22f76f1f-a31b-369b-a454-f9b76ccdc354" + }, { + "reference": "urn:uuid:8b68ca18-f8f8-57c1-2887-71f9ea5652ca" + }, { + "reference": "urn:uuid:5ced7191-6f20-9b81-7668-b90683c82dcb" + }, { + "reference": "urn:uuid:deb90be0-64d4-2db8-68a6-f72c52f576c2" + }, { + "reference": "urn:uuid:fc98ac86-ce40-c454-4b99-b724019a9341" + }, { + "reference": "urn:uuid:2fe2f583-b221-4816-588c-d984a5f20c6a" + }, { + "reference": "urn:uuid:da3879e6-dea8-c599-7a02-cb7d55fb9190" + }, { + "reference": "urn:uuid:6e4f35a4-653c-ea92-f956-f4bcf95e011d" + }, { + "reference": "urn:uuid:cb5d2eab-2a04-9358-9f44-90b39de69bb5" + }, { + "reference": "urn:uuid:dc639336-0193-2ca7-6865-66ffce25c59b" + }, { + "reference": "urn:uuid:4edce961-2c41-eda0-27ff-172136cbfa54" + }, { + "reference": "urn:uuid:516623ff-7854-2e13-35ac-eb6f3c6fd689" + }, { + "reference": "urn:uuid:1c23b0aa-7214-5d01-a8df-674d1a905c31" + }, { + "reference": "urn:uuid:3720d31b-0feb-5b5c-3f0a-049f3c34d4ef" + }, { + "reference": "urn:uuid:47f8e1bb-804c-3f10-19ea-d478d8bdf6b8" + }, { + "reference": "urn:uuid:bcff377a-b46a-c246-41de-f71782922eb8" + }, { + "reference": "urn:uuid:1a13eee1-0552-e2e6-aff2-1f156b893676" + }, { + "reference": "urn:uuid:77a0ba61-b55c-765e-7386-93d73a995735" + }, { + "reference": "urn:uuid:001a6df5-ee5d-b5a2-e356-6748998aff9d" + }, { + "reference": "urn:uuid:c9190de8-51ac-0573-3865-d2cc369d8f9a" + }, { + "reference": "urn:uuid:43e176ec-da2a-7ee2-2e89-ef6f0f527e84" + }, { + "reference": "urn:uuid:fb58f377-1699-fc17-80a6-3d5d15423f80" + }, { + "reference": "urn:uuid:4c0c524b-0b56-ad4e-31f6-ae95de308825" + }, { + "reference": "urn:uuid:eb795251-02eb-7a22-68e3-28e13bcbdd62" + }, { + "reference": "urn:uuid:376277aa-6ca3-b30e-3634-b30097de8a9e" + }, { + "reference": "urn:uuid:81e29e06-93c7-d72f-7c53-c12675756720" + }, { + "reference": "urn:uuid:9476dc38-71ba-724e-78ba-54a5d0e30db0" + }, { + "reference": "urn:uuid:f88a8d03-5cf6-571e-5d3b-e2ec7dcc6a7e" + }, { + "reference": "urn:uuid:d07a9136-9f3f-b9c1-4a70-37b06dd5c343" + }, { + "reference": "urn:uuid:1dc21efe-926d-ee90-a7ad-c667ba559da6" + }, { + "reference": "urn:uuid:b954b27b-4d4b-d11b-cad3-1efdc1e527e0" + }, { + "reference": "urn:uuid:574df38b-f569-176e-99e6-79c1edfc07a2" + }, { + "reference": "urn:uuid:1859a4ee-c797-1596-f58d-8ea12f3fb335" + }, { + "reference": "urn:uuid:26c2f08c-eb6f-b563-6ccf-2b96bf0cb8e3" + }, { + "reference": "urn:uuid:fc3ba510-46ed-a66e-cbb3-3e61ac429895" + }, { + "reference": "urn:uuid:556138b9-2209-0a5d-4e6d-45777ec113bd" + }, { + "reference": "urn:uuid:c20ea570-5fbc-2165-9d08-5c394a901775" + }, { + "reference": "urn:uuid:bae7721c-0607-bb10-9f4b-5667bf99a4e8" + }, { + "reference": "urn:uuid:4e797d34-69c7-6f40-d8fe-9ed69f6f5bf1" + }, { + "reference": "urn:uuid:c8185c95-81a1-e373-6b24-cd60ee0b8c01" + }, { + "reference": "urn:uuid:316e6697-1561-a047-5a52-281cb717ef44" + }, { + "reference": "urn:uuid:9aecb859-e8c7-3b40-145e-83d04d427406" + }, { + "reference": "urn:uuid:a004cd64-daad-d8c9-d370-37a30ecab853" + }, { + "reference": "urn:uuid:67ab7c70-b767-4a78-d116-18156ff91bde" + }, { + "reference": "urn:uuid:494e6d81-2fc5-4d96-dd11-ad31ebda8c23" + }, { + "reference": "urn:uuid:6f625d34-c999-addd-e7d2-180483aa6ecf" + }, { + "reference": "urn:uuid:0c41c15f-7acf-5083-2bb3-5b4a48064e5f" + }, { + "reference": "urn:uuid:9178a2d6-01da-6b77-911c-fb668a9d2d06" + }, { + "reference": "urn:uuid:7e13c089-855e-6cea-9bd6-299d75c6a1d3" + }, { + "reference": "urn:uuid:c3564fd7-e5cc-5710-0294-ee79ef8c2413" + }, { + "reference": "urn:uuid:019aee1e-cea4-9427-1831-0791917128f3" + }, { + "reference": "urn:uuid:5e599792-9633-86b8-6f3a-6c6db3ecf76a" + }, { + "reference": "urn:uuid:e995b751-7a50-5a1c-d83e-aec2ce535655" + }, { + "reference": "urn:uuid:4194a4b1-ab19-d741-b807-a9e5d81778e3" + }, { + "reference": "urn:uuid:c0ee21e2-c225-41ad-18d1-357eb126cd32" + }, { + "reference": "urn:uuid:3a0dafb4-e94f-80c3-1f1a-cf7b82cf913a" + }, { + "reference": "urn:uuid:5d54cab0-c0a1-1945-3b95-7149538151e9" + }, { + "reference": "urn:uuid:017b656f-7ab9-bb1a-8efd-043cdbf3b890" + }, { + "reference": "urn:uuid:d1cd3427-2340-6750-2db0-2956de224a7d" + }, { + "reference": "urn:uuid:68b79d88-4f21-7263-eed0-48288451fee8" + }, { + "reference": "urn:uuid:b00564c7-d333-e6bf-10df-1912823fcf12" + }, { + "reference": "urn:uuid:f06260fa-8f74-0b83-8b6e-1eb412e5a4ab" + }, { + "reference": "urn:uuid:4892d5a7-eb99-1387-65c7-c29e5c354a73" + }, { + "reference": "urn:uuid:276f4098-99a8-38a0-d4c1-094805ff4324" + }, { + "reference": "urn:uuid:c36eb0f3-6487-c722-615e-1147d435aa8f" + }, { + "reference": "urn:uuid:a496fb84-cfb8-dda5-8de2-d1c125198505" + }, { + "reference": "urn:uuid:fb4b6063-b286-e50c-aa8c-cc1943e320f8" + }, { + "reference": "urn:uuid:54e775b6-a068-04c2-15c9-a4ef665c6ee1" + }, { + "reference": "urn:uuid:ff9d6bce-3a3a-1747-7889-d84be1ee7363" + }, { + "reference": "urn:uuid:26ebfe78-94bb-e2ea-9d8d-fd18091137af" + }, { + "reference": "urn:uuid:0271a796-e05a-9ad7-ed80-4bce371fdc2a" + }, { + "reference": "urn:uuid:cf27e6ec-d967-ec54-f893-5c72bc88b14d" + }, { + "reference": "urn:uuid:406ab338-2e4d-1c47-947a-4fc2aa6b7acd" + }, { + "reference": "urn:uuid:7fdd6883-af93-f8fb-321d-d7ad593640fb" + }, { + "reference": "urn:uuid:227fc7be-7be6-a423-1cb4-d30203f3546c" + }, { + "reference": "urn:uuid:f35adb88-6cb3-791e-3b1e-7067e80167dc" + }, { + "reference": "urn:uuid:7256d64c-4f32-937c-c7c7-0c942118e44f" + }, { + "reference": "urn:uuid:15483d93-355e-b9c0-d240-3fb7720fdb78" + }, { + "reference": "urn:uuid:fb53f696-ab4b-b067-8347-ce3976003c5f" + }, { + "reference": "urn:uuid:ecaf0816-6b60-3929-3f80-70a4598a2e3d" + }, { + "reference": "urn:uuid:5bb82568-579a-427e-51da-a6e26326b5aa" + }, { + "reference": "urn:uuid:25b656d3-db68-0b63-9bdb-0aaaca1d07f9" + }, { + "reference": "urn:uuid:1a69531e-4109-3f5d-7ace-d537d7ef30e2" + }, { + "reference": "urn:uuid:bf4d5e64-1317-4ebe-24d6-8c3c2638ee62" + }, { + "reference": "urn:uuid:4f3dc228-f704-8726-f2ba-0a143545e6df" + }, { + "reference": "urn:uuid:ee3e32b1-ec55-b04c-8af8-553c34529d8e" + }, { + "reference": "urn:uuid:4ce4b58f-ee52-30fe-92b8-fb04e5bdc918" + }, { + "reference": "urn:uuid:3c62dd7e-4723-0065-416b-e18435a5f07b" + }, { + "reference": "urn:uuid:c4c66f6b-a418-e78e-ff3f-c4ccaac9722e" + }, { + "reference": "urn:uuid:47f6c4db-1f56-d725-9466-d360fe3d5988" + }, { + "reference": "urn:uuid:ce757f6a-f3a5-5582-92a4-1de430f1a662" + }, { + "reference": "urn:uuid:4c3e61b0-a800-48e9-b313-ce129c3feafa" + }, { + "reference": "urn:uuid:158b614d-f1c0-a20d-3acb-58f4172b641a" + }, { + "reference": "urn:uuid:c9ff463b-da57-aad6-e90e-204e1ac7ef79" + }, { + "reference": "urn:uuid:320a6b6b-68a9-fd64-fca6-375b37af8460" + }, { + "reference": "urn:uuid:3b82748b-f274-6752-fab8-3ebb72c41290" + }, { + "reference": "urn:uuid:d89f0d2a-a005-3d3e-bb64-8babaaf5eb62" + }, { + "reference": "urn:uuid:bd1b0502-a838-e289-f6f7-0e77caa51930" + }, { + "reference": "urn:uuid:215a5d8d-7450-895b-f48a-ac2dafb648f3" + }, { + "reference": "urn:uuid:f86b1cd9-8f26-6ee9-d81b-ff93bbda2a2d" + }, { + "reference": "urn:uuid:9cbff9a1-e1b3-17fa-5d52-b55b5d106909" + }, { + "reference": "urn:uuid:6de1349b-ec0b-51a6-fd07-f794735da6bf" + }, { + "reference": "urn:uuid:5041330f-0e36-fa60-b103-9c62c63e143d" + }, { + "reference": "urn:uuid:6d27aea8-7bbc-d737-dad1-0bf128d49303" + }, { + "reference": "urn:uuid:fc7f8e8d-8fbf-f958-8b28-11a60170804e" + }, { + "reference": "urn:uuid:aa80bdb3-1a4f-77d7-4675-0c9796028e78" + }, { + "reference": "urn:uuid:40f0926d-2251-81ae-dbcf-333e55bb509e" + }, { + "reference": "urn:uuid:64489b43-f67f-0c05-5d62-de67ce945c83" + }, { + "reference": "urn:uuid:49bce50d-4375-a0b3-5f41-0f72ae2f26b3" + }, { + "reference": "urn:uuid:79180e37-0139-1104-62e4-a5b71682fceb" + }, { + "reference": "urn:uuid:b5f4bb64-2fd7-10bc-85d0-f7445285c2b8" + }, { + "reference": "urn:uuid:a441413a-957a-fd5c-dfb4-c0ce1b91545d" + }, { + "reference": "urn:uuid:4d73977b-9060-55a3-63b7-a0e4d001b3f9" + }, { + "reference": "urn:uuid:53a0e953-e8f6-a557-f047-926844a664e9" + }, { + "reference": "urn:uuid:ef0d56f0-bc71-e944-941f-1a3aef63996a" + }, { + "reference": "urn:uuid:2efdbc58-b22e-af85-f594-1c36a0061683" + }, { + "reference": "urn:uuid:d8de9176-d701-7801-75ca-8b618f16f221" + }, { + "reference": "urn:uuid:76703776-94fd-1938-cb65-695f57aa8f83" + }, { + "reference": "urn:uuid:0dda4752-34b4-2d3f-cb03-c9283af87dd8" + }, { + "reference": "urn:uuid:d28cb5ac-52b5-cb09-3e7e-c8f979401d25" + }, { + "reference": "urn:uuid:24eedfdd-6946-0fe7-91b8-b78f65582d6c" + }, { + "reference": "urn:uuid:0e49d64c-6f57-3d51-bc1c-d8924d85ac0a" + }, { + "reference": "urn:uuid:3f5c7804-12d0-6ee6-dbf2-7c4e3718a360" + }, { + "reference": "urn:uuid:77dd337f-f97b-2cb1-1b9d-5ea97113d0b6" + }, { + "reference": "urn:uuid:3d1680c8-f9c1-5dad-8c10-8151070e445b" + }, { + "reference": "urn:uuid:530868c2-66f9-5e8a-f257-f5345ecc6010" + }, { + "reference": "urn:uuid:874aadc2-6496-40b1-1b71-4734aaffd7a5" + }, { + "reference": "urn:uuid:dc906963-046e-7586-18f1-841c227497e4" + }, { + "reference": "urn:uuid:f2673398-8eab-69ec-fd73-07ccfeeab7ae" + }, { + "reference": "urn:uuid:dbd92706-4a18-d60d-e8b4-8bbc783bd764" + }, { + "reference": "urn:uuid:4a3a568b-09b2-c55a-c3f6-28a0316c9288" + }, { + "reference": "urn:uuid:a4df8821-84bd-9ad1-3eb8-3f65b430e7a3" + }, { + "reference": "urn:uuid:140548ea-71a3-957d-e5cb-7d679e74ba68" + }, { + "reference": "urn:uuid:ba0bae82-a587-9943-81e0-6fde6ae7d419" + }, { + "reference": "urn:uuid:f39c599b-4335-3fda-eab8-5a94439f0629" + }, { + "reference": "urn:uuid:f2958dc8-b812-761b-c000-45dcfad25322" + }, { + "reference": "urn:uuid:e9ee7298-d537-297a-cbfa-77c723da41c8" + }, { + "reference": "urn:uuid:2775d1e7-7213-c9d4-75a9-cc8ec40cbe7e" + }, { + "reference": "urn:uuid:548de770-6d57-a36a-8b75-a257423c2ee9" + }, { + "reference": "urn:uuid:ee1d15a4-8c54-552d-bb74-4c1512a19bd3" + }, { + "reference": "urn:uuid:2f1493c2-292b-e73b-5ef5-3fce36251551" + }, { + "reference": "urn:uuid:d56b691f-18eb-45a9-62c3-74047d85b526" + }, { + "reference": "urn:uuid:987d49c5-fc8b-2382-502b-a06cbd14e36a" + }, { + "reference": "urn:uuid:eea22844-d6ed-8a10-0359-55e4c2cec166" + }, { + "reference": "urn:uuid:07cc90c4-568e-9859-dd59-21a418d3dec2" + }, { + "reference": "urn:uuid:294a2158-9803-36ec-1a3d-2fb2f7e69ce1" + }, { + "reference": "urn:uuid:eca2b39a-16c8-c3dd-f9c5-209b7ad0e48c" + }, { + "reference": "urn:uuid:2e480b73-2894-fb0d-21c1-06603abd11cd" + }, { + "reference": "urn:uuid:b1911f3a-5c85-9eae-c872-bcad37d73a1d" + }, { + "reference": "urn:uuid:f3994cff-cf83-a405-f9b0-104fef3a30c1" + }, { + "reference": "urn:uuid:374d112a-6225-e872-8ebb-69e7017ded70" + }, { + "reference": "urn:uuid:3773123f-669b-b2ad-0def-efdafa733939" + }, { + "reference": "urn:uuid:e9199602-06e7-8451-a7b9-538cecf2c5a3" + }, { + "reference": "urn:uuid:6ebdb3c3-4136-ff9e-691e-bdcf5b641215" + }, { + "reference": "urn:uuid:7c02d7f0-e1ac-e57a-b4ab-8e95a102c378" + }, { + "reference": "urn:uuid:78266cf3-92be-6fb9-47f7-e3ecf72f521a" + }, { + "reference": "urn:uuid:43c4bd38-b795-8b9d-e1be-1c2a9f8231d5" + }, { + "reference": "urn:uuid:9241628c-cafd-b8a0-d189-c7686d26d86f" + }, { + "reference": "urn:uuid:c976d6ae-f979-8f70-d9df-bc2c40764644" + }, { + "reference": "urn:uuid:a875f91f-6a7b-353a-4f86-43694d1ef522" + }, { + "reference": "urn:uuid:f9579e3c-7b9a-3f2b-ef8f-8faa9fa25173" + }, { + "reference": "urn:uuid:07af7b8d-2545-ca33-a137-f38d18ce21a1" + }, { + "reference": "urn:uuid:ce51055d-f319-cb0b-13cc-8b6e6f5a7fb5" + }, { + "reference": "urn:uuid:f10c118e-c6ea-da79-aae6-4e650f3b4941" + }, { + "reference": "urn:uuid:db1053a6-e50c-01d2-6f90-ba715dbe2980" + }, { + "reference": "urn:uuid:4e04062f-2e86-4bc0-32b2-8ff3df7ca1bb" + }, { + "reference": "urn:uuid:71cb553c-9b32-1d45-d782-50627bbbb3ed" + }, { + "reference": "urn:uuid:fec35e4d-e61e-9aff-f337-7435064913aa" + }, { + "reference": "urn:uuid:750cd959-62b3-9ead-dcc4-8c23df80013c" + }, { + "reference": "urn:uuid:d8afbf20-4cbf-00f1-ab75-c192c81e330e" + }, { + "reference": "urn:uuid:0d2280c7-d166-3b57-f112-6a4b8e33714d" + }, { + "reference": "urn:uuid:7054a4ac-0701-a695-9ad7-a36f6ffcc7cb" + }, { + "reference": "urn:uuid:9705dc6d-0e76-d914-ef8d-27a693267227" + }, { + "reference": "urn:uuid:372fe84d-6dfb-e9af-2754-d49db8fde62b" + } ], + "recorded": "2021-07-13T12:44:52.558-04:00", + "agent": [ { + "type": { + "coding": [ { + "system": "http://terminology.hl7.org/CodeSystem/provenance-participant-type", + "code": "author", + "display": "Author" + } ], + "text": "Author" + }, + "who": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + }, + "onBehalfOf": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|dd406540-fa97-3a90-858e-0a0ea61cf07b", + "display": "PCP74147" + } + }, { + "type": { + "coding": [ { + "system": "http://hl7.org/fhir/us/core/CodeSystem/us-core-provenance-participant-type", + "code": "transmitter", + "display": "Transmitter" + } ], + "text": "Transmitter" + }, + "who": { + "reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999559", + "display": "Dr. Leigh689 Rutherford999" + }, + "onBehalfOf": { + "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|dd406540-fa97-3a90-858e-0a0ea61cf07b", + "display": "PCP74147" + } + } ] + }, + "request": { + "method": "POST", + "url": "Provenance" + } + } ] +} \ No newline at end of file diff --git a/src/test/resources/flexporter/test_mapping.yaml b/src/test/resources/flexporter/test_mapping.yaml new file mode 100644 index 0000000000..d04374ad5f --- /dev/null +++ b/src/test/resources/flexporter/test_mapping.yaml @@ -0,0 +1,135 @@ +--- +# name is just a friendly name for this mapping +name: Random Testing + +# applicability determines whether this mapping applies to a given file. +# for now the assumption is 1 file = 1 synthea patient bundle. +applicability: true + +actions: + - name: Apply Profiles + # v1: define specific profiles and an applicability statement on when to apply them + # v1.1: allow specifying a field from the profile to key off of (ex. mCode TNMPrimaryTumorCategory.code) + # maybe v2 will automatically infer? + # some of the challenges to keep in mind: + # - what if the resource doesn't conform to the profile yet? + # we should make sure we can take other actions before applying profiles, + # or manually specify where to apply profiles so that we can apply other fixes based on profile later. + profiles: + - profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient + applicability: Patient + - profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter + applicability: Encounter + # - profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-condition + # applicability: Condition + # - profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation + # applicability: Observation + # - profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-procedure + # applicability: Procedure + # - profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-medicationrequest + # applicability: MedicationRequest + # - profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-immunization + # applicability: Immunization + # - profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-careplan + # applicability: CarePlan + # - profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-imagingstudy + # applicability: ImagingStudy + # - profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-device + # applicability: Device + # - profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-practitioner + # applicability: Practitioner + # - profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-allergyintolerance + # applicability: AllergyIntolerance + # - profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-claim + # applicability: Claim + + + - name: testSetValues + set_values: + - applicability: Patient + fields: + - location: Patient.birthDate + value: !!str "1987-06-05" + + + - name: testSetValues_getField + set_values: + - applicability: Immunization + fields: + - location: Immunization.recorded + value: $getField([Immunization.occurrence]) + # TODO: occurrence is a choice type, + # it would be nice to put "occurrenceDateTime" here + # since that's what's actually in the JSON + # but that doesn't seem to work with HAPI's FhirPath + + - name: testSetValues_overwrite + set_values: + - applicability: Observation + fields: + - location: Observation.effectiveInstant + value: $getField([Observation.effective]) + # - location: Observation.referenceRange.text + # value: sample reference range text + # - location: Observation.valueString + # value: string value here + # - location: Observation.derivedFrom.reference + # value: $findRef([Observation]) + + - name: testSetValues_transform + set_values: + - applicability: Patient + fields: + - location: Patient.birthDate.extension.where(url='http://hl7.org/fhir/StructureDefinition/patient-birthTime').valueDateTime + value: $getField([Patient.birthDate]) + transform: toDateTime + + - name: testCreateResources_createSingle + create_resource: + - resourceType: ServiceRequest + profiles: + - http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-servicerequest + fields: + - location: ServiceRequest.status + value: active + - location: ServiceRequest.subject.reference + value: $findRef([Patient]) + + + - name: testCreateResources_createBasedOn + create_resource: + - resourceType: ServiceRequest + based_on: Procedure + fields: + - location: ServiceRequest.intent + value: plan + - location: ServiceRequest.encounter.reference + value: $getField([Procedure.encounter.reference]) + # TODO: is "writeback" the best term here? + writeback: + - location: Procedure.basedOn.reference + value: $setRef([ServiceRequest]) + + - name: testCreateResources_getAttribute + create_resource: + - resourceType: Patient + fields: + - location: Patient.name.text + value: $getAttribute([name]) + - location: Patient.name.given + value: $getAttribute([first_name]) + - location: Patient.name.family + value: $getAttribute([last_name]) + + + +# TODO: on keep/delete, check for references to removed items!! + - name: testKeepResources + keep_resources: + - Patient + - Encounter + - Condition + + - name: testDeleteResources + delete_resources: + - Provenance From c98e99a7a4f1b6cb6e2279c7803b3dc24c18e65b Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Tue, 7 Jun 2022 12:29:16 -0400 Subject: [PATCH 03/78] fix javadoc errors --- .../CustomFHIRPathResourceGeneratorR4.java | 13 ++++++------- .../mitre/synthea/export/flexporter/Mapping.java | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/main/java/org/mitre/synthea/export/flexporter/CustomFHIRPathResourceGeneratorR4.java b/src/main/java/org/mitre/synthea/export/flexporter/CustomFHIRPathResourceGeneratorR4.java index 220608116f..beb63ea93f 100644 --- a/src/main/java/org/mitre/synthea/export/flexporter/CustomFHIRPathResourceGeneratorR4.java +++ b/src/main/java/org/mitre/synthea/export/flexporter/CustomFHIRPathResourceGeneratorR4.java @@ -33,14 +33,14 @@ * -- add support for BackboneElements * -- swapped constructors, pass in a FhirContext to avoid recreating it for each resource * -- add support for extensions on primitives - * -- more advanced java generics (some functions now take in Class instead of just T + * -- more advanced java generics (some functions now take in Class<? extends T> instead of just T * -- reformatted per Synthea style guidelines * * Original: * https://github.com/hapifhir/hapi-fhir/blob/master/hapi-fhir-validation/src/main/java/org/hl7/fhir/common/hapi/validation/validator/FHIRPathResourceGeneratorR4.java * * - * @author Marcel Parciak + * @author Marcel Parciak marcel.parciak@med.uni-goettingen.de * */ public class CustomFHIRPathResourceGeneratorR4 { @@ -92,7 +92,7 @@ public CustomFHIRPathResourceGeneratorR4(FhirContext fhirCtx) { /** * Setter for the FHIRPath mapping Map instance. * - * @param mapping Map a mapping of FHIRPath to value Strings that will be used to + * @param mapping Map<String, String> a mapping of FHIRPath to value Strings that will be used to * create a Resource. */ public void setMapping(Map mapping) { @@ -109,9 +109,8 @@ public T getResource() { } /** - * Getter for a generated Resource. null if no Resource has been generated yet. - * - * @return T the generated Resource or null. + * Sets the resource to apply FHIRPath changes to. + * If not set, calling generateResource will instantiate a new resource. */ public void setResource(T resource) { this.resource = resource; @@ -135,7 +134,7 @@ private void prepareInternalState(Class resourceClass) { * The generation method that yields a new instance of class `resourceClass` with every value set * in the FHIRPath mapping. * - * @param resourceClass Class The class of the Resource that shall be created. + * @param resourceClass Class<T> The class of the Resource that shall be created. * @return T a new FHIR Resource instance of class `resourceClass`. */ public T generateResource(Class resourceClass) { diff --git a/src/main/java/org/mitre/synthea/export/flexporter/Mapping.java b/src/main/java/org/mitre/synthea/export/flexporter/Mapping.java index 490165d66e..d57107d6f0 100644 --- a/src/main/java/org/mitre/synthea/export/flexporter/Mapping.java +++ b/src/main/java/org/mitre/synthea/export/flexporter/Mapping.java @@ -14,7 +14,7 @@ public class Mapping { public String applicability; /** - * Each action is a Map. Nested fields within the YAML become ArrayLists and + * Each action is a Map<String,?>. Nested fields within the YAML become ArrayLists and * LinkedHashMaps. */ public List> actions; From 8479a93856641c301b03d182fe6f34ce886adfc9 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Thu, 16 Jun 2022 16:30:29 -0400 Subject: [PATCH 04/78] unit test fix --- .../mitre/synthea/export/flexporter/ValueTransforms.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/mitre/synthea/export/flexporter/ValueTransforms.java b/src/main/java/org/mitre/synthea/export/flexporter/ValueTransforms.java index 1156238af9..3c6dee2c87 100644 --- a/src/main/java/org/mitre/synthea/export/flexporter/ValueTransforms.java +++ b/src/main/java/org/mitre/synthea/export/flexporter/ValueTransforms.java @@ -74,10 +74,12 @@ public static String toTime(String src) { return DateTimeFormatter.ISO_LOCAL_TIME.format(dateTime); } - private static DateTimeFormatter YEAR = DateTimeFormatter.ofPattern("yyyy"); + private static final DateTimeFormatter YEAR = DateTimeFormatter.ofPattern("yyyy"); - private static DateTimeFormatter YEAR_MONTH = DateTimeFormatter.ofPattern("yyyy-MM"); + private static final DateTimeFormatter YEAR_MONTH = DateTimeFormatter.ofPattern("yyyy-MM"); + private static final ZoneId UTC = ZoneId.of("UTC"); + private static ZonedDateTime parse(String src) { // assume src is one of the four formats already @@ -96,7 +98,7 @@ private static ZonedDateTime parse(String src) { case 8: // hh:mm:ss return LocalDateTime.parse(src, DateTimeFormatter.ISO_LOCAL_TIME) - .atZone(ZoneId.systemDefault()); + .atZone(UTC); case 10: // YYYY-MM-DD return LocalDate.parse(src, DateTimeFormatter.ISO_LOCAL_DATE) From b3bbdaf2dc688d06b076bd5484f453c0c98b71d4 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Thu, 16 Jun 2022 17:16:55 -0400 Subject: [PATCH 05/78] actually fix unit test --- .../org/mitre/synthea/export/flexporter/ValueTransforms.java | 5 ++--- .../org/mitre/synthea/export/flexporter/ActionsTest.java | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/mitre/synthea/export/flexporter/ValueTransforms.java b/src/main/java/org/mitre/synthea/export/flexporter/ValueTransforms.java index 3c6dee2c87..025b25f889 100644 --- a/src/main/java/org/mitre/synthea/export/flexporter/ValueTransforms.java +++ b/src/main/java/org/mitre/synthea/export/flexporter/ValueTransforms.java @@ -97,12 +97,11 @@ private static ZonedDateTime parse(String src) { return LocalDate.parse(src, YEAR_MONTH).atStartOfDay(ZoneId.systemDefault()); case 8: // hh:mm:ss - return LocalDateTime.parse(src, DateTimeFormatter.ISO_LOCAL_TIME) - .atZone(UTC); + return ZonedDateTime.parse(src, DateTimeFormatter.ISO_LOCAL_TIME); case 10: // YYYY-MM-DD return LocalDate.parse(src, DateTimeFormatter.ISO_LOCAL_DATE) - .atStartOfDay(ZoneId.systemDefault()); + .atStartOfDay(UTC); default: // TODO: make sure this actually works -- the docs are weird return ZonedDateTime.parse(src, DateTimeFormatter.ISO_ZONED_DATE_TIME); diff --git a/src/test/java/org/mitre/synthea/export/flexporter/ActionsTest.java b/src/test/java/org/mitre/synthea/export/flexporter/ActionsTest.java index da7c4b255a..b73fde5b82 100644 --- a/src/test/java/org/mitre/synthea/export/flexporter/ActionsTest.java +++ b/src/test/java/org/mitre/synthea/export/flexporter/ActionsTest.java @@ -216,7 +216,7 @@ public void testSetValues_transform() { // NOTE: this expected value may change if we ever add randomness to the date -> dateTime // transform - assertEquals("1999-09-29T04:00:00Z", + assertEquals("1999-09-29T00:00:00Z", ((DateTimeType) date.getExtension().get(0).getValue()).getValueAsString()); } From a5555f810013c53e113116d2d0a9e3bd023d18b4 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Thu, 30 Jun 2022 09:35:55 -0400 Subject: [PATCH 06/78] work towards supporting setting and copying objects, not just primitives --- src/main/java/RunFlexporter.java | 10 +- .../org/mitre/synthea/export/Exporter.java | 12 +- .../synthea/export/flexporter/Actions.java | 149 +++++++++++------- .../CustomFHIRPathResourceGeneratorR4.java | 19 +++ .../export/flexporter/ActionsTest.java | 62 ++++++-- .../resources/flexporter/test_mapping.yaml | 46 +++--- 6 files changed, 201 insertions(+), 97 deletions(-) diff --git a/src/main/java/RunFlexporter.java b/src/main/java/RunFlexporter.java index 74d07ab503..e146cf84ec 100644 --- a/src/main/java/RunFlexporter.java +++ b/src/main/java/RunFlexporter.java @@ -9,6 +9,8 @@ import java.util.LinkedList; import java.util.Queue; +import ca.uhn.fhir.parser.IParser; + import org.hl7.fhir.r4.model.Bundle; import org.hl7.fhir.r4.model.Bundle.BundleEntryComponent; import org.hl7.fhir.r4.model.Resource; @@ -16,8 +18,6 @@ import org.mitre.synthea.export.flexporter.FhirPathUtils; import org.mitre.synthea.export.flexporter.Mapping; -import ca.uhn.fhir.parser.IParser; - public class RunFlexporter { public static void main(String[] args) throws Exception { @@ -47,9 +47,8 @@ public static void main(String[] args) throws Exception { throw new FileNotFoundException( String.format("Specified implementation guide directory (%s) is empty", value)); } - } - else if (currArg.equals("-m")) { + } else if (currArg.equals("-m")) { String value = argsQ.poll(); if (value == null) { @@ -62,9 +61,8 @@ else if (currArg.equals("-m")) { throw new FileNotFoundException( String.format("Specified mapping file (%s) does not exist", value)); } - } - else if (currArg.equals("-s")) { + } else if (currArg.equals("-s")) { String value = argsQ.poll(); sourceFile = new File(value); diff --git a/src/main/java/org/mitre/synthea/export/Exporter.java b/src/main/java/org/mitre/synthea/export/Exporter.java index 7e35107317..514fa3e633 100644 --- a/src/main/java/org/mitre/synthea/export/Exporter.java +++ b/src/main/java/org/mitre/synthea/export/Exporter.java @@ -230,14 +230,14 @@ private static boolean exportRecord(Person person, String fileTag, long stopTime if (Config.getAsBoolean("exporter.fhir.export")) { File outDirectory = getOutputFolder("fhir", person); org.hl7.fhir.r4.model.Bundle bundle = FhirR4.convertToFHIR(person, stopTime); - + if (options.flexporterMappings != null) { - for (Mapping mapping : options.flexporterMappings) { - // flexport on the bundle here - Actions.applyMapping(bundle, mapping, person); - } + for (Mapping mapping : options.flexporterMappings) { + // flexport on the bundle here + Actions.applyMapping(bundle, mapping, person); + } } - + IParser parser = FhirR4.getContext().newJsonParser(); if (Config.getAsBoolean("exporter.fhir.bulk_data")) { parser.setPrettyPrint(false); diff --git a/src/main/java/org/mitre/synthea/export/flexporter/Actions.java b/src/main/java/org/mitre/synthea/export/flexporter/Actions.java index bc07cd36d5..d0e1c04053 100644 --- a/src/main/java/org/mitre/synthea/export/flexporter/Actions.java +++ b/src/main/java/org/mitre/synthea/export/flexporter/Actions.java @@ -76,7 +76,7 @@ private static void applyProfile(Resource resource, String profileURL) { public static void setValues(Bundle bundle, List> items, Person person) { for (Map entry : items) { String applicability = (String) entry.get("applicability"); - List> fields = (List>) entry.get("fields"); + List> fields = (List>) entry.get("fields"); List matchingResources = FhirPathUtils.evaluateBundle(bundle, applicability, true); @@ -108,7 +108,7 @@ public static void createResource(Bundle bundle, List> resou List profiles = (List) newResourceDef.get("profiles"); List basedOnResources; - List> writeback; + List> writeback; if (basedOnPath == null) { basedOnResources = Collections.singletonList(null); @@ -117,10 +117,10 @@ public static void createResource(Bundle bundle, List> resou basedOnResources = FhirPathUtils.evaluateBundle(bundle, basedOnPath, true); // this may return empty list, in which no new resources will be created - writeback = (List>) newResourceDef.get("writeback"); + writeback = (List>) newResourceDef.get("writeback"); } - List> fields = (List>) newResourceDef.get("fields"); + List> fields = (List>) newResourceDef.get("fields"); for (Base basedOnItem : basedOnResources) { // IMPORTANT: basedOnItem may be null @@ -132,78 +132,121 @@ public static void createResource(Bundle bundle, List> resou new CustomFHIRPathResourceGeneratorR4<>(FhirPathUtils.FHIR_CTX); fhirPathgenerator.setMapping(fhirPathMapping); - try { - Class resourceClass = - (Class) Class.forName("org.hl7.fhir.r4.model." + resourceType); + Resource createdResource = fhirPathgenerator.generateResource(resourceType); - Resource createdResource = fhirPathgenerator.generateResource(resourceClass); - - // ensure the new resource has an ID - // seems like this should work as part of the fhirpathgenerator, but it didn't - // this might be easier anyway - createdResource.setId(UUID.randomUUID().toString()); - if (profiles != null) { - profiles.forEach(p -> applyProfile(createdResource, p)); - } - - // TODO: see if there's a good way to add the resource after the based-on resource - BundleEntryComponent newEntry = bundle.addEntry(); + // ensure the new resource has an ID + // seems like this should work as part of the fhirpathgenerator, but it didn't + // this might be easier anyway + createdResource.setId(UUID.randomUUID().toString()); + if (profiles != null) { + profiles.forEach(p -> applyProfile(createdResource, p)); + } - newEntry.setResource(createdResource); + // TODO: see if there's a good way to add the resource after the based-on resource + BundleEntryComponent newEntry = bundle.addEntry(); - if (bundle.getType().equals(BundleType.TRANSACTION)) { - BundleEntryRequestComponent request = newEntry.getRequest(); - // as of now everything in synthea is POST to resourceType. - request.setMethod(HTTPVerb.POST); - request.setUrl(resourceType); - } + newEntry.setResource(createdResource); - if (writeback != null && !writeback.isEmpty()) { - Map writebackMapping = - createFhirPathMapping(writeback, bundle, createdResource, person); + if (bundle.getType().equals(BundleType.TRANSACTION)) { + BundleEntryRequestComponent request = newEntry.getRequest(); + // as of now everything in synthea is POST to resourceType. + request.setMethod(HTTPVerb.POST); + request.setUrl(resourceType); + } - CustomFHIRPathResourceGeneratorR4 writebackGenerator = - new CustomFHIRPathResourceGeneratorR4<>(FhirPathUtils.FHIR_CTX); - writebackGenerator.setMapping(writebackMapping); - writebackGenerator.setResource((Resource) basedOnItem); + if (writeback != null && !writeback.isEmpty()) { + Map writebackMapping = + createFhirPathMapping(writeback, bundle, createdResource, person); - writebackGenerator.generateResource((Class) basedOnItem.getClass()); - } + CustomFHIRPathResourceGeneratorR4 writebackGenerator = + new CustomFHIRPathResourceGeneratorR4<>(FhirPathUtils.FHIR_CTX); + writebackGenerator.setMapping(writebackMapping); + writebackGenerator.setResource((Resource) basedOnItem); - } catch (ClassNotFoundException e) { - e.printStackTrace(); + writebackGenerator.generateResource((Class) basedOnItem.getClass()); } } } } - private static Map createFhirPathMapping(List> fields, + private static Map createFhirPathMapping(List> fields, Bundle sourceBundle, Resource sourceResource, Person person) { Map fhirPathMapping = new HashMap<>(); - for (Map field : fields) { - String location = field.get("location"); - String valueDef = field.get("value"); - String transform = field.get("transform"); - - if (valueDef == null || valueDef.isEmpty() || valueDef.equals("null")) { - valueDef = null; - } else if (valueDef.startsWith("$")) { - valueDef = getValue(sourceBundle, valueDef, sourceResource, person); - } // else - assume it's a raw value + for (Map field : fields) { + String location = (String)field.get("location"); + Object valueDef = field.get("value"); + String transform = (String)field.get("transform"); + + if (valueDef == null) { + // do nothing, leave it null + } else if (valueDef instanceof String) { + String valueString = (String)valueDef; + + if (valueString.startsWith("$")) { + valueDef = getValue(sourceBundle, valueString, sourceResource, person); + } // else - assume it's a raw value + + } else if (valueDef instanceof Map) { + System.out.println("breakpoint me"); + } // TODO: consider a "skip-resource-if-null" kind of thing // or "don't create this resource if the referenced field on the source resource is missing" + // Things are starting to get a little wonky with types. + // What else could we have here? + if (valueDef instanceof Base && ((Base) valueDef).isPrimitive()) { + valueDef = ((Base)valueDef).primitiveValue(); + } + if (transform != null) { - valueDef = ValueTransforms.apply(valueDef, transform); + // TODO: valuetransforms should support objects + valueDef = ValueTransforms.apply((String)valueDef, transform); } // TODO: the $getField option allows copying a single primitive value // do we want to allow copying an entire object somehow? - fhirPathMapping.put(location, valueDef); + + + if (valueDef instanceof String) { + String valueString = (String)valueDef; + + fhirPathMapping.put(location, valueString); + + } else if (valueDef instanceof Map) { + // TODO: objects should be nestable to >1 level + Map valueMap = (Map) valueDef; + for(Map.Entry entry : valueMap.entrySet()) { + String key = entry.getKey(); + String value = entry.getValue(); + + fhirPathMapping.put(location + "." + key, value); + } + } else if (valueDef instanceof Base) { + // we plucked a full FHIR object from somewhere. + // the ugly/slow way to handle it is to convert it to a Map + // and plug it into the fhirpath mapping as above + + // note that hapi has strange internal state, + // ex a CodeableConcept.coding.system is a string, + // but internally represented as an object with multiple fields + // "myStringValue", "myCoercedValue", "disallowExtensions" + // so a trivial Gson conversion is out + + // ideally we'd be able to find the right setter function + // and set it on the target directly + // TODO + + System.err.println("FHIR Types not yet handled in createFhirPathMapping: " + valueDef.getClass()); + + + } else { + // + System.err.println("Unhandled type in createFhirPathMapping: " + valueDef.getClass()); + } } return fhirPathMapping; @@ -257,7 +300,7 @@ public static void deleteResources(Bundle bundle, List list) { } - private static String getValue(Bundle bundle, String valueDef, Resource currentResource, + private static Object getValue(Bundle bundle, String valueDef, Resource currentResource, Person person) { // The flag has the format of $flagName([flagValue1, flagValue2, ..., flagValueN]) @@ -313,7 +356,7 @@ private static String createReference(Resource resource) { return resource.getResourceType().toString() + "/" + id; } - private static String getField(Resource currentResource, String... args) { + private static Base getField(Resource currentResource, String... args) { // args[0] = FHIRPath, from this resource // args[1] = how to disambiguate if there are multiple? TODO @@ -322,7 +365,7 @@ private static String getField(Resource currentResource, String... args) { if (fieldValues.isEmpty()) return null; - return fieldValues.get(0).primitiveValue(); + return fieldValues.get(0); } diff --git a/src/main/java/org/mitre/synthea/export/flexporter/CustomFHIRPathResourceGeneratorR4.java b/src/main/java/org/mitre/synthea/export/flexporter/CustomFHIRPathResourceGeneratorR4.java index beb63ea93f..a2ef913ba3 100644 --- a/src/main/java/org/mitre/synthea/export/flexporter/CustomFHIRPathResourceGeneratorR4.java +++ b/src/main/java/org/mitre/synthea/export/flexporter/CustomFHIRPathResourceGeneratorR4.java @@ -30,6 +30,7 @@ * * Modified for the Flexporter: * -- allow adding to an existing resource + * -- add class lookup by resourceType * -- add support for BackboneElements * -- swapped constructors, pass in a FhirContext to avoid recreating it for each resource * -- add support for extensions on primitives @@ -130,6 +131,24 @@ private void prepareInternalState(Class resourceClass) { } } + /** + * The generation method that yields a new instance of the given resourceTypue with every value set + * in the FHIRPath mapping. + * + * @param resourceType String The class name of the Resource that shall be created. + * @return T a new FHIR Resource instance of the given resource type. + */ + public T generateResource(String resourceType) { + try { + Class resourceClass = + (Class) Class.forName("org.hl7.fhir.r4.model." + resourceType); + + return generateResource(resourceClass); + } catch (ClassNotFoundException e) { + throw new RuntimeException(e); + } + } + /** * The generation method that yields a new instance of class `resourceClass` with every value set * in the FHIRPath mapping. diff --git a/src/test/java/org/mitre/synthea/export/flexporter/ActionsTest.java b/src/test/java/org/mitre/synthea/export/flexporter/ActionsTest.java index b73fde5b82..1037bcc0e3 100644 --- a/src/test/java/org/mitre/synthea/export/flexporter/ActionsTest.java +++ b/src/test/java/org/mitre/synthea/export/flexporter/ActionsTest.java @@ -15,7 +15,9 @@ import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Map.Entry; import java.util.Set; +import java.util.function.Function; import java.util.stream.Collectors; import org.hl7.fhir.r4.model.BooleanType; @@ -29,6 +31,7 @@ import org.hl7.fhir.r4.model.InstantType; import org.hl7.fhir.r4.model.Observation; import org.hl7.fhir.r4.model.Patient; +import org.hl7.fhir.r4.model.Procedure; import org.hl7.fhir.r4.model.Resource; import org.hl7.fhir.r4.model.ResourceType; import org.hl7.fhir.r4.model.ServiceRequest; @@ -220,6 +223,21 @@ public void testSetValues_transform() { ((DateTimeType) date.getExtension().get(0).getValue()).getValueAsString()); } + @Test + public void testSetValues_object() { + Patient p = new Patient(); + p.addName().addGiven("Mel").setFamily("Maroon"); + + Bundle b = new Bundle(); + b.addEntry().setResource(p); + + Map action = getActionByName("testSetValues_object"); + + Actions.applyAction(b, action, null); + + System.out.println(b); + } + @Test public void testKeepResources() throws Exception { Bundle b = loadFixtureBundle("sample_complete_patient.json"); @@ -294,24 +312,48 @@ public void testCreateResources_createBasedOn() throws Exception { Bundle b = loadFixtureBundle("sample_complete_patient.json"); long countSR = b.getEntry().stream() - .filter(bec -> bec.getResource().getResourceType() == ResourceType.ServiceRequest).count(); + .filter(bec -> bec.getResource().getResourceType() == ResourceType.ServiceRequest) + .count(); assertEquals(0, countSR); - long countProc = b.getEntry().stream() - .filter(bec -> bec.getResource().getResourceType() == ResourceType.Procedure).count(); - assertTrue(countProc > 0); - + + List procedures = b.getEntry().stream() + .filter(bec -> bec.getResource().getResourceType() == ResourceType.Procedure) + .map(bec -> (Procedure) bec.getResource()) + .collect(Collectors.toList()); + Map action = getActionByName("testCreateResources_createBasedOn"); Actions.applyAction(b, action, null); // there should now be one ServiceRequest per Procedure - countSR = b.getEntry().stream() - .filter(bec -> bec.getResource().getResourceType() == ResourceType.ServiceRequest).count(); - assertEquals(countProc, countSR); - - // TODO: fill out the rest of this test, check the "writeback" + // get a map of id --> servicerequest, for easy lookups + Map serviceRequests = b.getEntry().stream() + .filter(bec -> bec.getResource().getResourceType() == ResourceType.ServiceRequest) + .map(bec -> (ServiceRequest) bec.getResource()) + .collect(Collectors.toMap(ServiceRequest::getId, Function.identity())); + + assertEquals(procedures.size(), serviceRequests.size()); + + String patientId = b.getEntryFirstRep().getResource().getId(); + + // iterate over the procedures so we can find the servicerequest for each + for (Procedure proc : procedures) { + + // "ServiceRequest/".length == 15 + String basedOn = proc.getBasedOnFirstRep().getReference().substring(15); + + ServiceRequest sr = serviceRequests.remove(basedOn); + assertNotNull(sr); + assertEquals("plan", sr.getIntent().toCode()); + assertEquals(patientId, sr.getSubject().getReference()); + assertEquals(proc.getEncounter().getReference(), sr.getEncounter().getReference()); + } + + // we removed each SR as we checked it, to ensure there are none left + assertEquals(0, serviceRequests.size()); + } @Test diff --git a/src/test/resources/flexporter/test_mapping.yaml b/src/test/resources/flexporter/test_mapping.yaml index d04374ad5f..8e7f8fc218 100644 --- a/src/test/resources/flexporter/test_mapping.yaml +++ b/src/test/resources/flexporter/test_mapping.yaml @@ -20,28 +20,7 @@ actions: applicability: Patient - profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter applicability: Encounter - # - profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-condition - # applicability: Condition - # - profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation - # applicability: Observation - # - profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-procedure - # applicability: Procedure - # - profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-medicationrequest - # applicability: MedicationRequest - # - profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-immunization - # applicability: Immunization - # - profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-careplan - # applicability: CarePlan - # - profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-imagingstudy - # applicability: ImagingStudy - # - profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-device - # applicability: Device - # - profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-practitioner - # applicability: Practitioner - # - profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-allergyintolerance - # applicability: AllergyIntolerance - # - profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-claim - # applicability: Claim + - name: testSetValues @@ -63,6 +42,8 @@ actions: # since that's what's actually in the JSON # but that doesn't seem to work with HAPI's FhirPath + + - name: testSetValues_overwrite set_values: - applicability: Observation @@ -76,6 +57,8 @@ actions: # - location: Observation.derivedFrom.reference # value: $findRef([Observation]) + + - name: testSetValues_transform set_values: - applicability: Patient @@ -84,6 +67,20 @@ actions: value: $getField([Patient.birthDate]) transform: toDateTime + + + - name: testSetValues_object + set_values: + - applicability: Patient + fields: + - location: Patient.maritalStatus.coding + value: + system: http://snomedct.io + code: "1100348239483" + display: "Found the one" + + + - name: testCreateResources_createSingle create_resource: - resourceType: ServiceRequest @@ -96,6 +93,7 @@ actions: value: $findRef([Patient]) + - name: testCreateResources_createBasedOn create_resource: - resourceType: ServiceRequest @@ -105,6 +103,10 @@ actions: value: plan - location: ServiceRequest.encounter.reference value: $getField([Procedure.encounter.reference]) + - location: ServiceRequest.subject.reference + value: $findRef([Patient]) + - location: ServiceRequest.code.coding + value: $getField([Procedure.code.coding]) # <-- STILL WIP # TODO: is "writeback" the best term here? writeback: - location: Procedure.basedOn.reference From 5efadb5068c065abad547c80bea766296b35bead Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Fri, 1 Jul 2022 13:52:22 -0400 Subject: [PATCH 07/78] pick random code from valueset --- src/main/java/RunFlexporter.java | 85 ++++++++++++++++++- .../synthea/export/flexporter/Actions.java | 16 ++++ .../synthea/helpers/RandomCodeGenerator.java | 62 ++++++++++++-- 3 files changed, 155 insertions(+), 8 deletions(-) diff --git a/src/main/java/RunFlexporter.java b/src/main/java/RunFlexporter.java index e146cf84ec..c75aa111cc 100644 --- a/src/main/java/RunFlexporter.java +++ b/src/main/java/RunFlexporter.java @@ -7,16 +7,25 @@ import java.nio.file.StandardOpenOption; import java.util.Arrays; import java.util.LinkedList; +import java.util.Map; import java.util.Queue; -import ca.uhn.fhir.parser.IParser; - +import org.apache.commons.io.FilenameUtils; +import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.r4.model.Bundle; import org.hl7.fhir.r4.model.Bundle.BundleEntryComponent; import org.hl7.fhir.r4.model.Resource; +import org.hl7.fhir.r4.model.ValueSet; import org.mitre.synthea.export.flexporter.Actions; import org.mitre.synthea.export.flexporter.FhirPathUtils; import org.mitre.synthea.export.flexporter.Mapping; +import org.mitre.synthea.helpers.RandomCodeGenerator; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +import ca.uhn.fhir.parser.DataFormatException; +import ca.uhn.fhir.parser.IParser; public class RunFlexporter { @@ -89,6 +98,10 @@ public static void convertFhir(File mappingFile, File igDirectory, File sourceFh throws IOException { Mapping mapping = Mapping.parseMapping(mappingFile); + + if (igDirectory != null) { + loadIG(igDirectory); + } IParser parser = FhirPathUtils.FHIR_CTX.newJsonParser().setPrettyPrint(true); @@ -127,6 +140,74 @@ public static void convertFhir(File mappingFile, File igDirectory, File sourceFh } } + private static void loadIG(File igDirectory) throws IOException { + File[] artifacts = igDirectory.listFiles(); + + for (File artifact : artifacts) { + if (artifact.isFile() && FilenameUtils.getExtension(artifact.toString()).equals("json")) { + + IParser parser = FhirPathUtils.FHIR_CTX.newJsonParser(); + + String fhirJson = new String(Files.readAllBytes(artifact.toPath())); + IBaseResource resource = null; + + try { + resource = parser.parseResource(fhirJson); + } catch (DataFormatException dfe) { + // why does an IG contain bad data? + System.err.println("Warning: Unable to parse IG artifact " + artifact.getAbsolutePath()); + dfe.printStackTrace(); + } + +// System.out.println(resource); + + if (resource instanceof ValueSet) { + // TODO: fix RandomCodeGenerator to work with HAPI objects + // because this is silly + + ObjectMapper objectMapper = new ObjectMapper(); + + Map valueSet = objectMapper.readValue(fhirJson, + new TypeReference>() { + }); + try { + RandomCodeGenerator.loadValueSet(null, valueSet); + } catch (Exception e) { + System.err.println("WARNING: Unable to load ValueSet " + artifact.getAbsolutePath()); + e.printStackTrace(); + } + + } + +// JsonObject jsonObj = (JsonObject) JsonParser.parseReader(new FileReader(artifact)); +// String resourceType = jsonObj.get("resourceType").getAsString(); +// +// if(RESOURCES_IN_SCOPE_MAP.contains(resourceType)) { +// Resource resource = new Gson().fromJson(jsonObj, Resource.class); +// +// if(resource.getResourceType() == ResourceType.StructureDefinition) { +// String type = jsonObj.get("type").getAsString(); +// +// if(type.equals("Extension")) { +// igArtifacts.addExtension(resource.url, resource); +// } +// else { +// igArtifacts.addProfile(resource); +// } +// } +// else if(resource.resourceType.equals("ValueSet")) { +// for(ValueSet valueSet : resource.compose.getList()) { +// valueSet.setCodes(); +// } +// igArtifacts.addValueSet(resource.url, resource); +// } +// } + } + } + + } + + public static Bundle convertFhir(Bundle bundle, Mapping mapping) { Actions.applyMapping(bundle, mapping, null); diff --git a/src/main/java/org/mitre/synthea/export/flexporter/Actions.java b/src/main/java/org/mitre/synthea/export/flexporter/Actions.java index d0e1c04053..7cceed71f4 100644 --- a/src/main/java/org/mitre/synthea/export/flexporter/Actions.java +++ b/src/main/java/org/mitre/synthea/export/flexporter/Actions.java @@ -18,7 +18,10 @@ import org.hl7.fhir.r4.model.Bundle.HTTPVerb; import org.hl7.fhir.r4.model.Meta; import org.hl7.fhir.r4.model.Resource; +import org.mitre.synthea.helpers.RandomCodeGenerator; import org.mitre.synthea.world.agents.Person; +import org.mitre.synthea.world.concepts.HealthRecord.Code; + // For now @SuppressWarnings("unchecked") @@ -322,6 +325,8 @@ private static Object getValue(Bundle bundle, String valueDef, Resource currentR return findValues(bundle, flagValues); } else if (flag.equals("getAttribute")) { return getAttribute(person, flagValues); + } else if (flag.equals("randomCode")) { + return randomCode(flagValues[0]); } return null; @@ -393,4 +398,15 @@ private static String findValues(Bundle bundle, String... args) { return fieldValues.get(0).primitiveValue(); } + + private static Map randomCode(String valueSetUrl) { + Code code = RandomCodeGenerator.getCode(valueSetUrl, (int)(Math.random() * Integer.MAX_VALUE), null); + + Map codeAsMap = new HashMap<>(); + codeAsMap.put("system", code.system); + codeAsMap.put("code", code.code); + codeAsMap.put("display", code.display); + + return codeAsMap; + } } diff --git a/src/main/java/org/mitre/synthea/helpers/RandomCodeGenerator.java b/src/main/java/org/mitre/synthea/helpers/RandomCodeGenerator.java index a585171d06..dbf66472e5 100644 --- a/src/main/java/org/mitre/synthea/helpers/RandomCodeGenerator.java +++ b/src/main/java/org/mitre/synthea/helpers/RandomCodeGenerator.java @@ -90,17 +90,67 @@ private static synchronized void expandValueSet(String valueSetUri) { } catch (IOException e) { throw new RuntimeException("Issue when expanding the value set", e); } - + + loadValueSet(valueSetUri, valueSet); + } + } + + @SuppressWarnings("unchecked") + public static void loadValueSet(String valueSetUri, Map valueSet) { + if (valueSetUri == null) { + valueSetUri = (String)valueSet.get("url"); + } + + if (valueSetUri != null && !codeListCache.containsKey(valueSetUri)) { Map expansion = (Map) valueSet.get("expansion"); - validateExpansion(expansion); - codeListCache.put(valueSetUri, (List) expansion.get("contains")); + if (expansion != null) { + validateExpansion(expansion); + codeListCache.put(valueSetUri, (List) expansion.get("contains")); + + } else { + Map compose = (Map) valueSet.get("compose"); + + if (compose == null) { + throw new RuntimeException("ValueSet does not contain compose or expansion"); + } + + // TODO: why is this List instead of something more specific? + // we know the contents are Map + List codes = new ArrayList<>(); + + List> includeList = (List>) compose.get("include"); + + for (Map include : includeList) { + String system = (String)include.get("system"); + + List> conceptList = (List>) include.get("concept"); + + for (Map concept : conceptList) { + Map codeAsMap = new HashMap<>(); + codeAsMap.put("system", system); + codeAsMap.put("code", (String)concept.get("code")); + codeAsMap.put("display", (String)concept.get("display")); + + codes.add(codeAsMap); + } + + + } + + if (codes.isEmpty()) { + throw new RuntimeException("ValueSet does not contain any codes defined within compose"); + } + + codeListCache.put(valueSetUri, codes); + + + } + System.out.println("Loaded " + valueSetUri); } } private static void validateExpansion(@Nonnull Map expansion) { - if (expansion == null) { - throw new RuntimeException("ValueSet does not contain expansion"); - } else if (!expansion.containsKey("contains") + if (!expansion.containsKey("contains") || ((Collection) expansion.get("contains")).isEmpty()) { throw new RuntimeException("ValueSet expansion does not contain any codes"); } else if (!expansion.containsKey("total")) { From ba1b2ddad7d6beeef84a64dbaae57bc3d40bfe0d Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Thu, 4 Aug 2022 12:50:50 -0400 Subject: [PATCH 08/78] add main synthea command line entry for flexporter --- src/main/java/App.java | 24 ++++++++++++++++++- src/main/java/RunFlexporter.java | 10 ++++---- .../org/mitre/synthea/export/Exporter.java | 9 +++++++ .../synthea/export/flexporter/Actions.java | 2 +- 4 files changed, 39 insertions(+), 6 deletions(-) diff --git a/src/main/java/App.java b/src/main/java/App.java index 1d7475bc15..e790479a45 100644 --- a/src/main/java/App.java +++ b/src/main/java/App.java @@ -9,6 +9,8 @@ import org.mitre.synthea.engine.Generator; import org.mitre.synthea.engine.Module; +import org.mitre.synthea.export.Exporter; +import org.mitre.synthea.export.flexporter.Mapping; import org.mitre.synthea.helpers.Config; import org.mitre.synthea.helpers.Utilities; @@ -56,6 +58,7 @@ public static void usage() { */ public static void main(String[] args) throws Exception { Generator.GeneratorOptions options = new Generator.GeneratorOptions(); + Exporter.ExporterRuntimeOptions exportOptions = new Exporter.ExporterRuntimeOptions(); boolean validArgs = true; boolean overrideFutureDateError = false; @@ -199,6 +202,25 @@ public static void main(String[] args) throws Exception { throw new FileNotFoundException(String.format( "Specified keep-patients file (%s) does not exist", value)); } + } else if (currArg.equals("-fm")) { + String value = argsQ.poll(); + File flexporterMappingFile = new File(value); + if (flexporterMappingFile.exists()) { + Mapping mapping = Mapping.parseMapping(flexporterMappingFile); + exportOptions.addFlexporterMapping(mapping); + } else { + throw new FileNotFoundException(String.format( + "Specified flexporter mapping file (%s) does not exist", value)); + } + } else if (currArg.equals("-ig")) { + String value = argsQ.poll(); + File igFile = new File(value); + if (igFile.exists()) { + RunFlexporter.loadIG(igFile); + } else { + throw new FileNotFoundException(String.format( + "Specified IG directory (%s) does not exist", value)); + } } else if (currArg.startsWith("--")) { String configSetting; String value; @@ -230,7 +252,7 @@ public static void main(String[] args) throws Exception { } if (validArgs && validateConfig(options, overrideFutureDateError)) { - Generator generator = new Generator(options); + Generator generator = new Generator(options, exportOptions); generator.run(); } } diff --git a/src/main/java/RunFlexporter.java b/src/main/java/RunFlexporter.java index c75aa111cc..005d838fed 100644 --- a/src/main/java/RunFlexporter.java +++ b/src/main/java/RunFlexporter.java @@ -57,7 +57,7 @@ public static void main(String[] args) throws Exception { String.format("Specified implementation guide directory (%s) is empty", value)); } - } else if (currArg.equals("-m")) { + } else if (currArg.equals("-fm")) { String value = argsQ.poll(); if (value == null) { @@ -131,8 +131,10 @@ public static void convertFhir(File mappingFile, File igDirectory, File sourceFh String bundleJson = parser.encodeResourceToString(bundle); + new File("./output/flexporter/").mkdirs(); + File outFile = - new File("./output/" + System.currentTimeMillis() + "_" + sourceFhir.getName()); + new File("./output/flexporter/" + System.currentTimeMillis() + "_" + sourceFhir.getName()); Files.write(outFile.toPath(), bundleJson.getBytes(), StandardOpenOption.CREATE_NEW); @@ -140,7 +142,7 @@ public static void convertFhir(File mappingFile, File igDirectory, File sourceFh } } - private static void loadIG(File igDirectory) throws IOException { + static void loadIG(File igDirectory) throws IOException { File[] artifacts = igDirectory.listFiles(); for (File artifact : artifacts) { @@ -221,6 +223,6 @@ private static boolean isDirEmpty(final Path directory) throws IOException { } private static void usage() { - System.out.println("Usage: run_flexporter -m MAPPING_FILE -s SOURCE_FHIR [-i IG_FOLDER]"); + System.out.println("Usage: run_flexporter -fm MAPPING_FILE -s SOURCE_FHIR [-ig IG_FOLDER]"); } } diff --git a/src/main/java/org/mitre/synthea/export/Exporter.java b/src/main/java/org/mitre/synthea/export/Exporter.java index 514fa3e633..74f7a31658 100644 --- a/src/main/java/org/mitre/synthea/export/Exporter.java +++ b/src/main/java/org/mitre/synthea/export/Exporter.java @@ -84,6 +84,7 @@ public ExporterRuntimeOptions(ExporterRuntimeOptions init) { terminologyService = init.terminologyService; recordQueue = init.recordQueue; fhirVersion = init.fhirVersion; + flexporterMappings=init.flexporterMappings; } /** @@ -121,6 +122,14 @@ public String getNextRecord() throws InterruptedException { public boolean isRecordQueueEmpty() { return recordQueue == null || recordQueue.size() == 0; } + + public void addFlexporterMapping(Mapping mapping) { + if (this.flexporterMappings == null) { + this.flexporterMappings = new LinkedList<>(); + } + + this.flexporterMappings.add(mapping); + } } /** diff --git a/src/main/java/org/mitre/synthea/export/flexporter/Actions.java b/src/main/java/org/mitre/synthea/export/flexporter/Actions.java index 7cceed71f4..7b0a00cb0c 100644 --- a/src/main/java/org/mitre/synthea/export/flexporter/Actions.java +++ b/src/main/java/org/mitre/synthea/export/flexporter/Actions.java @@ -192,7 +192,7 @@ private static Map createFhirPathMapping(List) { - System.out.println("breakpoint me"); + // TODO } // TODO: consider a "skip-resource-if-null" kind of thing From b838038ced19626b7a6317c2e4323f7739f9c0c6 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Thu, 4 Aug 2022 12:51:35 -0400 Subject: [PATCH 09/78] add some sample flxporter mappings --- src/test/resources/flexporter/mcode.yml | 60 +++++++++++++++++++ .../resources/flexporter/qicore_minimal.yaml | 60 +++++++++++++++++++ .../resources/flexporter/test_mapping.yaml | 46 +++++++------- 3 files changed, 144 insertions(+), 22 deletions(-) create mode 100644 src/test/resources/flexporter/mcode.yml create mode 100644 src/test/resources/flexporter/qicore_minimal.yaml diff --git a/src/test/resources/flexporter/mcode.yml b/src/test/resources/flexporter/mcode.yml new file mode 100644 index 0000000000..0b30cc7fa5 --- /dev/null +++ b/src/test/resources/flexporter/mcode.yml @@ -0,0 +1,60 @@ +--- +# name is just a friendly name for this mapping +name: mCODE Flexporter Test + +# applicability determines whether this mapping applies to a given file. +# for now the assumption is 1 file = 1 synthea patient bundle. +applicability: true +# for real mCODE: +# In FHIR terms, these are patients who have a Condition where +# Condition.code is a member of the value set [PrimaryOrUncertainBehaviorCancerDisorderVS] +# and +# Condition.verificationStatus is confirmed. +# -- https://build.fhir.org/ig/HL7/fhir-mCODE-ig/conformance-patients.html + + +# reminder - the fhir_mapper for Synthea->mCODE 1.0 is here: +# https://github.com/standardhealth/fhir-mapper/blob/mcode1/src/mapping/mappers/SyntheaToV10.js + +actions: + - name: Apply Profiles + # v1: define specific profiles and an applicability statement on when to apply them + # v1.1: allow specifying a field from the profile to key off of (ex. mCode TNMPrimaryTumorCategory.code) + # maybe v2 will automatically infer? + # some of the challenges to keep in mind: + # - what if the resource doesn't conform to the profile yet? + # we should make sure we can take other actions before applying profiles, + # or manually specify where to apply profiles so that we can apply other fixes based on profile later. + profiles: + - profile: http://hl7.org/fhir/us/mcode/StructureDefinition/mcode-cancer-patient + applicability: Patient + + - profile: http://example.com/bloodpressure + applicability: Observation.code.coding.where($this.code = '85354-9') + + - profile: http://hl7.org/fhir/us/mcode/StructureDefinition/mcode-tnm-clinical-stage-group + applicability: Observation.code.coding.where($this.code = '21908-9') + + - profile: http://hl7.org/fhir/us/mcode/StructureDefinition/mcode-tnm-clinical-primary-tumor-category + applicability: Observation.code.coding.where($this.code = '21905-5') + + - profile: http://hl7.org/fhir/us/mcode/StructureDefinition/mcode-tnm-clinical-regional-nodes-category + applicability: Observation.code.coding.where($this.code = '21906-3') + + - profile: http://hl7.org/fhir/us/mcode/StructureDefinition/mcode-tnm-clinical-distant-metastases-category + applicability: Observation.code.coding.where($this.code = '21907-1') + + + - name: Create TNM References + set_values: + # TODO: make applicability optionally a list + # because sometimes it will be easier/cleaner to define 2 separate fhirpaths than make 1 complex one or duplicate an action here + - applicability: Observation.code.coding.where($this.code = '21908-9') + fields: + - location: Observation.hasMember.where(display='Tumor Category').reference + value: $findRef([Observation.code.coding.where($this.code = '21905-5')]) + - location: Observation.hasMember.where(display='Nodes Category').reference + value: $findRef([Observation.code.coding.where($this.code = '21906-3')]) + - location: Observation.hasMember.where(display='Metastases Category').reference + value: $findRef([Observation.code.coding.where($this.code = '21907-1')]) + diff --git a/src/test/resources/flexporter/qicore_minimal.yaml b/src/test/resources/flexporter/qicore_minimal.yaml new file mode 100644 index 0000000000..b7498614c9 --- /dev/null +++ b/src/test/resources/flexporter/qicore_minimal.yaml @@ -0,0 +1,60 @@ +--- +# name is just a friendly name for this mapping +name: QI Core Minimal + +# applicability determines whether this mapping applies to a given file. +# for now the assumption is 1 file = 1 synthea patient bundle. +applicability: true + +actions: + - name: Apply Profiles + # v1: define specific profiles and an applicability statement on when to apply them + # v1.1: allow specifying a field from the profile to key off of (ex. mCode TNMPrimaryTumorCategory.code) + # maybe v2 will automatically infer? + # some of the challenges to keep in mind: + # - what if the resource doesn't conform to the profile yet? + # we should make sure we can take other actions before applying profiles, + # or manually specify where to apply profiles so that we can apply other fixes based on profile later. + profiles: + - profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient + applicability: Patient + - profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter + applicability: Encounter + - profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-condition + applicability: Condition + - profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation + applicability: Observation + - profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-procedure + applicability: Procedure + - profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-medicationrequest + applicability: MedicationRequest + - profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-immunization + applicability: Immunization + - profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-careplan + applicability: CarePlan + - profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-imagingstudy + applicability: ImagingStudy + - profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-device + applicability: Device + - profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-practitioner + applicability: Practitioner + - profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-allergyintolerance + applicability: AllergyIntolerance + - profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-claim + applicability: Claim + + + + - name: Set Missing Values + set_values: + - applicability: Immunization + fields: + - location: Immunization.recorded + value: $getField([Immunization.occurrence]) + # TODO: occurrence is a choice type, + # it would be nice to put "occurrenceDateTime" here + # since that's what's actually in the JSON + # but that doesn't seem to work with HAPI's FhirPath + + + diff --git a/src/test/resources/flexporter/test_mapping.yaml b/src/test/resources/flexporter/test_mapping.yaml index 8e7f8fc218..91cfa1244d 100644 --- a/src/test/resources/flexporter/test_mapping.yaml +++ b/src/test/resources/flexporter/test_mapping.yaml @@ -76,8 +76,8 @@ actions: - location: Patient.maritalStatus.coding value: system: http://snomedct.io - code: "1100348239483" - display: "Found the one" + code: "36629006" + display: "Legally married (finding)" @@ -105,33 +105,35 @@ actions: value: $getField([Procedure.encounter.reference]) - location: ServiceRequest.subject.reference value: $findRef([Patient]) + # - location: ServiceRequest.code.coding + # value: $getField([Procedure.code.coding]) # <-- STILL WIP - location: ServiceRequest.code.coding - value: $getField([Procedure.code.coding]) # <-- STILL WIP + value: $randomCode([http://hl7.org/fhir/us/mcode/ValueSet/mcode-laterality-vs]) # TODO: is "writeback" the best term here? writeback: - location: Procedure.basedOn.reference value: $setRef([ServiceRequest]) - - name: testCreateResources_getAttribute - create_resource: - - resourceType: Patient - fields: - - location: Patient.name.text - value: $getAttribute([name]) - - location: Patient.name.given - value: $getAttribute([first_name]) - - location: Patient.name.family - value: $getAttribute([last_name]) + # - name: testCreateResources_getAttribute + # create_resource: + # - resourceType: Patient + # fields: + # - location: Patient.name.text + # value: $getAttribute([name]) + # - location: Patient.name.given + # value: $getAttribute([first_name]) + # - location: Patient.name.family + # value: $getAttribute([last_name]) # TODO: on keep/delete, check for references to removed items!! - - name: testKeepResources - keep_resources: - - Patient - - Encounter - - Condition - - - name: testDeleteResources - delete_resources: - - Provenance + # - name: testKeepResources + # keep_resources: + # - Patient + # - Encounter + # - Condition + + # - name: testDeleteResources + # delete_resources: + # - Provenance From 2f631e28fd6c85531457dbf0425c9fbfcbe64113 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Thu, 4 Aug 2022 12:52:15 -0400 Subject: [PATCH 10/78] slight refactor --- .../synthea/export/flexporter/Actions.java | 7 +-- .../export/flexporter/FhirPathUtils.java | 2 + .../synthea/helpers/RandomCodeGenerator.java | 53 +++++++++++++++++-- 3 files changed, 51 insertions(+), 11 deletions(-) diff --git a/src/main/java/org/mitre/synthea/export/flexporter/Actions.java b/src/main/java/org/mitre/synthea/export/flexporter/Actions.java index 7b0a00cb0c..eed6cbd28e 100644 --- a/src/main/java/org/mitre/synthea/export/flexporter/Actions.java +++ b/src/main/java/org/mitre/synthea/export/flexporter/Actions.java @@ -400,13 +400,8 @@ private static String findValues(Bundle bundle, String... args) { } private static Map randomCode(String valueSetUrl) { - Code code = RandomCodeGenerator.getCode(valueSetUrl, (int)(Math.random() * Integer.MAX_VALUE), null); - - Map codeAsMap = new HashMap<>(); - codeAsMap.put("system", code.system); - codeAsMap.put("code", code.code); - codeAsMap.put("display", code.display); + Map codeAsMap = RandomCodeGenerator.getCodeAsMap(valueSetUrl, (int)(Math.random() * Integer.MAX_VALUE)); return codeAsMap; } } diff --git a/src/main/java/org/mitre/synthea/export/flexporter/FhirPathUtils.java b/src/main/java/org/mitre/synthea/export/flexporter/FhirPathUtils.java index c112efc1bc..69e91c1842 100644 --- a/src/main/java/org/mitre/synthea/export/flexporter/FhirPathUtils.java +++ b/src/main/java/org/mitre/synthea/export/flexporter/FhirPathUtils.java @@ -7,6 +7,8 @@ import org.hl7.fhir.r4.model.Base; import org.hl7.fhir.r4.model.BooleanType; import org.hl7.fhir.r4.model.Bundle; +import org.hl7.fhir.r4.model.DateType; +import org.hl7.fhir.r4.model.Patient; import org.hl7.fhir.r4.model.Bundle.BundleEntryComponent; import org.hl7.fhir.r4.model.Resource; import org.hl7.fhir.r4.model.StringType; diff --git a/src/main/java/org/mitre/synthea/helpers/RandomCodeGenerator.java b/src/main/java/org/mitre/synthea/helpers/RandomCodeGenerator.java index dbf66472e5..d7a426bcd8 100644 --- a/src/main/java/org/mitre/synthea/helpers/RandomCodeGenerator.java +++ b/src/main/java/org/mitre/synthea/helpers/RandomCodeGenerator.java @@ -54,10 +54,7 @@ public abstract class RandomCodeGenerator { @SuppressWarnings("unchecked") public static Code getCode(String valueSetUri, long seed, Code code) { if (urlValidator.isValid(valueSetUri)) { - expandValueSet(valueSetUri); - List codes = codeListCache.get(valueSetUri); - int randomIndex = new Random(seed).nextInt(codes.size()); - Map codeMap = (Map) codes.get(randomIndex); + Map codeMap = getCodeAsMap(valueSetUri, seed); validateCode(codeMap); Code newCode = new Code(codeMap.get("system"), codeMap.get("code"), codeMap.get("display")); selectedCodes.add(newCode); @@ -65,7 +62,53 @@ public static Code getCode(String valueSetUri, long seed, Code code) { } return code; } - + + public static Map getCodeAsMap(String valueSetUri, long seed) { + if (urlValidator.isValid(valueSetUri)) { + expandValueSet(valueSetUri); + List codes = codeListCache.get(valueSetUri); + int randomIndex = new Random(seed).nextInt(codes.size()); + Map codeMap = (Map) codes.get(randomIndex); + validateCode(codeMap); + return codeMap; + } + return null; + } + + // TODO: this does not belong here, but this class is where the code cache is + public static boolean codeInValueSet(Code code, String valueSetUri) { + if (urlValidator.isValid(valueSetUri)) { + expandValueSet(valueSetUri); + + // TODO: there has to be a better way to do this + Map codeAsMap = new HashMap<>(); + codeAsMap.put("system", code.system); + codeAsMap.put("code", code.code); + codeAsMap.put("display", code.display); + + List cachedCodeList = codeListCache.get(valueSetUri); + + // this will only return true if everything is exactly identical + // ie, it will not match if display is different + if (cachedCodeList.contains(codeAsMap)) { + return true; + } + + // iterate through all the codes to see if it contains the system/code combo + // TODO: pick better data structures that support this + + for (Object cachedCodeObj : cachedCodeList) { + Map cachedCode = (Map)cachedCodeObj; + + if (cachedCode.get("system").equals(code.system) && cachedCode.get("code").equals(code.code)) { + return true; + } + } + } + // TODO?? + return false; + } + @SuppressWarnings("unchecked") private static synchronized void expandValueSet(String valueSetUri) { if (!codeListCache.containsKey(valueSetUri)) { From d2d636986d3fc88523d886f0ecea2b00d7b89d5c Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Thu, 4 Aug 2022 13:12:39 -0400 Subject: [PATCH 11/78] uncomment pieces of test mapping so unit tests pass --- .../resources/flexporter/test_mapping.yaml | 45 ++++++++++--------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/src/test/resources/flexporter/test_mapping.yaml b/src/test/resources/flexporter/test_mapping.yaml index 91cfa1244d..7acd84cedf 100644 --- a/src/test/resources/flexporter/test_mapping.yaml +++ b/src/test/resources/flexporter/test_mapping.yaml @@ -107,33 +107,36 @@ actions: value: $findRef([Patient]) # - location: ServiceRequest.code.coding # value: $getField([Procedure.code.coding]) # <-- STILL WIP - - location: ServiceRequest.code.coding - value: $randomCode([http://hl7.org/fhir/us/mcode/ValueSet/mcode-laterality-vs]) + + # this works if the VS is loaded but otherwise tries to make a network lookup + # so disable for now + # - location: ServiceRequest.code.coding + # value: $randomCode([http://hl7.org/fhir/us/mcode/ValueSet/mcode-laterality-vs]) # TODO: is "writeback" the best term here? writeback: - location: Procedure.basedOn.reference value: $setRef([ServiceRequest]) - # - name: testCreateResources_getAttribute - # create_resource: - # - resourceType: Patient - # fields: - # - location: Patient.name.text - # value: $getAttribute([name]) - # - location: Patient.name.given - # value: $getAttribute([first_name]) - # - location: Patient.name.family - # value: $getAttribute([last_name]) + - name: testCreateResources_getAttribute + create_resource: + - resourceType: Patient + fields: + - location: Patient.name.text + value: $getAttribute([name]) + - location: Patient.name.given + value: $getAttribute([first_name]) + - location: Patient.name.family + value: $getAttribute([last_name]) # TODO: on keep/delete, check for references to removed items!! - # - name: testKeepResources - # keep_resources: - # - Patient - # - Encounter - # - Condition - - # - name: testDeleteResources - # delete_resources: - # - Provenance + - name: testKeepResources + keep_resources: + - Patient + - Encounter + - Condition + + - name: testDeleteResources + delete_resources: + - Provenance From 2dcd5b2f126d2a764129ecdc9dabdb6ca725abfe Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Thu, 1 Dec 2022 13:47:52 -0500 Subject: [PATCH 12/78] add javascript engine, and ability to set objects in fhirpath resource generator --- build.gradle | 4 + src/main/java/RunFlexporter.java | 3 +- .../org/mitre/synthea/export/Exporter.java | 11 +- .../synthea/export/flexporter/Actions.java | 111 ++++++++++------ .../CustomFHIRPathResourceGeneratorR4.java | 43 +++++-- .../FlexporterJavascriptContext.java | 110 ++++++++++++++++ .../export/flexporter/ActionsTest.java | 120 ++++++++++++++++-- ...CustomFHIRPathResourceGeneratorR4Test.java | 16 +-- .../FlexporterJavaScriptContextTest.java | 64 ++++++++++ .../resources/flexporter/test_mapping.yaml | 41 +++++- 10 files changed, 449 insertions(+), 74 deletions(-) create mode 100644 src/main/java/org/mitre/synthea/export/flexporter/FlexporterJavascriptContext.java create mode 100644 src/test/java/org/mitre/synthea/export/flexporter/FlexporterJavaScriptContextTest.java diff --git a/build.gradle b/build.gradle index d2826621e9..f1ebe6fe90 100644 --- a/build.gradle +++ b/build.gradle @@ -72,6 +72,10 @@ dependencies { // JavaScript engine included for graphviz. It gets used // if someone does not have graphviz installed in their environment implementation 'org.graalvm.js:js:22.2.0' + implementation 'org.graalvm.js:js:22.2.0' + implementation 'org.graalvm.js:js-scriptengine:22.2.0' + implementation 'org.graalvm.sdk:graal-sdk:22.2.0' + // CSV Stuff implementation 'org.apache.commons:commons-csv:1.9.0' implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-csv:2.13.4' diff --git a/src/main/java/RunFlexporter.java b/src/main/java/RunFlexporter.java index 005d838fed..13ae96d36c 100644 --- a/src/main/java/RunFlexporter.java +++ b/src/main/java/RunFlexporter.java @@ -18,6 +18,7 @@ import org.hl7.fhir.r4.model.ValueSet; import org.mitre.synthea.export.flexporter.Actions; import org.mitre.synthea.export.flexporter.FhirPathUtils; +import org.mitre.synthea.export.flexporter.FlexporterJavascriptContext; import org.mitre.synthea.export.flexporter.Mapping; import org.mitre.synthea.helpers.RandomCodeGenerator; @@ -211,7 +212,7 @@ static void loadIG(File igDirectory) throws IOException { public static Bundle convertFhir(Bundle bundle, Mapping mapping) { - Actions.applyMapping(bundle, mapping, null); + Actions.applyMapping(bundle, mapping, null, new FlexporterJavascriptContext()); return bundle; } diff --git a/src/main/java/org/mitre/synthea/export/Exporter.java b/src/main/java/org/mitre/synthea/export/Exporter.java index 74f7a31658..0bd11744f6 100644 --- a/src/main/java/org/mitre/synthea/export/Exporter.java +++ b/src/main/java/org/mitre/synthea/export/Exporter.java @@ -19,11 +19,17 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.LinkedBlockingQueue; import java.util.function.Predicate; + +import javax.script.Invocable; +import javax.script.ScriptEngine; +import javax.script.ScriptEngineManager; + import org.apache.commons.lang3.tuple.ImmutablePair; import org.apache.commons.lang3.tuple.Pair; import org.mitre.synthea.engine.Generator; import org.mitre.synthea.export.flexporter.Actions; +import org.mitre.synthea.export.flexporter.FlexporterJavascriptContext; import org.mitre.synthea.export.flexporter.Mapping; import org.mitre.synthea.export.rif.BB2RIFExporter; import org.mitre.synthea.helpers.Config; @@ -241,9 +247,12 @@ private static boolean exportRecord(Person person, String fileTag, long stopTime org.hl7.fhir.r4.model.Bundle bundle = FhirR4.convertToFHIR(person, stopTime); if (options.flexporterMappings != null) { + + FlexporterJavascriptContext fjContext = new FlexporterJavascriptContext(); + for (Mapping mapping : options.flexporterMappings) { // flexport on the bundle here - Actions.applyMapping(bundle, mapping, person); + Actions.applyMapping(bundle, mapping, person, fjContext); } } diff --git a/src/main/java/org/mitre/synthea/export/flexporter/Actions.java b/src/main/java/org/mitre/synthea/export/flexporter/Actions.java index eed6cbd28e..22a1decbdd 100644 --- a/src/main/java/org/mitre/synthea/export/flexporter/Actions.java +++ b/src/main/java/org/mitre/synthea/export/flexporter/Actions.java @@ -20,31 +20,46 @@ import org.hl7.fhir.r4.model.Resource; import org.mitre.synthea.helpers.RandomCodeGenerator; import org.mitre.synthea.world.agents.Person; -import org.mitre.synthea.world.concepts.HealthRecord.Code; + +import ca.uhn.fhir.parser.IParser; // For now @SuppressWarnings("unchecked") public abstract class Actions { - public static void applyMapping(Bundle bundle, Mapping mapping, Person person) { - mapping.actions.forEach(action -> applyAction(bundle, action, person)); + public static Bundle applyMapping(Bundle bundle, Mapping mapping, Person person, FlexporterJavascriptContext fjContext) { + + for (Map action : mapping.actions) { + bundle = applyAction(bundle, action, person, fjContext); + } + + return bundle; } - public static void applyAction(Bundle bundle, Map action, Person person) { + public static Bundle applyAction(Bundle bundle, Map action, Person person, FlexporterJavascriptContext fjContext) { // TODO: this could be handled better but for now just key off a specific field in the action + Bundle returnBundle = bundle; + // most actions modify the bundle in-place, but some might return a whole new one + if (action.containsKey("profiles")) { applyProfiles(bundle, (List>) action.get("profiles")); } else if (action.containsKey("set_values")) { - setValues(bundle, (List>) action.get("set_values"), person); + setValues(bundle, (List>) action.get("set_values"), person, fjContext); } else if (action.containsKey("keep_resources")) { keepResources(bundle, (List) action.get("keep_resources")); } else if (action.containsKey("delete_resources")) { deleteResources(bundle, (List) action.get("delete_resources")); } else if (action.containsKey("create_resource")) { - createResource(bundle, (List>) action.get("create_resource"), person); + createResource(bundle, (List>) action.get("create_resource"), person, null); + } else if (action.containsKey("create_resource_js")) { + createResource(bundle, (List>) action.get("create_resource_js"), person, fjContext); + } else if (action.containsKey("execute_script")) { + returnBundle = executeScript((List>)action.get("execute_script"), bundle, fjContext); } + + return returnBundle; } @@ -76,7 +91,7 @@ private static void applyProfile(Resource resource, String profileURL) { } } - public static void setValues(Bundle bundle, List> items, Person person) { + public static void setValues(Bundle bundle, List> items, Person person, FlexporterJavascriptContext fjContext) { for (Map entry : items) { String applicability = (String) entry.get("applicability"); List> fields = (List>) entry.get("fields"); @@ -85,8 +100,8 @@ public static void setValues(Bundle bundle, List> items, Per for (Base match : matchingResources) { if (match instanceof Resource) { - Map fhirPathMapping = - createFhirPathMapping(fields, bundle, (Resource) match, person); + Map fhirPathMapping = + createFhirPathMapping(fields, bundle, (Resource) match, person, fjContext); CustomFHIRPathResourceGeneratorR4 fhirPathgenerator = new CustomFHIRPathResourceGeneratorR4<>(FhirPathUtils.FHIR_CTX); @@ -101,7 +116,7 @@ public static void setValues(Bundle bundle, List> items, Per public static void createResource(Bundle bundle, List> resourcesToCreate, - Person person) { + Person person, FlexporterJavascriptContext fjContext) { // TODO: this is fundamentally similar to setValues, so extract common logic for (Map newResourceDef : resourcesToCreate) { @@ -128,8 +143,8 @@ public static void createResource(Bundle bundle, List> resou for (Base basedOnItem : basedOnResources) { // IMPORTANT: basedOnItem may be null - Map fhirPathMapping = - createFhirPathMapping(fields, bundle, (Resource) basedOnItem, person); + Map fhirPathMapping = + createFhirPathMapping(fields, bundle, (Resource) basedOnItem, person, fjContext); CustomFHIRPathResourceGeneratorR4 fhirPathgenerator = new CustomFHIRPathResourceGeneratorR4<>(FhirPathUtils.FHIR_CTX); @@ -158,8 +173,8 @@ public static void createResource(Bundle bundle, List> resou } if (writeback != null && !writeback.isEmpty()) { - Map writebackMapping = - createFhirPathMapping(writeback, bundle, createdResource, person); + Map writebackMapping = + createFhirPathMapping(writeback, bundle, createdResource, person, fjContext); CustomFHIRPathResourceGeneratorR4 writebackGenerator = new CustomFHIRPathResourceGeneratorR4<>(FhirPathUtils.FHIR_CTX); @@ -173,9 +188,9 @@ public static void createResource(Bundle bundle, List> resou } - private static Map createFhirPathMapping(List> fields, - Bundle sourceBundle, Resource sourceResource, Person person) { - Map fhirPathMapping = new HashMap<>(); + private static Map createFhirPathMapping(List> fields, + Bundle sourceBundle, Resource sourceResource, Person person, FlexporterJavascriptContext fjContext) { + Map fhirPathMapping = new HashMap<>(); for (Map field : fields) { String location = (String)field.get("location"); @@ -188,7 +203,7 @@ private static Map createFhirPathMapping(List) { @@ -229,25 +244,11 @@ private static Map createFhirPathMapping(List - // and plug it into the fhirpath mapping as above - - // note that hapi has strange internal state, - // ex a CodeableConcept.coding.system is a string, - // but internally represented as an object with multiple fields - // "myStringValue", "myCoercedValue", "disallowExtensions" - // so a trivial Gson conversion is out - - // ideally we'd be able to find the right setter function - // and set it on the target directly - // TODO - - System.err.println("FHIR Types not yet handled in createFhirPathMapping: " + valueDef.getClass()); - - + // we plucked a full FHIR object from somewhere + fhirPathMapping.put(location, valueDef); + } else { - // + // unexpected type here - is it even possible to get anything else? System.err.println("Unhandled type in createFhirPathMapping: " + valueDef.getClass()); } } @@ -302,9 +303,41 @@ public static void deleteResources(Bundle bundle, List list) { // TODO: additional passes for deleted resource IDs } + private static Bundle executeScript(List> fields, Bundle bundle, FlexporterJavascriptContext fjContext) { + IParser parser = FhirPathUtils.FHIR_CTX.newJsonParser(); + + String bundleJson = parser.encodeResourceToString(bundle); + + fjContext.loadBundle(bundleJson); + + for (Map scriptDef : fields) { + + String function = scriptDef.get("function"); + String functionName = scriptDef.get("function_name"); + String applyTo = scriptDef.get("apply_to"); + + fjContext.loadFunction(function); + + if (applyTo.equalsIgnoreCase("bundle")) { + fjContext.applyFunctionToBundle(functionName); + } else if (applyTo.equalsIgnoreCase("resource") || applyTo.equalsIgnoreCase("resources")) { + fjContext.applyFunctionToResources(functionName); + } else { + throw new IllegalArgumentException("Unknown option for execute_script.apply_to: '" + applyTo + + "'. Valid options are 'bundle' and 'resources'"); + } + } + + String outBundleJson = fjContext.getBundle(); + + Bundle newBundle = parser.parseResource(Bundle.class, outBundleJson); + + return newBundle; + } + private static Object getValue(Bundle bundle, String valueDef, Resource currentResource, - Person person) { + Person person, FlexporterJavascriptContext fjContext) { // The flag has the format of $flagName([flagValue1, flagValue2, ..., flagValueN]) String flag = StringUtils.substringBetween(valueDef, "$", "("); @@ -318,7 +351,7 @@ private static Object getValue(Bundle bundle, String valueDef, Resource currentR if (flag.equals("setRef")) { return setReference(currentResource, flagValues); } else if (flag.equals("getField")) { - return getField(currentResource, flagValues); + return getField(currentResource, fjContext, flagValues); } else if (flag.equals("findRef")) { return findReference(bundle, flagValues); } else if (flag.equals("findValue")) { @@ -361,7 +394,7 @@ private static String createReference(Resource resource) { return resource.getResourceType().toString() + "/" + id; } - private static Base getField(Resource currentResource, String... args) { + private static Object getField(Resource currentResource, FlexporterJavascriptContext fjContext, String... args) { // args[0] = FHIRPath, from this resource // args[1] = how to disambiguate if there are multiple? TODO diff --git a/src/main/java/org/mitre/synthea/export/flexporter/CustomFHIRPathResourceGeneratorR4.java b/src/main/java/org/mitre/synthea/export/flexporter/CustomFHIRPathResourceGeneratorR4.java index a2ef913ba3..cf3afef2ac 100644 --- a/src/main/java/org/mitre/synthea/export/flexporter/CustomFHIRPathResourceGeneratorR4.java +++ b/src/main/java/org/mitre/synthea/export/flexporter/CustomFHIRPathResourceGeneratorR4.java @@ -15,6 +15,7 @@ import org.hl7.fhir.r4.model.ExpressionNode.Kind; import org.hl7.fhir.r4.model.Resource; +import ca.uhn.fhir.context.BaseRuntimeChildDatatypeDefinition; import ca.uhn.fhir.context.BaseRuntimeChildDefinition; import ca.uhn.fhir.context.BaseRuntimeElementDefinition; import ca.uhn.fhir.context.FhirContext; @@ -48,10 +49,10 @@ public class CustomFHIRPathResourceGeneratorR4 { private FhirContext ctx; private FHIRPathEngine engine; - private Map pathMapping; + private Map pathMapping; private T resource = null; - private String valueToSet = null; + private Object valueToSet = null; private Stack nodeStack = null; /** @@ -86,7 +87,7 @@ public CustomFHIRPathResourceGeneratorR4() { public CustomFHIRPathResourceGeneratorR4(FhirContext fhirCtx) { this.ctx = fhirCtx; - this.pathMapping = new HashMap(); + this.pathMapping = new HashMap(); this.engine = new FHIRPathEngine(new HapiWorkerContext(ctx, ctx.getValidationSupport())); } @@ -96,7 +97,7 @@ public CustomFHIRPathResourceGeneratorR4(FhirContext fhirCtx) { * @param mapping Map<String, String> a mapping of FHIRPath to value Strings that will be used to * create a Resource. */ - public void setMapping(Map mapping) { + public void setMapping(Map mapping) { this.pathMapping = mapping; } @@ -278,7 +279,7 @@ private void handlePrimitiveNode(ExpressionNode fhirPath) { } else { primitive = primitiveTarget.newInstance(nextTier.childDefinition.getInstanceConstructorArguments()); - primitive.setValueAsString(this.valueToSet); + primitive.setValueAsString(String.valueOf(this.valueToSet)); nextTier.childDefinition.getMutator().addValue(nodeElement, primitive); } @@ -311,16 +312,30 @@ private void handleCompositeNode(ExpressionNode fhirPath) { // iterate through all parent nodes for (IBase nodeElement : this.nodeStack.peek().nodes) { List containedNodes = nextTier.childDefinition.getAccessor().getValues(nodeElement); - if (containedNodes.size() > 0) { - // check if sister nodes are already available - nextTier.nodes.addAll(containedNodes); - } else { - // if not nodes are available, create a new node - ICompositeType compositeNode = - compositeTarget.newInstance(nextTier.childDefinition.getInstanceConstructorArguments()); - nextTier.childDefinition.getMutator().addValue(nodeElement, compositeNode); - nextTier.nodes.add(compositeNode); + + if (nextTier.childDefinition instanceof BaseRuntimeChildDatatypeDefinition + && ((BaseRuntimeChildDatatypeDefinition) nextTier.childDefinition).getDatatype().isInstance(this.valueToSet)) { + + // this enables us to work with objects that are not trivially strings, ex CodeableConcepts + + // TODO: are there any other implications to this? + nextTier.childDefinition.getMutator().setValue(nodeElement, (IBase)this.valueToSet); + + } else { + if (containedNodes.size() > 0) { + // check if sister nodes are already available + nextTier.nodes.addAll(containedNodes); + } else { + // if not nodes are available, create a new node + ICompositeType compositeNode = + compositeTarget.newInstance(nextTier.childDefinition.getInstanceConstructorArguments()); + nextTier.childDefinition.getMutator().addValue(nodeElement, compositeNode); + nextTier.nodes.add(compositeNode); + } + } + + } // push the created nextTier to the nodeStack this.nodeStack.push(nextTier); diff --git a/src/main/java/org/mitre/synthea/export/flexporter/FlexporterJavascriptContext.java b/src/main/java/org/mitre/synthea/export/flexporter/FlexporterJavascriptContext.java new file mode 100644 index 0000000000..3749cc16ce --- /dev/null +++ b/src/main/java/org/mitre/synthea/export/flexporter/FlexporterJavascriptContext.java @@ -0,0 +1,110 @@ +package org.mitre.synthea.export.flexporter; + +import java.io.IOException; +import java.net.URL; + +import org.graalvm.polyglot.Context; +import org.graalvm.polyglot.Source; +import org.graalvm.polyglot.Value; + +public class FlexporterJavascriptContext { + private final Context CONTEXT; + + private Value workingBundleAsJSObject; + + public FlexporterJavascriptContext() { + CONTEXT = Context.create("js"); + // TODO: if we want to add custom libraries like fhirpath or fhir-mapper, do it here +// try { +// +// for (String filename : Arrays.asList("fhirpath.js", "fhir-mapper.js") ) { +// String fileText = Files.readString(Path.of()); +// loadFunction(fileText); +// +// +// loadFile(filename); +// } +// System.out.println("All functions available from Java (as loaded into Bindings) " +// + CONTEXT.getBindings("js").getMemberKeys()); +// } catch (Exception e) { +// e.printStackTrace(); +// } + } + + public void loadFile(String filename) throws IOException { + + URL url = FlexporterJavascriptContext.class.getClassLoader().getResource("./lib/"+filename); + + CONTEXT.eval(Source.newBuilder("js", url).build()); + } + + public void loadFunction(String functionDef) { + CONTEXT.eval("js", functionDef); + } + + public void loadBundle(String bundleAsString) { + // workingBundleAsJSObject = JSON.parse(bundleAsString) + + Value parseFn = CONTEXT.eval("js","(bundleString) => JSON.parse(bundleString)"); + + workingBundleAsJSObject = parseFn.execute(bundleAsString); + } + + public String getBundle() { + // return JSON.stringify(workingBundleAsJSObject) + + Value stringifyFn = CONTEXT.eval("js","(bundle) => JSON.stringify(bundle)"); + + String bundleString = stringifyFn.execute(workingBundleAsJSObject).asString(); + + return bundleString; + } + + public void applyFunctionToBundle(String fnName) { + // assumption is the fn has already been loaded by loadFunction + // good news -- based on testing, if the bundle is modified in-place in the JS context then our variable "sees" those updates + // (the variable maintains a reference to the object within the JS VM) + + Value applyFn = CONTEXT.getBindings("js").getMember(fnName); + applyFn.execute(workingBundleAsJSObject); + } + + public void applyFunctionToResources(String fnName) { + // assumption is the fn has already been loaded by loadFunction + + Value applyFn = CONTEXT.getBindings("js").getMember(fnName); + + Value entries = workingBundleAsJSObject.getMember("entry"); + + for (int i = 0 ; i < entries.getArraySize() ; i++) { + Value entry = entries.getArrayElement(i); + + Value resource = entry.getMember("resource"); + + // provide both the resource and the full bundle for context + // (eg, so we can create references to other resources) + applyFn.execute(resource, workingBundleAsJSObject); + } + } + + public String exec(String fnName, String... args) { + Value applyFn = CONTEXT.getBindings("js").getMember(fnName); + Value processedJson = applyFn.execute((Object[])args); + + + Value applyFn2 = CONTEXT.getBindings("js").getMember("getField2"); + + Value result2 = applyFn2.execute(processedJson); + + return result2.asString(); + } + + public String applyTransforms(String fhirJson) { + Value applyFn = CONTEXT.getBindings("js").getMember("apply"); + Value processedJson = applyFn.execute(fhirJson); + + String result = processedJson.asString(); + + return result; + } +} diff --git a/src/test/java/org/mitre/synthea/export/flexporter/ActionsTest.java b/src/test/java/org/mitre/synthea/export/flexporter/ActionsTest.java index 1037bcc0e3..92375e260f 100644 --- a/src/test/java/org/mitre/synthea/export/flexporter/ActionsTest.java +++ b/src/test/java/org/mitre/synthea/export/flexporter/ActionsTest.java @@ -154,7 +154,7 @@ public void testSetValues() { Map action = getActionByName("testSetValues"); - Actions.applyAction(b, action, null); + Actions.applyAction(b, action, null, null); assertEquals("1987-06-05", p.getBirthDateElement().getValueAsString()); } @@ -173,7 +173,7 @@ public void testSetValues_getField() { Map action = getActionByName("testSetValues_getField"); - Actions.applyAction(b, action, null); + Actions.applyAction(b, action, null, null); assertEquals("2022-02-22", i.getRecordedElement().getValueAsString()); } @@ -191,7 +191,7 @@ public void testSetValues_overwrite() { Map action = getActionByName("testSetValues_overwrite"); - Actions.applyAction(b, action, null); + Actions.applyAction(b, action, null, null); Type effective = o.getEffective(); @@ -215,7 +215,7 @@ public void testSetValues_transform() { Map action = getActionByName("testSetValues_transform"); - Actions.applyAction(b, action, null); + Actions.applyAction(b, action, null, null); // NOTE: this expected value may change if we ever add randomness to the date -> dateTime // transform @@ -233,7 +233,7 @@ public void testSetValues_object() { Map action = getActionByName("testSetValues_object"); - Actions.applyAction(b, action, null); + Actions.applyAction(b, action, null, null); System.out.println(b); } @@ -245,7 +245,7 @@ public void testKeepResources() throws Exception { Map action = getActionByName("testKeepResources"); - Actions.applyAction(b, action, null); + Actions.applyAction(b, action, null, null); Set expectedResourceTypes = new HashSet<>(Arrays.asList("Patient", "Encounter", "Condition")); @@ -268,7 +268,7 @@ public void testDeleteResources() throws Exception { assertEquals(1, countProvenance); Map action = getActionByName("testDeleteResources"); - Actions.applyAction(b, action, null); + Actions.applyAction(b, action, null, null); countProvenance = b.getEntry().stream() .filter(bec -> bec.getResource().getResourceType() == ResourceType.Provenance).count(); @@ -288,7 +288,7 @@ public void testCreateResources_createSingle() throws Exception { Map action = getActionByName("testCreateResources_createSingle"); - Actions.applyAction(b, action, null); + Actions.applyAction(b, action, null, null); List serviceRequests = b.getEntry().stream() .filter(bec -> bec.getResource().getResourceType() == ResourceType.ServiceRequest) @@ -307,6 +307,105 @@ public void testCreateResources_createSingle() throws Exception { assertEquals(p.getId(), createdSR.getSubject().getReference()); } + @Test + public void testExec() throws Exception { + Map action = getActionByName("testExecuteScript"); + + Patient p = new Patient(); + p.addName().addGiven("Cristina").setFamily("Crimson"); + DateType date = new DateType(); + date.fromStringValue("1999-09-29"); + p.setBirthDateElement(date); + + Bundle b = new Bundle(); + b.addEntry().setResource(p); + + Bundle updatedBundle = Actions.applyAction(b, action, null, new FlexporterJavascriptContext()); + + /* + function apply(bundle) { + bundle['entry'][0]['resource']['meta'] = {profile: ['http://example.com/dummy-profile']} + } + + function apply2(resource, bundle) { + if (resource.resourceType == 'Patient') { + resource.birthDate = '2022-02-22'; + } + } + + */ + + Patient outPatient = (Patient) updatedBundle.getEntryFirstRep().getResource(); + + assertEquals("http://example.com/dummy-profile", outPatient.getMeta().getProfile().get(0).getValueAsString()); + + assertEquals("2022-02-22", outPatient.getBirthDateElement().getValueAsString()); + } + + @Test + public void testTiming() throws Exception { + int NUM_TESTS = 10; + Bundle[] testBundles = new Bundle[NUM_TESTS]; + + for (int i = 0 ; i < NUM_TESTS ; i++) { + testBundles[i] = loadFixtureBundle("sample_complete_patient.json"); + } + + Map action = getActionByName("testCreateResources_createBasedOn"); + long start = System.currentTimeMillis(); + for (int i = 0 ; i < NUM_TESTS ; i++) { + Actions.applyAction(testBundles[i], action, null, null); + } + long elapsed = System.currentTimeMillis() - start; + + System.out.println("Completed " + NUM_TESTS + " pre-warmup Pure Java runs in " + elapsed + " ms."); + + for (int i = 0 ; i < NUM_TESTS ; i++) { + testBundles[i] = loadFixtureBundle("sample_complete_patient.json"); + } + + + start = System.currentTimeMillis(); + for (int i = 0 ; i < NUM_TESTS ; i++) { + Actions.applyAction(testBundles[i], action, null, null); + } + elapsed = System.currentTimeMillis() - start; + + System.out.println("Completed " + NUM_TESTS + " Pure Java runs in " + elapsed + " ms."); + + + action = getActionByName("testCreateResources_createBasedOn_JS"); + + for (int i = 0 ; i < NUM_TESTS ; i++) { + testBundles[i] = loadFixtureBundle("sample_complete_patient.json"); + } + + FlexporterJavascriptContext fjContext = new FlexporterJavascriptContext(); + fjContext.loadFunction("function getField(resourceString, fhirPath) {\n" + + " const resource = JSON.parse(resourceString);\n" + + " const value = evaluate(resource, fhirPath);\n" + + "\n" + + " if (!Array.isArray(value) || !value.length) {\n" + + " // array does not exist, is not an array, or is empty\n" + + " // ⇒ do not attempt to process array\n" + + " return null;\n" + + " }\n" + + "\n" + + " return value[0];\n" + + "}"); + + + start = System.currentTimeMillis(); + for (int i = 0 ; i < NUM_TESTS ; i++) { + Actions.applyAction(testBundles[i], action, null, fjContext); + } + elapsed = System.currentTimeMillis() - start; + + System.out.println("Completed " + NUM_TESTS + " blended JavaScript runs in " + elapsed + " ms."); + + } + + @Test public void testCreateResources_createBasedOn() throws Exception { Bundle b = loadFixtureBundle("sample_complete_patient.json"); @@ -324,7 +423,7 @@ public void testCreateResources_createBasedOn() throws Exception { Map action = getActionByName("testCreateResources_createBasedOn"); - Actions.applyAction(b, action, null); + Actions.applyAction(b, action, null, null); // there should now be one ServiceRequest per Procedure @@ -349,6 +448,7 @@ public void testCreateResources_createBasedOn() throws Exception { assertEquals("plan", sr.getIntent().toCode()); assertEquals(patientId, sr.getSubject().getReference()); assertEquals(proc.getEncounter().getReference(), sr.getEncounter().getReference()); + assertTrue(proc.getCode().equalsDeep(sr.getCode())); } // we removed each SR as we checked it, to ensure there are none left @@ -369,7 +469,7 @@ public void testGetAttribute() throws Exception { p.attributes.put(Person.NAME, firstName + " " + lastName); Map action = getActionByName("testCreateResources_getAttribute"); - Actions.applyAction(b, action, p); + Actions.applyAction(b, action, p, null); Patient patient = (Patient) b.getEntryFirstRep().getResource(); HumanName name = patient.getNameFirstRep(); diff --git a/src/test/java/org/mitre/synthea/export/flexporter/CustomFHIRPathResourceGeneratorR4Test.java b/src/test/java/org/mitre/synthea/export/flexporter/CustomFHIRPathResourceGeneratorR4Test.java index 0638985935..a9aee728ab 100644 --- a/src/test/java/org/mitre/synthea/export/flexporter/CustomFHIRPathResourceGeneratorR4Test.java +++ b/src/test/java/org/mitre/synthea/export/flexporter/CustomFHIRPathResourceGeneratorR4Test.java @@ -32,14 +32,14 @@ private static void logPatientJson(Patient p) { System.out.println(patientJson); } - private Patient createPatient(Map fhirPathMapping) { + private Patient createPatient(Map fhirPathMapping) { CustomFHIRPathResourceGeneratorR4 fhirPathGenerator = new CustomFHIRPathResourceGeneratorR4<>(CTX); fhirPathGenerator.setMapping(fhirPathMapping); return fhirPathGenerator.generateResource(Patient.class); } - private void updatePatient(Patient p, Map fhirPathMapping) { + private void updatePatient(Patient p, Map fhirPathMapping) { CustomFHIRPathResourceGeneratorR4 fhirPathGenerator = new CustomFHIRPathResourceGeneratorR4<>(CTX); fhirPathGenerator.setResource(p); @@ -49,7 +49,7 @@ private void updatePatient(Patient p, Map fhirPathMapping) { @Test public void testSimpleField() { - Map fhirPathMapping = new HashMap<>(); + Map fhirPathMapping = new HashMap<>(); fhirPathMapping.put("Patient.deceasedBoolean", "false"); Patient patient = createPatient(fhirPathMapping); @@ -58,7 +58,7 @@ public void testSimpleField() { @Test public void testArray1() { - Map fhirPathMapping = new HashMap<>(); + Map fhirPathMapping = new HashMap<>(); fhirPathMapping.put("Patient.name.given[0]", "Billy"); fhirPathMapping.put("Patient.name.given[1]", "Bob"); @@ -76,7 +76,7 @@ public void testArray1() { @Ignore @Test public void testArray2() { - Map fhirPathMapping = new HashMap<>(); + Map fhirPathMapping = new HashMap<>(); fhirPathMapping.put("Patient.name[0].given", "Billy"); fhirPathMapping.put("Patient.name[1].given", "Bob"); @@ -97,7 +97,7 @@ public void testArray2() { @Test public void testArray3() { - Map fhirPathMapping = new HashMap<>(); + Map fhirPathMapping = new HashMap<>(); fhirPathMapping.put("Patient.name.where(use='official').given", "Billy"); fhirPathMapping.put("Patient.name.where(use='usual').given", "Bob"); @@ -127,7 +127,7 @@ public void testArray3() { @Test public void testExtension() { - Map fhirPathMapping = new HashMap<>(); + Map fhirPathMapping = new HashMap<>(); fhirPathMapping.put( "Patient.extension.where(url='http://hl7.org/fhir/StructureDefinition/patient-mothersMaidenName').valueString", "Donita707 Langosh790"); @@ -164,7 +164,7 @@ public void testExtension() { @Test public void testExtensionOnPrimitive() { - Map fhirPathMapping = new HashMap<>(); + Map fhirPathMapping = new HashMap<>(); // fhirPathMapping.put("Patient.birthDate", "2021-12-15"); fhirPathMapping.put( diff --git a/src/test/java/org/mitre/synthea/export/flexporter/FlexporterJavaScriptContextTest.java b/src/test/java/org/mitre/synthea/export/flexporter/FlexporterJavaScriptContextTest.java new file mode 100644 index 0000000000..4e2ad8c089 --- /dev/null +++ b/src/test/java/org/mitre/synthea/export/flexporter/FlexporterJavaScriptContextTest.java @@ -0,0 +1,64 @@ +package org.mitre.synthea.export.flexporter; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import org.hl7.fhir.r4.model.Bundle; +import org.hl7.fhir.r4.model.DateType; +import org.hl7.fhir.r4.model.DomainResource; +import org.hl7.fhir.r4.model.Patient; +import org.junit.Test; + +import ca.uhn.fhir.parser.IParser; + +public class FlexporterJavaScriptContextTest { + + + @Test + public void testJavascriptContext() { + FlexporterJavascriptContext context = new FlexporterJavascriptContext(); + + context.loadFunction("function applySomeProfile(resource) {\n" + + " resource['meta'] = {profile: [\"http://example.com/random-profile\"]}\n" + + "}"); + + context.loadFunction("function giveEveryResourceSomeText(bundle) {\n" + + " bundle.entry.forEach(e => e.resource.text = {\n" + + " \"status\": \"generated\",\n" + + " \"div\": \"
javascript was here
\"\n" + + " });\n" + + "}"); + + + Patient p = new Patient(); + p.addName().addGiven("Alex").setFamily("Aquamarine"); + DateType date = new DateType(); + date.fromStringValue("1999-09-29"); + p.setBirthDateElement(date); + + Bundle b = new Bundle(); + b.addEntry().setResource(p); + + + IParser parser = FhirPathUtils.FHIR_CTX.newJsonParser(); + + String bundleJson = parser.encodeResourceToString(b); + context.loadBundle(bundleJson); + + context.applyFunctionToBundle("giveEveryResourceSomeText"); + context.applyFunctionToResources("applySomeProfile"); + + String outBundleJson = context.getBundle(); + + Bundle outBundle = parser.parseResource(Bundle.class, outBundleJson); + + outBundle.getEntry().forEach(entry -> { + DomainResource resource = (DomainResource) entry.getResource(); + assertEquals("http://example.com/random-profile", resource.getMeta().getProfile().get(0).getValueAsString()); + + assertTrue(resource.getText().getDivAsString().contains("javascript was here")); + // check here is "contains" instead of simple equality because + // HAPI seems to add the xmlns to the text, which is probably consistent, but this is the real point of the test + }); + } +} diff --git a/src/test/resources/flexporter/test_mapping.yaml b/src/test/resources/flexporter/test_mapping.yaml index 7acd84cedf..2eb9f2ad70 100644 --- a/src/test/resources/flexporter/test_mapping.yaml +++ b/src/test/resources/flexporter/test_mapping.yaml @@ -96,6 +96,30 @@ actions: - name: testCreateResources_createBasedOn create_resource: + - resourceType: ServiceRequest + based_on: Procedure + fields: + - location: ServiceRequest.intent + value: plan + - location: ServiceRequest.encounter.reference + value: $getField([Procedure.encounter.reference]) + - location: ServiceRequest.subject.reference + value: $findRef([Patient]) + - location: ServiceRequest.code + value: $getField([Procedure.code]) # <-- STILL WIP + + + # this works if the VS is loaded but otherwise tries to make a network lookup + # so disable for now + # - location: ServiceRequest.code.coding + # value: $randomCode([http://hl7.org/fhir/us/mcode/ValueSet/mcode-laterality-vs]) + # TODO: is "writeback" the best term here? + writeback: + - location: Procedure.basedOn.reference + value: $setRef([ServiceRequest]) + + - name: testCreateResources_createBasedOn_JS + create_resource_js: - resourceType: ServiceRequest based_on: Procedure fields: @@ -128,7 +152,22 @@ actions: - location: Patient.name.family value: $getAttribute([last_name]) - + - name: testExecuteScript + execute_script: + - apply_to: bundle + function_name: apply + function: | + function apply(bundle) { + bundle['entry'][0]['resource']['meta'] = {profile: ['http://example.com/dummy-profile']} + } + - apply_to: resource + function_name: apply2 + function: | + function apply2(resource, bundle) { + if (resource.resourceType == 'Patient') { + resource.birthDate = '2022-02-22'; + } + } # TODO: on keep/delete, check for references to removed items!! - name: testKeepResources From 6a0c3ed296727eb60c47411f4e107eefc178a94e Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Thu, 1 Dec 2022 16:24:02 -0500 Subject: [PATCH 13/78] test fix and cleanup --- .../export/flexporter/ActionsTest.java | 104 ++++-------------- .../FlexporterJavaScriptContextTest.java | 31 +++--- .../helpers/RandomCodeGeneratorTest.java | 2 +- 3 files changed, 36 insertions(+), 101 deletions(-) diff --git a/src/test/java/org/mitre/synthea/export/flexporter/ActionsTest.java b/src/test/java/org/mitre/synthea/export/flexporter/ActionsTest.java index 92375e260f..a55d5d09e6 100644 --- a/src/test/java/org/mitre/synthea/export/flexporter/ActionsTest.java +++ b/src/test/java/org/mitre/synthea/export/flexporter/ActionsTest.java @@ -234,10 +234,10 @@ public void testSetValues_object() { Map action = getActionByName("testSetValues_object"); Actions.applyAction(b, action, null, null); - + System.out.println(b); } - + @Test public void testKeepResources() throws Exception { Bundle b = loadFixtureBundle("sample_complete_patient.json"); @@ -308,9 +308,9 @@ public void testCreateResources_createSingle() throws Exception { } @Test - public void testExec() throws Exception { + public void testExec() throws Exception { Map action = getActionByName("testExecuteScript"); - + Patient p = new Patient(); p.addName().addGiven("Cristina").setFamily("Crimson"); DateType date = new DateType(); @@ -319,93 +319,29 @@ public void testExec() throws Exception { Bundle b = new Bundle(); b.addEntry().setResource(p); - + Bundle updatedBundle = Actions.applyAction(b, action, null, new FlexporterJavascriptContext()); - + /* function apply(bundle) { bundle['entry'][0]['resource']['meta'] = {profile: ['http://example.com/dummy-profile']} } - + function apply2(resource, bundle) { if (resource.resourceType == 'Patient') { resource.birthDate = '2022-02-22'; } } - + */ - + Patient outPatient = (Patient) updatedBundle.getEntryFirstRep().getResource(); - + assertEquals("http://example.com/dummy-profile", outPatient.getMeta().getProfile().get(0).getValueAsString()); - + assertEquals("2022-02-22", outPatient.getBirthDateElement().getValueAsString()); } - - @Test - public void testTiming() throws Exception { - int NUM_TESTS = 10; - Bundle[] testBundles = new Bundle[NUM_TESTS]; - - for (int i = 0 ; i < NUM_TESTS ; i++) { - testBundles[i] = loadFixtureBundle("sample_complete_patient.json"); - } - - Map action = getActionByName("testCreateResources_createBasedOn"); - long start = System.currentTimeMillis(); - for (int i = 0 ; i < NUM_TESTS ; i++) { - Actions.applyAction(testBundles[i], action, null, null); - } - long elapsed = System.currentTimeMillis() - start; - - System.out.println("Completed " + NUM_TESTS + " pre-warmup Pure Java runs in " + elapsed + " ms."); - - for (int i = 0 ; i < NUM_TESTS ; i++) { - testBundles[i] = loadFixtureBundle("sample_complete_patient.json"); - } - - - start = System.currentTimeMillis(); - for (int i = 0 ; i < NUM_TESTS ; i++) { - Actions.applyAction(testBundles[i], action, null, null); - } - elapsed = System.currentTimeMillis() - start; - - System.out.println("Completed " + NUM_TESTS + " Pure Java runs in " + elapsed + " ms."); - - - action = getActionByName("testCreateResources_createBasedOn_JS"); - - for (int i = 0 ; i < NUM_TESTS ; i++) { - testBundles[i] = loadFixtureBundle("sample_complete_patient.json"); - } - - FlexporterJavascriptContext fjContext = new FlexporterJavascriptContext(); - fjContext.loadFunction("function getField(resourceString, fhirPath) {\n" - + " const resource = JSON.parse(resourceString);\n" - + " const value = evaluate(resource, fhirPath);\n" - + "\n" - + " if (!Array.isArray(value) || !value.length) {\n" - + " // array does not exist, is not an array, or is empty\n" - + " // ⇒ do not attempt to process array\n" - + " return null;\n" - + " }\n" - + "\n" - + " return value[0];\n" - + "}"); - - - start = System.currentTimeMillis(); - for (int i = 0 ; i < NUM_TESTS ; i++) { - Actions.applyAction(testBundles[i], action, null, fjContext); - } - elapsed = System.currentTimeMillis() - start; - - System.out.println("Completed " + NUM_TESTS + " blended JavaScript runs in " + elapsed + " ms."); - - } - - + @Test public void testCreateResources_createBasedOn() throws Exception { Bundle b = loadFixtureBundle("sample_complete_patient.json"); @@ -415,19 +351,19 @@ public void testCreateResources_createBasedOn() throws Exception { .count(); assertEquals(0, countSR); - + List procedures = b.getEntry().stream() .filter(bec -> bec.getResource().getResourceType() == ResourceType.Procedure) .map(bec -> (Procedure) bec.getResource()) .collect(Collectors.toList()); - + Map action = getActionByName("testCreateResources_createBasedOn"); Actions.applyAction(b, action, null, null); // there should now be one ServiceRequest per Procedure - // get a map of id --> servicerequest, for easy lookups + // get a map of id --> servicerequest, for easy lookups Map serviceRequests = b.getEntry().stream() .filter(bec -> bec.getResource().getResourceType() == ResourceType.ServiceRequest) .map(bec -> (ServiceRequest) bec.getResource()) @@ -436,13 +372,13 @@ public void testCreateResources_createBasedOn() throws Exception { assertEquals(procedures.size(), serviceRequests.size()); String patientId = b.getEntryFirstRep().getResource().getId(); - + // iterate over the procedures so we can find the servicerequest for each for (Procedure proc : procedures) { - + // "ServiceRequest/".length == 15 String basedOn = proc.getBasedOnFirstRep().getReference().substring(15); - + ServiceRequest sr = serviceRequests.remove(basedOn); assertNotNull(sr); assertEquals("plan", sr.getIntent().toCode()); @@ -450,10 +386,10 @@ public void testCreateResources_createBasedOn() throws Exception { assertEquals(proc.getEncounter().getReference(), sr.getEncounter().getReference()); assertTrue(proc.getCode().equalsDeep(sr.getCode())); } - + // we removed each SR as we checked it, to ensure there are none left assertEquals(0, serviceRequests.size()); - + } @Test diff --git a/src/test/java/org/mitre/synthea/export/flexporter/FlexporterJavaScriptContextTest.java b/src/test/java/org/mitre/synthea/export/flexporter/FlexporterJavaScriptContextTest.java index 4e2ad8c089..b001e54a5b 100644 --- a/src/test/java/org/mitre/synthea/export/flexporter/FlexporterJavaScriptContextTest.java +++ b/src/test/java/org/mitre/synthea/export/flexporter/FlexporterJavaScriptContextTest.java @@ -3,33 +3,31 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; +import ca.uhn.fhir.parser.IParser; + import org.hl7.fhir.r4.model.Bundle; import org.hl7.fhir.r4.model.DateType; import org.hl7.fhir.r4.model.DomainResource; import org.hl7.fhir.r4.model.Patient; import org.junit.Test; -import ca.uhn.fhir.parser.IParser; - public class FlexporterJavaScriptContextTest { - @Test public void testJavascriptContext() { FlexporterJavascriptContext context = new FlexporterJavascriptContext(); - + context.loadFunction("function applySomeProfile(resource) {\n" + " resource['meta'] = {profile: [\"http://example.com/random-profile\"]}\n" + "}"); - + context.loadFunction("function giveEveryResourceSomeText(bundle) {\n" + " bundle.entry.forEach(e => e.resource.text = {\n" + " \"status\": \"generated\",\n" + " \"div\": \"
javascript was here
\"\n" + " });\n" - + "}"); - - + + "}"); + Patient p = new Patient(); p.addName().addGiven("Alex").setFamily("Aquamarine"); DateType date = new DateType(); @@ -38,27 +36,28 @@ public void testJavascriptContext() { Bundle b = new Bundle(); b.addEntry().setResource(p); - + IParser parser = FhirPathUtils.FHIR_CTX.newJsonParser(); String bundleJson = parser.encodeResourceToString(b); context.loadBundle(bundleJson); - + context.applyFunctionToBundle("giveEveryResourceSomeText"); context.applyFunctionToResources("applySomeProfile"); - + String outBundleJson = context.getBundle(); - + Bundle outBundle = parser.parseResource(Bundle.class, outBundleJson); - + outBundle.getEntry().forEach(entry -> { DomainResource resource = (DomainResource) entry.getResource(); assertEquals("http://example.com/random-profile", resource.getMeta().getProfile().get(0).getValueAsString()); - + assertTrue(resource.getText().getDivAsString().contains("javascript was here")); - // check here is "contains" instead of simple equality because - // HAPI seems to add the xmlns to the text, which is probably consistent, but this is the real point of the test + // check here is "contains" instead of simple equality + // because HAPI seems to add the xmlns to the text, which is probably consistent, + // but this is the real point of the test }); } } diff --git a/src/test/java/org/mitre/synthea/helpers/RandomCodeGeneratorTest.java b/src/test/java/org/mitre/synthea/helpers/RandomCodeGeneratorTest.java index ce6ecae964..ec20eea6cb 100644 --- a/src/test/java/org/mitre/synthea/helpers/RandomCodeGeneratorTest.java +++ b/src/test/java/org/mitre/synthea/helpers/RandomCodeGeneratorTest.java @@ -57,7 +57,7 @@ public void throwsWhenNoExpansion() throws IOException { try { RandomCodeGenerator.getCode(VALUE_SET_URI, SEED, this.code); } catch (RuntimeException e) { - Assert.assertEquals("ValueSet does not contain expansion", e.getMessage()); + Assert.assertEquals("ValueSet does not contain compose or expansion", e.getMessage()); return; } Assert.fail("Should have thrown a no expansion exception"); From e465f531c8b18467dc80540db02ee97b840274a5 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Fri, 2 Dec 2022 10:27:20 -0500 Subject: [PATCH 14/78] nested maps in setValues --- .../synthea/export/flexporter/Actions.java | 31 +++++++++++++------ .../CustomFHIRPathResourceGeneratorR4.java | 1 + .../export/flexporter/ActionsTest.java | 22 +++++++++++-- 3 files changed, 42 insertions(+), 12 deletions(-) diff --git a/src/main/java/org/mitre/synthea/export/flexporter/Actions.java b/src/main/java/org/mitre/synthea/export/flexporter/Actions.java index 22a1decbdd..69fae585c6 100644 --- a/src/main/java/org/mitre/synthea/export/flexporter/Actions.java +++ b/src/main/java/org/mitre/synthea/export/flexporter/Actions.java @@ -206,8 +206,6 @@ private static Map createFhirPathMapping(List) { - // TODO } // TODO: consider a "skip-resource-if-null" kind of thing @@ -235,14 +233,10 @@ private static Map createFhirPathMapping(List) { - // TODO: objects should be nestable to >1 level - Map valueMap = (Map) valueDef; - for(Map.Entry entry : valueMap.entrySet()) { - String key = entry.getKey(); - String value = entry.getValue(); - - fhirPathMapping.put(location + "." + key, value); - } + Map valueMap = (Map) valueDef; + + populateFhirPathMapping(fhirPathMapping, location, valueMap); + } else if (valueDef instanceof Base) { // we plucked a full FHIR object from somewhere fhirPathMapping.put(location, valueDef); @@ -255,6 +249,23 @@ private static Map createFhirPathMapping(List fhirPathMapping, String basePath, Map valueMap) { + for(Map.Entry entry : valueMap.entrySet()) { + String key = entry.getKey(); + Object value = entry.getValue(); + + String path = basePath + "." + key; + + if (value instanceof String) { + fhirPathMapping.put(path, value); + } else if (value instanceof Map) { + populateFhirPathMapping(fhirPathMapping, path, (Map) value); + } else if (value != null) { + System.err.println("Unexpected class found in populateFhirPathMapping -- " + value.getClass()); + } + } + } public static void keepResources(Bundle bundle, List list) { // TODO: make this FHIRPath instead of just straight resource types diff --git a/src/main/java/org/mitre/synthea/export/flexporter/CustomFHIRPathResourceGeneratorR4.java b/src/main/java/org/mitre/synthea/export/flexporter/CustomFHIRPathResourceGeneratorR4.java index cf3afef2ac..02d85dcbb0 100644 --- a/src/main/java/org/mitre/synthea/export/flexporter/CustomFHIRPathResourceGeneratorR4.java +++ b/src/main/java/org/mitre/synthea/export/flexporter/CustomFHIRPathResourceGeneratorR4.java @@ -141,6 +141,7 @@ private void prepareInternalState(Class resourceClass) { */ public T generateResource(String resourceType) { try { + @SuppressWarnings("unchecked") Class resourceClass = (Class) Class.forName("org.hl7.fhir.r4.model." + resourceType); diff --git a/src/test/java/org/mitre/synthea/export/flexporter/ActionsTest.java b/src/test/java/org/mitre/synthea/export/flexporter/ActionsTest.java index a55d5d09e6..46fac5c12e 100644 --- a/src/test/java/org/mitre/synthea/export/flexporter/ActionsTest.java +++ b/src/test/java/org/mitre/synthea/export/flexporter/ActionsTest.java @@ -15,7 +15,6 @@ import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import java.util.function.Function; import java.util.stream.Collectors; @@ -24,6 +23,7 @@ import org.hl7.fhir.r4.model.Bundle; import org.hl7.fhir.r4.model.Bundle.BundleEntryComponent; import org.hl7.fhir.r4.model.Bundle.BundleType; +import org.hl7.fhir.r4.model.Coding; import org.hl7.fhir.r4.model.DateTimeType; import org.hl7.fhir.r4.model.DateType; import org.hl7.fhir.r4.model.HumanName; @@ -235,7 +235,25 @@ public void testSetValues_object() { Actions.applyAction(b, action, null, null); - System.out.println(b); + /* + + - name: testSetValues_object + set_values: + - applicability: Patient + fields: + - location: Patient.maritalStatus.coding + value: + system: http://snomedct.io + code: "36629006" + display: "Legally married (finding)" + + */ + + Coding c = p.getMaritalStatus().getCodingFirstRep(); + + assertEquals("http://snomedct.io", c.getSystem()); + assertEquals("36629006", c.getCode()); + assertEquals("Legally married (finding)", c.getDisplay()); } @Test From 4423e0bfb66808dc99541360671737d2ea4b4069 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Fri, 2 Dec 2022 10:48:01 -0500 Subject: [PATCH 15/78] starting to clean up checkstyle issues --- .../synthea/export/flexporter/Actions.java | 67 ++++++------- .../CustomFHIRPathResourceGeneratorR4.java | 43 +++++---- .../FlexporterJavascriptContext.java | 95 +++++++++---------- .../synthea/helpers/RandomCodeGenerator.java | 46 ++++----- ...CustomFHIRPathResourceGeneratorR4Test.java | 3 +- 5 files changed, 129 insertions(+), 125 deletions(-) diff --git a/src/main/java/org/mitre/synthea/export/flexporter/Actions.java b/src/main/java/org/mitre/synthea/export/flexporter/Actions.java index 69fae585c6..bd4d6b1923 100644 --- a/src/main/java/org/mitre/synthea/export/flexporter/Actions.java +++ b/src/main/java/org/mitre/synthea/export/flexporter/Actions.java @@ -1,5 +1,7 @@ package org.mitre.synthea.export.flexporter; +import ca.uhn.fhir.parser.IParser; + import java.util.Collections; import java.util.HashMap; import java.util.HashSet; @@ -21,15 +23,12 @@ import org.mitre.synthea.helpers.RandomCodeGenerator; import org.mitre.synthea.world.agents.Person; -import ca.uhn.fhir.parser.IParser; - - // For now @SuppressWarnings("unchecked") public abstract class Actions { public static Bundle applyMapping(Bundle bundle, Mapping mapping, Person person, FlexporterJavascriptContext fjContext) { - + for (Map action : mapping.actions) { bundle = applyAction(bundle, action, person, fjContext); } @@ -40,9 +39,9 @@ public static Bundle applyMapping(Bundle bundle, Mapping mapping, Person person, public static Bundle applyAction(Bundle bundle, Map action, Person person, FlexporterJavascriptContext fjContext) { // TODO: this could be handled better but for now just key off a specific field in the action - Bundle returnBundle = bundle; + Bundle returnBundle = bundle; // most actions modify the bundle in-place, but some might return a whole new one - + if (action.containsKey("profiles")) { applyProfiles(bundle, (List>) action.get("profiles")); } else if (action.containsKey("set_values")) { @@ -58,7 +57,7 @@ public static Bundle applyAction(Bundle bundle, Map action, Pers } else if (action.containsKey("execute_script")) { returnBundle = executeScript((List>)action.get("execute_script"), bundle, fjContext); } - + return returnBundle; } @@ -201,11 +200,11 @@ private static Map createFhirPathMapping(List createFhirPathMapping(List createFhirPathMapping(List) { Map valueMap = (Map) valueDef; - + populateFhirPathMapping(fhirPathMapping, location, valueMap); - + } else if (valueDef instanceof Base) { // we plucked a full FHIR object from somewhere fhirPathMapping.put(location, valueDef); - + } else { // unexpected type here - is it even possible to get anything else? System.err.println("Unhandled type in createFhirPathMapping: " + valueDef.getClass()); @@ -249,14 +248,14 @@ private static Map createFhirPathMapping(List fhirPathMapping, String basePath, Map valueMap) { for(Map.Entry entry : valueMap.entrySet()) { String key = entry.getKey(); Object value = entry.getValue(); - + String path = basePath + "." + key; - + if (value instanceof String) { fhirPathMapping.put(path, value); } else if (value instanceof Map) { @@ -318,15 +317,15 @@ private static Bundle executeScript(List> fields, Bundle bun IParser parser = FhirPathUtils.FHIR_CTX.newJsonParser(); String bundleJson = parser.encodeResourceToString(bundle); - + fjContext.loadBundle(bundleJson); for (Map scriptDef : fields) { - + String function = scriptDef.get("function"); String functionName = scriptDef.get("function_name"); String applyTo = scriptDef.get("apply_to"); - + fjContext.loadFunction(function); if (applyTo.equalsIgnoreCase("bundle")) { @@ -334,18 +333,18 @@ private static Bundle executeScript(List> fields, Bundle bun } else if (applyTo.equalsIgnoreCase("resource") || applyTo.equalsIgnoreCase("resources")) { fjContext.applyFunctionToResources(functionName); } else { - throw new IllegalArgumentException("Unknown option for execute_script.apply_to: '" + applyTo + throw new IllegalArgumentException("Unknown option for execute_script.apply_to: '" + applyTo + "'. Valid options are 'bundle' and 'resources'"); } } String outBundleJson = fjContext.getBundle(); - + Bundle newBundle = parser.parseResource(Bundle.class, outBundleJson); return newBundle; } - + private static Object getValue(Bundle bundle, String valueDef, Resource currentResource, Person person, FlexporterJavascriptContext fjContext) { @@ -399,8 +398,9 @@ private static String createReference(Resource resource) { // from some testing, ids in HAPI also seem to be a little flaky String id = resource.getId(); - if (id.startsWith("urn:uuid:")) + if (id.startsWith("urn:uuid:")) { return id; + } return resource.getResourceType().toString() + "/" + id; } @@ -411,8 +411,9 @@ private static Object getField(Resource currentResource, FlexporterJavascriptCon List fieldValues = FhirPathUtils.evaluateResource(currentResource, args[0]); - if (fieldValues.isEmpty()) + if (fieldValues.isEmpty()) { return null; + } return fieldValues.get(0); } @@ -426,8 +427,9 @@ private static String findReference(Bundle bundle, String... flagValues) { List matchingResources = FhirPathUtils.evaluateBundle(bundle, flagValues[0], true); - if (matchingResources.isEmpty()) + if (matchingResources.isEmpty()) { return null; + } return createReference((Resource) matchingResources.get(0)); } @@ -437,15 +439,16 @@ private static String findValues(Bundle bundle, String... args) { // args[1] = how to disambiguate if there are multiple? TODO List fieldValues = FhirPathUtils.evaluateBundle(bundle, args[0], false); - if (fieldValues.isEmpty()) + if (fieldValues.isEmpty()) { return null; + } return fieldValues.get(0).primitiveValue(); } - + private static Map randomCode(String valueSetUrl) { - - Map codeAsMap = RandomCodeGenerator.getCodeAsMap(valueSetUrl, (int)(Math.random() * Integer.MAX_VALUE)); + Map codeAsMap = + RandomCodeGenerator.getCodeAsMap(valueSetUrl, (int)(Math.random() * Integer.MAX_VALUE)); return codeAsMap; } } diff --git a/src/main/java/org/mitre/synthea/export/flexporter/CustomFHIRPathResourceGeneratorR4.java b/src/main/java/org/mitre/synthea/export/flexporter/CustomFHIRPathResourceGeneratorR4.java index 02d85dcbb0..3c6538886b 100644 --- a/src/main/java/org/mitre/synthea/export/flexporter/CustomFHIRPathResourceGeneratorR4.java +++ b/src/main/java/org/mitre/synthea/export/flexporter/CustomFHIRPathResourceGeneratorR4.java @@ -1,12 +1,19 @@ package org.mitre.synthea.export.flexporter; +import ca.uhn.fhir.context.BaseRuntimeChildDatatypeDefinition; +import ca.uhn.fhir.context.BaseRuntimeChildDefinition; +import ca.uhn.fhir.context.BaseRuntimeElementDefinition; +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.context.RuntimeCompositeDatatypeDefinition; +import ca.uhn.fhir.context.RuntimePrimitiveDatatypeDefinition; +import ca.uhn.fhir.context.RuntimeResourceBlockDefinition; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Stack; -import org.hl7.fhir.r4.utils.FHIRPathEngine; import org.hl7.fhir.instance.model.api.IBase; import org.hl7.fhir.instance.model.api.ICompositeType; import org.hl7.fhir.instance.model.api.IPrimitiveType; @@ -14,14 +21,8 @@ import org.hl7.fhir.r4.model.ExpressionNode; import org.hl7.fhir.r4.model.ExpressionNode.Kind; import org.hl7.fhir.r4.model.Resource; +import org.hl7.fhir.r4.utils.FHIRPathEngine; -import ca.uhn.fhir.context.BaseRuntimeChildDatatypeDefinition; -import ca.uhn.fhir.context.BaseRuntimeChildDefinition; -import ca.uhn.fhir.context.BaseRuntimeElementDefinition; -import ca.uhn.fhir.context.FhirContext; -import ca.uhn.fhir.context.RuntimeCompositeDatatypeDefinition; -import ca.uhn.fhir.context.RuntimePrimitiveDatatypeDefinition; -import ca.uhn.fhir.context.RuntimeResourceBlockDefinition; /** * This class can be used to generate resources using FHIRPath expressions. @@ -111,7 +112,7 @@ public T getResource() { } /** - * Sets the resource to apply FHIRPath changes to. + * Sets the resource to apply FHIRPath changes to. * If not set, calling generateResource will instantiate a new resource. */ public void setResource(T resource) { @@ -141,16 +142,16 @@ private void prepareInternalState(Class resourceClass) { */ public T generateResource(String resourceType) { try { - @SuppressWarnings("unchecked") + @SuppressWarnings("unchecked") Class resourceClass = (Class) Class.forName("org.hl7.fhir.r4.model." + resourceType); - + return generateResource(resourceClass); } catch (ClassNotFoundException e) { throw new RuntimeException(e); } } - + /** * The generation method that yields a new instance of class `resourceClass` with every value set * in the FHIRPath mapping. @@ -313,16 +314,16 @@ private void handleCompositeNode(ExpressionNode fhirPath) { // iterate through all parent nodes for (IBase nodeElement : this.nodeStack.peek().nodes) { List containedNodes = nextTier.childDefinition.getAccessor().getValues(nodeElement); - - if (nextTier.childDefinition instanceof BaseRuntimeChildDatatypeDefinition + + if (nextTier.childDefinition instanceof BaseRuntimeChildDatatypeDefinition && ((BaseRuntimeChildDatatypeDefinition) nextTier.childDefinition).getDatatype().isInstance(this.valueToSet)) { - + // this enables us to work with objects that are not trivially strings, ex CodeableConcepts - + // TODO: are there any other implications to this? - nextTier.childDefinition.getMutator().setValue(nodeElement, (IBase)this.valueToSet); - - } else { + nextTier.childDefinition.getMutator().setValue(nodeElement, (IBase)this.valueToSet); + + } else { if (containedNodes.size() > 0) { // check if sister nodes are already available nextTier.nodes.addAll(containedNodes); @@ -333,9 +334,9 @@ private void handleCompositeNode(ExpressionNode fhirPath) { nextTier.childDefinition.getMutator().addValue(nodeElement, compositeNode); nextTier.nodes.add(compositeNode); } - + } - + } // push the created nextTier to the nodeStack diff --git a/src/main/java/org/mitre/synthea/export/flexporter/FlexporterJavascriptContext.java b/src/main/java/org/mitre/synthea/export/flexporter/FlexporterJavascriptContext.java index 3749cc16ce..8cbe0cab2d 100644 --- a/src/main/java/org/mitre/synthea/export/flexporter/FlexporterJavascriptContext.java +++ b/src/main/java/org/mitre/synthea/export/flexporter/FlexporterJavascriptContext.java @@ -8,55 +8,54 @@ import org.graalvm.polyglot.Value; public class FlexporterJavascriptContext { - private final Context CONTEXT; - + private final Context jsContext; + private Value workingBundleAsJSObject; - + public FlexporterJavascriptContext() { - CONTEXT = Context.create("js"); + jsContext = Context.create("js"); // TODO: if we want to add custom libraries like fhirpath or fhir-mapper, do it here // try { -// +// // for (String filename : Arrays.asList("fhirpath.js", "fhir-mapper.js") ) { // String fileText = Files.readString(Path.of()); // loadFunction(fileText); -// -// +// +// // loadFile(filename); // } // System.out.println("All functions available from Java (as loaded into Bindings) " -// + CONTEXT.getBindings("js").getMemberKeys()); +// + jsContext.getBindings("js").getMemberKeys()); // } catch (Exception e) { // e.printStackTrace(); // } } - + public void loadFile(String filename) throws IOException { - - URL url = FlexporterJavascriptContext.class.getClassLoader().getResource("./lib/"+filename); - - CONTEXT.eval(Source.newBuilder("js", url).build()); + URL url = FlexporterJavascriptContext.class.getClassLoader().getResource("./lib/" + filename); + + jsContext.eval(Source.newBuilder("js", url).build()); } - + public void loadFunction(String functionDef) { - CONTEXT.eval("js", functionDef); + jsContext.eval("js", functionDef); } - + public void loadBundle(String bundleAsString) { // workingBundleAsJSObject = JSON.parse(bundleAsString) - - Value parseFn = CONTEXT.eval("js","(bundleString) => JSON.parse(bundleString)"); - + + Value parseFn = jsContext.eval("js","(bundleString) => JSON.parse(bundleString)"); + workingBundleAsJSObject = parseFn.execute(bundleAsString); } - + public String getBundle() { // return JSON.stringify(workingBundleAsJSObject) - - Value stringifyFn = CONTEXT.eval("js","(bundle) => JSON.stringify(bundle)"); - + + Value stringifyFn = jsContext.eval("js","(bundle) => JSON.stringify(bundle)"); + String bundleString = stringifyFn.execute(workingBundleAsJSObject).asString(); - + return bundleString; } @@ -64,47 +63,47 @@ public void applyFunctionToBundle(String fnName) { // assumption is the fn has already been loaded by loadFunction // good news -- based on testing, if the bundle is modified in-place in the JS context then our variable "sees" those updates // (the variable maintains a reference to the object within the JS VM) - - Value applyFn = CONTEXT.getBindings("js").getMember(fnName); + + Value applyFn = jsContext.getBindings("js").getMember(fnName); applyFn.execute(workingBundleAsJSObject); } - + public void applyFunctionToResources(String fnName) { // assumption is the fn has already been loaded by loadFunction - - Value applyFn = CONTEXT.getBindings("js").getMember(fnName); - + + Value applyFn = jsContext.getBindings("js").getMember(fnName); + Value entries = workingBundleAsJSObject.getMember("entry"); - - for (int i = 0 ; i < entries.getArraySize() ; i++) { + + for (int i = 0; i < entries.getArraySize(); i++) { Value entry = entries.getArrayElement(i); - + Value resource = entry.getMember("resource"); - + // provide both the resource and the full bundle for context // (eg, so we can create references to other resources) applyFn.execute(resource, workingBundleAsJSObject); } } - + public String exec(String fnName, String... args) { - Value applyFn = CONTEXT.getBindings("js").getMember(fnName); + Value applyFn = jsContext.getBindings("js").getMember(fnName); Value processedJson = applyFn.execute((Object[])args); - - - Value applyFn2 = CONTEXT.getBindings("js").getMember("getField2"); - + + + Value applyFn2 = jsContext.getBindings("js").getMember("getField2"); + Value result2 = applyFn2.execute(processedJson); - + return result2.asString(); } - + public String applyTransforms(String fhirJson) { - Value applyFn = CONTEXT.getBindings("js").getMember("apply"); - Value processedJson = applyFn.execute(fhirJson); - - String result = processedJson.asString(); - - return result; + Value applyFn = jsContext.getBindings("js").getMember("apply"); + Value processedJson = applyFn.execute(fhirJson); + + String result = processedJson.asString(); + + return result; } } diff --git a/src/main/java/org/mitre/synthea/helpers/RandomCodeGenerator.java b/src/main/java/org/mitre/synthea/helpers/RandomCodeGenerator.java index d7a426bcd8..1837eef51f 100644 --- a/src/main/java/org/mitre/synthea/helpers/RandomCodeGenerator.java +++ b/src/main/java/org/mitre/synthea/helpers/RandomCodeGenerator.java @@ -62,7 +62,7 @@ public static Code getCode(String valueSetUri, long seed, Code code) { } return code; } - + public static Map getCodeAsMap(String valueSetUri, long seed) { if (urlValidator.isValid(valueSetUri)) { expandValueSet(valueSetUri); @@ -74,32 +74,32 @@ public static Map getCodeAsMap(String valueSetUri, long seed) { } return null; } - + // TODO: this does not belong here, but this class is where the code cache is public static boolean codeInValueSet(Code code, String valueSetUri) { if (urlValidator.isValid(valueSetUri)) { expandValueSet(valueSetUri); - + // TODO: there has to be a better way to do this Map codeAsMap = new HashMap<>(); codeAsMap.put("system", code.system); codeAsMap.put("code", code.code); codeAsMap.put("display", code.display); - + List cachedCodeList = codeListCache.get(valueSetUri); - + // this will only return true if everything is exactly identical // ie, it will not match if display is different if (cachedCodeList.contains(codeAsMap)) { return true; } - + // iterate through all the codes to see if it contains the system/code combo // TODO: pick better data structures that support this - + for (Object cachedCodeObj : cachedCodeList) { Map cachedCode = (Map)cachedCodeObj; - + if (cachedCode.get("system").equals(code.system) && cachedCode.get("code").equals(code.code)) { return true; } @@ -108,7 +108,7 @@ public static boolean codeInValueSet(Code code, String valueSetUri) { // TODO?? return false; } - + @SuppressWarnings("unchecked") private static synchronized void expandValueSet(String valueSetUri) { if (!codeListCache.containsKey(valueSetUri)) { @@ -133,17 +133,17 @@ private static synchronized void expandValueSet(String valueSetUri) { } catch (IOException e) { throw new RuntimeException("Issue when expanding the value set", e); } - + loadValueSet(valueSetUri, valueSet); } } - + @SuppressWarnings("unchecked") public static void loadValueSet(String valueSetUri, Map valueSet) { if (valueSetUri == null) { valueSetUri = (String)valueSet.get("url"); } - + if (valueSetUri != null && !codeListCache.containsKey(valueSetUri)) { Map expansion = (Map) valueSet.get("expansion"); if (expansion != null) { @@ -152,20 +152,20 @@ public static void loadValueSet(String valueSetUri, Map valueSet } else { Map compose = (Map) valueSet.get("compose"); - + if (compose == null) { throw new RuntimeException("ValueSet does not contain compose or expansion"); } - + // TODO: why is this List instead of something more specific? // we know the contents are Map List codes = new ArrayList<>(); - + List> includeList = (List>) compose.get("include"); - + for (Map include : includeList) { String system = (String)include.get("system"); - + List> conceptList = (List>) include.get("concept"); for (Map concept : conceptList) { @@ -173,20 +173,20 @@ public static void loadValueSet(String valueSetUri, Map valueSet codeAsMap.put("system", system); codeAsMap.put("code", (String)concept.get("code")); codeAsMap.put("display", (String)concept.get("display")); - + codes.add(codeAsMap); } - - + + } - + if (codes.isEmpty()) { throw new RuntimeException("ValueSet does not contain any codes defined within compose"); } - + codeListCache.put(valueSetUri, codes); - + } System.out.println("Loaded " + valueSetUri); } diff --git a/src/test/java/org/mitre/synthea/export/flexporter/CustomFHIRPathResourceGeneratorR4Test.java b/src/test/java/org/mitre/synthea/export/flexporter/CustomFHIRPathResourceGeneratorR4Test.java index a9aee728ab..53cafac390 100644 --- a/src/test/java/org/mitre/synthea/export/flexporter/CustomFHIRPathResourceGeneratorR4Test.java +++ b/src/test/java/org/mitre/synthea/export/flexporter/CustomFHIRPathResourceGeneratorR4Test.java @@ -24,8 +24,9 @@ public class CustomFHIRPathResourceGeneratorR4Test { // share a context because these are slow to create - private static final FhirContext CTX = FhirContext.forR4(); + private static final FhirContext CTX = FhirPathUtils.FHIR_CTX; + @SuppressWarnings("unused") private static void logPatientJson(Patient p) { String patientJson = CTX.newJsonParser().setPrettyPrint(true).encodeResourceToString(p); From 43ba818a9cbdd2c22fe27d1c90992d338ab8e745 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Fri, 9 Dec 2022 12:40:10 -0500 Subject: [PATCH 16/78] even more checkstyle cleanup --- src/main/java/RunFlexporter.java | 124 ++++------ .../org/mitre/synthea/export/Exporter.java | 10 +- .../synthea/export/flexporter/Actions.java | 49 ++-- .../CustomFHIRPathResourceGeneratorR4.java | 223 +++++++++--------- .../export/flexporter/FhirPathUtils.java | 7 +- .../FlexporterJavascriptContext.java | 37 +-- .../export/flexporter/ValueTransforms.java | 6 +- .../synthea/helpers/RandomCodeGenerator.java | 6 +- 8 files changed, 235 insertions(+), 227 deletions(-) diff --git a/src/main/java/RunFlexporter.java b/src/main/java/RunFlexporter.java index 13ae96d36c..bdfb10e687 100644 --- a/src/main/java/RunFlexporter.java +++ b/src/main/java/RunFlexporter.java @@ -1,3 +1,9 @@ +import ca.uhn.fhir.parser.DataFormatException; +import ca.uhn.fhir.parser.IParser; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; @@ -22,12 +28,6 @@ import org.mitre.synthea.export.flexporter.Mapping; import org.mitre.synthea.helpers.RandomCodeGenerator; -import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.ObjectMapper; - -import ca.uhn.fhir.parser.DataFormatException; -import ca.uhn.fhir.parser.IParser; - public class RunFlexporter { public static void main(String[] args) throws Exception { @@ -95,11 +95,18 @@ public static void main(String[] args) throws Exception { convertFhir(mappingFile, igDirectory, sourceFile); } + + public static Bundle convertFhir(Bundle bundle, Mapping mapping) { + Actions.applyMapping(bundle, mapping, null, new FlexporterJavascriptContext()); + + return bundle; + } + public static void convertFhir(File mappingFile, File igDirectory, File sourceFhir) throws IOException { Mapping mapping = Mapping.parseMapping(mappingFile); - + if (igDirectory != null) { loadIG(igDirectory); } @@ -134,8 +141,10 @@ public static void convertFhir(File mappingFile, File igDirectory, File sourceFh new File("./output/flexporter/").mkdirs(); + String outFileName = "" + System.currentTimeMillis() + "_" + sourceFhir.getName(); + File outFile = - new File("./output/flexporter/" + System.currentTimeMillis() + "_" + sourceFhir.getName()); + new File("./output/flexporter/" + outFileName); Files.write(outFile.toPath(), bundleJson.getBytes(), StandardOpenOption.CREATE_NEW); @@ -144,77 +153,42 @@ public static void convertFhir(File mappingFile, File igDirectory, File sourceFh } static void loadIG(File igDirectory) throws IOException { - File[] artifacts = igDirectory.listFiles(); - - for (File artifact : artifacts) { - if (artifact.isFile() && FilenameUtils.getExtension(artifact.toString()).equals("json")) { - - IParser parser = FhirPathUtils.FHIR_CTX.newJsonParser(); - - String fhirJson = new String(Files.readAllBytes(artifact.toPath())); - IBaseResource resource = null; - - try { - resource = parser.parseResource(fhirJson); - } catch (DataFormatException dfe) { - // why does an IG contain bad data? - System.err.println("Warning: Unable to parse IG artifact " + artifact.getAbsolutePath()); - dfe.printStackTrace(); - } - -// System.out.println(resource); - - if (resource instanceof ValueSet) { - // TODO: fix RandomCodeGenerator to work with HAPI objects - // because this is silly - - ObjectMapper objectMapper = new ObjectMapper(); - - Map valueSet = objectMapper.readValue(fhirJson, - new TypeReference>() { - }); - try { - RandomCodeGenerator.loadValueSet(null, valueSet); - } catch (Exception e) { - System.err.println("WARNING: Unable to load ValueSet " + artifact.getAbsolutePath()); - e.printStackTrace(); - } - - } - -// JsonObject jsonObj = (JsonObject) JsonParser.parseReader(new FileReader(artifact)); -// String resourceType = jsonObj.get("resourceType").getAsString(); -// -// if(RESOURCES_IN_SCOPE_MAP.contains(resourceType)) { -// Resource resource = new Gson().fromJson(jsonObj, Resource.class); -// -// if(resource.getResourceType() == ResourceType.StructureDefinition) { -// String type = jsonObj.get("type").getAsString(); -// -// if(type.equals("Extension")) { -// igArtifacts.addExtension(resource.url, resource); -// } -// else { -// igArtifacts.addProfile(resource); -// } -// } -// else if(resource.resourceType.equals("ValueSet")) { -// for(ValueSet valueSet : resource.compose.getList()) { -// valueSet.setCodes(); -// } -// igArtifacts.addValueSet(resource.url, resource); -// } -// } - } - } + File[] artifacts = igDirectory.listFiles(); - } + for (File artifact : artifacts) { + if (artifact.isFile() && FilenameUtils.getExtension(artifact.toString()).equals("json")) { + IParser parser = FhirPathUtils.FHIR_CTX.newJsonParser(); - public static Bundle convertFhir(Bundle bundle, Mapping mapping) { - Actions.applyMapping(bundle, mapping, null, new FlexporterJavascriptContext()); + String fhirJson = new String(Files.readAllBytes(artifact.toPath())); + IBaseResource resource = null; - return bundle; + try { + resource = parser.parseResource(fhirJson); + } catch (DataFormatException dfe) { + // why does an IG contain bad data? + System.err.println("Warning: Unable to parse IG artifact " + artifact.getAbsolutePath()); + dfe.printStackTrace(); + } + + if (resource instanceof ValueSet) { + // TODO: fix RandomCodeGenerator to work with HAPI objects + // because this is silly + + ObjectMapper objectMapper = new ObjectMapper(); + + Map valueSet = objectMapper.readValue(fhirJson, + new TypeReference>() { + }); + try { + RandomCodeGenerator.loadValueSet(null, valueSet); + } catch (Exception e) { + System.err.println("WARNING: Unable to load ValueSet " + artifact.getAbsolutePath()); + e.printStackTrace(); + } + } + } + } } private static boolean isDirEmpty(final Path directory) throws IOException { diff --git a/src/main/java/org/mitre/synthea/export/Exporter.java b/src/main/java/org/mitre/synthea/export/Exporter.java index 0bd11744f6..efde62fdce 100644 --- a/src/main/java/org/mitre/synthea/export/Exporter.java +++ b/src/main/java/org/mitre/synthea/export/Exporter.java @@ -90,7 +90,7 @@ public ExporterRuntimeOptions(ExporterRuntimeOptions init) { terminologyService = init.terminologyService; recordQueue = init.recordQueue; fhirVersion = init.fhirVersion; - flexporterMappings=init.flexporterMappings; + flexporterMappings = init.flexporterMappings; } /** @@ -128,12 +128,12 @@ public String getNextRecord() throws InterruptedException { public boolean isRecordQueueEmpty() { return recordQueue == null || recordQueue.size() == 0; } - + public void addFlexporterMapping(Mapping mapping) { if (this.flexporterMappings == null) { this.flexporterMappings = new LinkedList<>(); } - + this.flexporterMappings.add(mapping); } } @@ -247,9 +247,9 @@ private static boolean exportRecord(Person person, String fileTag, long stopTime org.hl7.fhir.r4.model.Bundle bundle = FhirR4.convertToFHIR(person, stopTime); if (options.flexporterMappings != null) { - + FlexporterJavascriptContext fjContext = new FlexporterJavascriptContext(); - + for (Mapping mapping : options.flexporterMappings) { // flexport on the bundle here Actions.applyMapping(bundle, mapping, person, fjContext); diff --git a/src/main/java/org/mitre/synthea/export/flexporter/Actions.java b/src/main/java/org/mitre/synthea/export/flexporter/Actions.java index bd4d6b1923..05e8a80625 100644 --- a/src/main/java/org/mitre/synthea/export/flexporter/Actions.java +++ b/src/main/java/org/mitre/synthea/export/flexporter/Actions.java @@ -27,7 +27,8 @@ @SuppressWarnings("unchecked") public abstract class Actions { - public static Bundle applyMapping(Bundle bundle, Mapping mapping, Person person, FlexporterJavascriptContext fjContext) { + public static Bundle applyMapping(Bundle bundle, Mapping mapping, Person person, + FlexporterJavascriptContext fjContext) { for (Map action : mapping.actions) { bundle = applyAction(bundle, action, person, fjContext); @@ -36,7 +37,8 @@ public static Bundle applyMapping(Bundle bundle, Mapping mapping, Person person, return bundle; } - public static Bundle applyAction(Bundle bundle, Map action, Person person, FlexporterJavascriptContext fjContext) { + public static Bundle applyAction(Bundle bundle, Map action, Person person, + FlexporterJavascriptContext fjContext) { // TODO: this could be handled better but for now just key off a specific field in the action Bundle returnBundle = bundle; @@ -44,18 +46,28 @@ public static Bundle applyAction(Bundle bundle, Map action, Pers if (action.containsKey("profiles")) { applyProfiles(bundle, (List>) action.get("profiles")); + } else if (action.containsKey("set_values")) { setValues(bundle, (List>) action.get("set_values"), person, fjContext); + } else if (action.containsKey("keep_resources")) { keepResources(bundle, (List) action.get("keep_resources")); + } else if (action.containsKey("delete_resources")) { deleteResources(bundle, (List) action.get("delete_resources")); + } else if (action.containsKey("create_resource")) { - createResource(bundle, (List>) action.get("create_resource"), person, null); + createResource(bundle, (List>) action.get("create_resource"), person, + null); + } else if (action.containsKey("create_resource_js")) { - createResource(bundle, (List>) action.get("create_resource_js"), person, fjContext); + createResource(bundle, (List>) action.get("create_resource_js"), person, + fjContext); + } else if (action.containsKey("execute_script")) { - returnBundle = executeScript((List>)action.get("execute_script"), bundle, fjContext); + returnBundle = executeScript((List>) action.get("execute_script"), bundle, + fjContext); + } return returnBundle; @@ -90,7 +102,8 @@ private static void applyProfile(Resource resource, String profileURL) { } } - public static void setValues(Bundle bundle, List> items, Person person, FlexporterJavascriptContext fjContext) { + public static void setValues(Bundle bundle, List> items, Person person, + FlexporterJavascriptContext fjContext) { for (Map entry : items) { String applicability = (String) entry.get("applicability"); List> fields = (List>) entry.get("fields"); @@ -188,7 +201,9 @@ public static void createResource(Bundle bundle, List> resou private static Map createFhirPathMapping(List> fields, - Bundle sourceBundle, Resource sourceResource, Person person, FlexporterJavascriptContext fjContext) { + Bundle sourceBundle, Resource sourceResource, Person person, + FlexporterJavascriptContext fjContext) { + Map fhirPathMapping = new HashMap<>(); for (Map field : fields) { @@ -249,8 +264,9 @@ private static Map createFhirPathMapping(List fhirPathMapping, String basePath, Map valueMap) { - for(Map.Entry entry : valueMap.entrySet()) { + private static void populateFhirPathMapping(Map fhirPathMapping, String basePath, + Map valueMap) { + for (Map.Entry entry : valueMap.entrySet()) { String key = entry.getKey(); Object value = entry.getValue(); @@ -261,7 +277,8 @@ private static void populateFhirPathMapping(Map fhirPathMapping, } else if (value instanceof Map) { populateFhirPathMapping(fhirPathMapping, path, (Map) value); } else if (value != null) { - System.err.println("Unexpected class found in populateFhirPathMapping -- " + value.getClass()); + System.err + .println("Unexpected class found in populateFhirPathMapping -- " + value.getClass()); } } } @@ -313,7 +330,8 @@ public static void deleteResources(Bundle bundle, List list) { // TODO: additional passes for deleted resource IDs } - private static Bundle executeScript(List> fields, Bundle bundle, FlexporterJavascriptContext fjContext) { + private static Bundle executeScript(List> fields, Bundle bundle, + FlexporterJavascriptContext fjContext) { IParser parser = FhirPathUtils.FHIR_CTX.newJsonParser(); String bundleJson = parser.encodeResourceToString(bundle); @@ -405,7 +423,8 @@ private static String createReference(Resource resource) { return resource.getResourceType().toString() + "/" + id; } - private static Object getField(Resource currentResource, FlexporterJavascriptContext fjContext, String... args) { + private static Object getField(Resource currentResource, FlexporterJavascriptContext fjContext, + String... args) { // args[0] = FHIRPath, from this resource // args[1] = how to disambiguate if there are multiple? TODO @@ -446,9 +465,9 @@ private static String findValues(Bundle bundle, String... args) { return fieldValues.get(0).primitiveValue(); } - private static Map randomCode(String valueSetUrl) { - Map codeAsMap = - RandomCodeGenerator.getCodeAsMap(valueSetUrl, (int)(Math.random() * Integer.MAX_VALUE)); + private static Map randomCode(String valueSetUrl) { + Map codeAsMap = RandomCodeGenerator.getCodeAsMap(valueSetUrl, + (int) (Math.random() * Integer.MAX_VALUE)); return codeAsMap; } } diff --git a/src/main/java/org/mitre/synthea/export/flexporter/CustomFHIRPathResourceGeneratorR4.java b/src/main/java/org/mitre/synthea/export/flexporter/CustomFHIRPathResourceGeneratorR4.java index 3c6538886b..84f29fa246 100644 --- a/src/main/java/org/mitre/synthea/export/flexporter/CustomFHIRPathResourceGeneratorR4.java +++ b/src/main/java/org/mitre/synthea/export/flexporter/CustomFHIRPathResourceGeneratorR4.java @@ -36,7 +36,8 @@ * -- add support for BackboneElements * -- swapped constructors, pass in a FhirContext to avoid recreating it for each resource * -- add support for extensions on primitives - * -- more advanced java generics (some functions now take in Class<? extends T> instead of just T + * -- more advanced java generics + * (some functions now take in Class<? extends T> instead of just T) * -- reformatted per Synthea style guidelines * * Original: @@ -95,7 +96,7 @@ public CustomFHIRPathResourceGeneratorR4(FhirContext fhirCtx) { /** * Setter for the FHIRPath mapping Map instance. * - * @param mapping Map<String, String> a mapping of FHIRPath to value Strings that will be used to + * @param mapping Map<String, Object> a mapping of FHIRPath to objects that will be used to * create a Resource. */ public void setMapping(Map mapping) { @@ -123,7 +124,7 @@ public void setResource(T resource) { * Prepares the internal state prior to generating a FHIR Resource. Called once upon generation at * the start. * - * @param resourceClass Class The class of the Resource that shall be created (an empty + * @param resourceClass Class<T> The class of the Resource that shall be created (an empty * Resource will be created in this method). */ @SuppressWarnings("unchecked") @@ -134,8 +135,8 @@ private void prepareInternalState(Class resourceClass) { } /** - * The generation method that yields a new instance of the given resourceTypue with every value set - * in the FHIRPath mapping. + * The generation method that yields a new instance of the given resourceType + * with every value set in the FHIRPath mapping. * * @param resourceType String The class name of the Resource that shall be created. * @return T a new FHIR Resource instance of the given resource type. @@ -179,9 +180,10 @@ public T generateResource(Class resourceClass) { case Function: this.handleFunctionNode(pathNode); break; - case Constant: - case Group: - case Unary: + // case Constant: + // case Group: + // case Unary: + default: // TODO: unimplmemented, what to do? break; } @@ -228,14 +230,15 @@ private void handleNameNode(ExpressionNode fhirPath) { handleResourceBlock(fhirPath); break; - case ID_DATATYPE: - case RESOURCE: - case CONTAINED_RESOURCE_LIST: - case CONTAINED_RESOURCES: - case EXTENSION_DECLARED: - case PRIMITIVE_XHTML: - case PRIMITIVE_XHTML_HL7ORG: - case UNDECL_EXT: + // case ID_DATATYPE: + // case RESOURCE: + // case CONTAINED_RESOURCE_LIST: + // case CONTAINED_RESOURCES: + // case EXTENSION_DECLARED: + // case PRIMITIVE_XHTML: + // case PRIMITIVE_XHTML_HL7ORG: + // case UNDECL_EXT: + default: // TODO: not implemented. What to do? } } @@ -316,9 +319,10 @@ private void handleCompositeNode(ExpressionNode fhirPath) { List containedNodes = nextTier.childDefinition.getAccessor().getValues(nodeElement); if (nextTier.childDefinition instanceof BaseRuntimeChildDatatypeDefinition - && ((BaseRuntimeChildDatatypeDefinition) nextTier.childDefinition).getDatatype().isInstance(this.valueToSet)) { + && ((BaseRuntimeChildDatatypeDefinition) nextTier.childDefinition).getDatatype() + .isInstance(this.valueToSet)) { - // this enables us to work with objects that are not trivially strings, ex CodeableConcepts + // this lets us work with objects that are not trivially strings, e.g. CodeableConcepts // TODO: are there any other implications to this? nextTier.childDefinition.getMutator().setValue(nodeElement, (IBase)this.valueToSet); @@ -329,16 +333,14 @@ private void handleCompositeNode(ExpressionNode fhirPath) { nextTier.nodes.addAll(containedNodes); } else { // if not nodes are available, create a new node - ICompositeType compositeNode = - compositeTarget.newInstance(nextTier.childDefinition.getInstanceConstructorArguments()); + ICompositeType compositeNode = compositeTarget + .newInstance(nextTier.childDefinition.getInstanceConstructorArguments()); nextTier.childDefinition.getMutator().addValue(nodeElement, compositeNode); nextTier.nodes.add(compositeNode); } - } - - } + // push the created nextTier to the nodeStack this.nodeStack.push(nextTier); } @@ -386,79 +388,80 @@ private void handleFunctionNode(ExpressionNode fhirPath) { switch (fhirPath.getFunction()) { case Where: this.handleWhereFunctionNode(fhirPath); - case Aggregate: - case Alias: - case AliasAs: - case All: - case AllFalse: - case AllTrue: - case AnyFalse: - case AnyTrue: - case As: - case Check: - case Children: - case Combine: - case ConformsTo: - case Contains: - case ConvertsToBoolean: - case ConvertsToDateTime: - case ConvertsToDecimal: - case ConvertsToInteger: - case ConvertsToQuantity: - case ConvertsToString: - case ConvertsToTime: - case Count: - case Custom: - case Descendants: - case Distinct: - case Empty: - case EndsWith: - case Exclude: - case Exists: - case Extension: - case First: - case HasValue: - case HtmlChecks: - case Iif: - case IndexOf: - case Intersect: - case Is: - case IsDistinct: - case Item: - case Last: - case Length: - case Lower: - case Matches: - case MemberOf: - case Not: - case Now: - case OfType: - case Repeat: - case Replace: - case ReplaceMatches: - case Resolve: - case Select: - case Single: - case Skip: - case StartsWith: - case SubsetOf: - case Substring: - case SupersetOf: - case Tail: - case Take: - case ToBoolean: - case ToChars: - case ToDateTime: - case ToDecimal: - case ToInteger: - case ToQuantity: - case ToString: - case ToTime: - case Today: - case Trace: - case Type: - case Union: - case Upper: + break; + // case Aggregate: + // case Alias: + // case AliasAs: + // case All: + // case AllFalse: + // case AllTrue: + // case AnyFalse: + // case AnyTrue: + // case As: + // case Check: + // case Children: + // case Combine: + // case ConformsTo: + // case Contains: + // case ConvertsToBoolean: + // case ConvertsToDateTime: + // case ConvertsToDecimal: + // case ConvertsToInteger: + // case ConvertsToQuantity: + // case ConvertsToString: + // case ConvertsToTime: + // case Count: + // case Custom: + // case Descendants: + // case Distinct: + // case Empty: + // case EndsWith: + // case Exclude: + // case Exists: + // case Extension: + // case First: + // case HasValue: + // case HtmlChecks: + // case Iif: + // case IndexOf: + // case Intersect: + // case Is: + // case IsDistinct: + // case Item: + // case Last: + // case Length: + // case Lower: + // case Matches: + // case MemberOf: + // case Not: + // case Now: + // case OfType: + // case Repeat: + // case Replace: + // case ReplaceMatches: + // case Resolve: + // case Select: + // case Single: + // case Skip: + // case StartsWith: + // case SubsetOf: + // case Substring: + // case SupersetOf: + // case Tail: + // case Take: + // case ToBoolean: + // case ToChars: + // case ToDateTime: + // case ToDecimal: + // case ToInteger: + // case ToQuantity: + // case ToString: + // case ToTime: + // case Today: + // case Trace: + // case Type: + // case Union: + // case Upper: default: // TODO: unimplemented, what to do? } @@ -483,16 +486,16 @@ private void handleWhereFunctionNode(ExpressionNode fhirPath) { case PRIMITIVE_DATATYPE: this.handleWhereFunctionParam(param); break; - case COMPOSITE_DATATYPE: - case CONTAINED_RESOURCES: - case CONTAINED_RESOURCE_LIST: - case EXTENSION_DECLARED: - case ID_DATATYPE: - case PRIMITIVE_XHTML: - case PRIMITIVE_XHTML_HL7ORG: - case RESOURCE: - case RESOURCE_BLOCK: - case UNDECL_EXT: + // case COMPOSITE_DATATYPE: + // case CONTAINED_RESOURCES: + // case CONTAINED_RESOURCE_LIST: + // case EXTENSION_DECLARED: + // case ID_DATATYPE: + // case PRIMITIVE_XHTML: + // case PRIMITIVE_XHTML_HL7ORG: + // case RESOURCE: + // case RESOURCE_BLOCK: + // case UNDECL_EXT: default: // TODO: unimplemented. What to do? } @@ -556,6 +559,7 @@ private void handleWhereFunctionParam(ExpressionNode param) { case Times: case Union: case Xor: + default: // TODO: unimplemented, what to do? } } @@ -620,6 +624,7 @@ private void handleWhereFunctionParam(ExpressionNode param) { case Times: case Union: case Xor: + default: // TODO: need to implement above first } } @@ -632,7 +637,7 @@ private void handleWhereFunctionParam(ExpressionNode param) { * Creates a list all FHIRPaths from the mapping ordered by paths with where equals, where * unequals and the rest. * - * @return List a List of FHIRPaths ordered by the type. + * @return List<String> a List of FHIRPaths ordered by the type. */ private List sortedPaths() { List whereEquals = new ArrayList(); @@ -650,6 +655,9 @@ private List sortedPaths() { case WITHOUT_WHERE: withoutWhere.add(fhirPath); break; + default: + // not sure why checkstyle makes this necessary... + // the 3 above are the only options in the enum } } @@ -700,6 +708,7 @@ private PathType getTypeOfFhirPath(String fhirPath) { case Times: case Union: case Xor: + default: // TODO: need to implement above first } } diff --git a/src/main/java/org/mitre/synthea/export/flexporter/FhirPathUtils.java b/src/main/java/org/mitre/synthea/export/flexporter/FhirPathUtils.java index 69e91c1842..ca377c82fd 100644 --- a/src/main/java/org/mitre/synthea/export/flexporter/FhirPathUtils.java +++ b/src/main/java/org/mitre/synthea/export/flexporter/FhirPathUtils.java @@ -1,5 +1,7 @@ package org.mitre.synthea.export.flexporter; +import ca.uhn.fhir.context.FhirContext; + import java.util.ArrayList; import java.util.List; @@ -7,13 +9,12 @@ import org.hl7.fhir.r4.model.Base; import org.hl7.fhir.r4.model.BooleanType; import org.hl7.fhir.r4.model.Bundle; +import org.hl7.fhir.r4.model.Bundle.BundleEntryComponent; import org.hl7.fhir.r4.model.DateType; import org.hl7.fhir.r4.model.Patient; -import org.hl7.fhir.r4.model.Bundle.BundleEntryComponent; import org.hl7.fhir.r4.model.Resource; import org.hl7.fhir.r4.model.StringType; -import ca.uhn.fhir.context.FhirContext; public abstract class FhirPathUtils { public static final FhirContext FHIR_CTX = FhirContext.forR4(); @@ -31,7 +32,7 @@ public static List evaluateBundle(Bundle bundle, String fhirpath, boolean // NOTE: this doesn't check returnResources -- would that be useful here? return evaluateResource(bundle, fhirpath); } else { - // the fhirpath doesn't start with "Bundle" + // the fhirpath doesn't start with "Bundle" // so we'll apply it to each resource within the bundle List results = new ArrayList<>(); diff --git a/src/main/java/org/mitre/synthea/export/flexporter/FlexporterJavascriptContext.java b/src/main/java/org/mitre/synthea/export/flexporter/FlexporterJavascriptContext.java index 8cbe0cab2d..bd1de857d5 100644 --- a/src/main/java/org/mitre/synthea/export/flexporter/FlexporterJavascriptContext.java +++ b/src/main/java/org/mitre/synthea/export/flexporter/FlexporterJavascriptContext.java @@ -13,22 +13,22 @@ public class FlexporterJavascriptContext { private Value workingBundleAsJSObject; public FlexporterJavascriptContext() { - jsContext = Context.create("js"); - // TODO: if we want to add custom libraries like fhirpath or fhir-mapper, do it here -// try { -// -// for (String filename : Arrays.asList("fhirpath.js", "fhir-mapper.js") ) { -// String fileText = Files.readString(Path.of()); -// loadFunction(fileText); -// -// -// loadFile(filename); -// } -// System.out.println("All functions available from Java (as loaded into Bindings) " -// + jsContext.getBindings("js").getMemberKeys()); -// } catch (Exception e) { -// e.printStackTrace(); -// } + jsContext = Context.create("js"); + // TODO: if we want to add custom libraries like fhirpath or fhir-mapper, do it here + // try { + + // for (String filename : Arrays.asList("fhirpath.js", "fhir-mapper.js") ) { + // String fileText = Files.readString(Path.of()); + // loadFunction(fileText); + + + // loadFile(filename); + // } + // System.out.println("All functions available from Java (as loaded into Bindings) " + // + jsContext.getBindings("js").getMemberKeys()); + // } catch (Exception e) { + // e.printStackTrace(); + // } } public void loadFile(String filename) throws IOException { @@ -60,8 +60,9 @@ public String getBundle() { } public void applyFunctionToBundle(String fnName) { - // assumption is the fn has already been loaded by loadFunction - // good news -- based on testing, if the bundle is modified in-place in the JS context then our variable "sees" those updates + // assumption is the fn has already been loaded by loadFunction. + // good news -- based on testing, if the bundle is modified in-place + // in the JS context then our variable "sees" those updates. // (the variable maintains a reference to the object within the JS VM) Value applyFn = jsContext.getBindings("js").getMember(fnName); diff --git a/src/main/java/org/mitre/synthea/export/flexporter/ValueTransforms.java b/src/main/java/org/mitre/synthea/export/flexporter/ValueTransforms.java index 025b25f889..67f1798f17 100644 --- a/src/main/java/org/mitre/synthea/export/flexporter/ValueTransforms.java +++ b/src/main/java/org/mitre/synthea/export/flexporter/ValueTransforms.java @@ -67,8 +67,10 @@ public static String toDate(String src) { } public static String toTime(String src) { - if (src == null) + if (src == null) { return null; + } + ZonedDateTime dateTime = parse(src); return DateTimeFormatter.ISO_LOCAL_TIME.format(dateTime); @@ -79,7 +81,7 @@ public static String toTime(String src) { private static final DateTimeFormatter YEAR_MONTH = DateTimeFormatter.ofPattern("yyyy-MM"); private static final ZoneId UTC = ZoneId.of("UTC"); - + private static ZonedDateTime parse(String src) { // assume src is one of the four formats already diff --git a/src/main/java/org/mitre/synthea/helpers/RandomCodeGenerator.java b/src/main/java/org/mitre/synthea/helpers/RandomCodeGenerator.java index 1837eef51f..64ac6802d2 100644 --- a/src/main/java/org/mitre/synthea/helpers/RandomCodeGenerator.java +++ b/src/main/java/org/mitre/synthea/helpers/RandomCodeGenerator.java @@ -100,7 +100,8 @@ public static boolean codeInValueSet(Code code, String valueSetUri) { for (Object cachedCodeObj : cachedCodeList) { Map cachedCode = (Map)cachedCodeObj; - if (cachedCode.get("system").equals(code.system) && cachedCode.get("code").equals(code.code)) { + if (cachedCode.get("system").equals(code.system) + && cachedCode.get("code").equals(code.code)) { return true; } } @@ -166,7 +167,8 @@ public static void loadValueSet(String valueSetUri, Map valueSet for (Map include : includeList) { String system = (String)include.get("system"); - List> conceptList = (List>) include.get("concept"); + List> conceptList = + (List>) include.get("concept"); for (Map concept : conceptList) { Map codeAsMap = new HashMap<>(); From 3677728d797713cc250feda6a5667939158eaec8 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Mon, 12 Dec 2022 14:57:48 -0500 Subject: [PATCH 17/78] fix all remaining checkstyle issues --- src/main/java/RunFlexporter.java | 30 +++-- .../org/mitre/synthea/export/Exporter.java | 12 +- .../synthea/export/flexporter/Actions.java | 104 +++++++++++++++--- .../CustomFHIRPathResourceGeneratorR4.java | 20 ++-- .../export/flexporter/FhirPathUtils.java | 39 ++++++- .../FlexporterJavascriptContext.java | 58 ++++++---- .../synthea/export/flexporter/Mapping.java | 6 + .../export/flexporter/ValueTransforms.java | 29 ++++- .../synthea/helpers/RandomCodeGenerator.java | 26 ++++- .../export/flexporter/ActionsTest.java | 10 +- ...CustomFHIRPathResourceGeneratorR4Test.java | 11 +- .../FlexporterJavaScriptContextTest.java | 4 +- 12 files changed, 263 insertions(+), 86 deletions(-) diff --git a/src/main/java/RunFlexporter.java b/src/main/java/RunFlexporter.java index bdfb10e687..a3d63e8aaa 100644 --- a/src/main/java/RunFlexporter.java +++ b/src/main/java/RunFlexporter.java @@ -22,14 +22,29 @@ import org.hl7.fhir.r4.model.Bundle.BundleEntryComponent; import org.hl7.fhir.r4.model.Resource; import org.hl7.fhir.r4.model.ValueSet; +import org.mitre.synthea.export.FhirR4; import org.mitre.synthea.export.flexporter.Actions; -import org.mitre.synthea.export.flexporter.FhirPathUtils; import org.mitre.synthea.export.flexporter.FlexporterJavascriptContext; import org.mitre.synthea.export.flexporter.Mapping; import org.mitre.synthea.helpers.RandomCodeGenerator; - +/** + * Entrypoint for the "Flexporter" when run as a standalone gradle task. + * The Flexporter is primarily expected to be used to apply transformations + * to newly generated Synthea patients, but can also be run against existing FHIR bundles. + * These bundles are assumed to have been generated by Synthea, but depending on the mapping, + * they don't necessarily have to be. + */ public class RunFlexporter { + + /** + * Main method. Invoke the flexporter with given arguments: + * -fm {Flexporter Mapping file path} + * -s {Source FHIR file path} + * -ig {Implementation Guide file path} + * + * @param args Command line args as described above + */ public static void main(String[] args) throws Exception { Queue argsQ = new LinkedList(Arrays.asList(args)); @@ -96,13 +111,13 @@ public static void main(String[] args) throws Exception { } - public static Bundle convertFhir(Bundle bundle, Mapping mapping) { + private static Bundle convertFhir(Bundle bundle, Mapping mapping) { Actions.applyMapping(bundle, mapping, null, new FlexporterJavascriptContext()); return bundle; } - public static void convertFhir(File mappingFile, File igDirectory, File sourceFhir) + private static void convertFhir(File mappingFile, File igDirectory, File sourceFhir) throws IOException { Mapping mapping = Mapping.parseMapping(mappingFile); @@ -111,7 +126,7 @@ public static void convertFhir(File mappingFile, File igDirectory, File sourceFh loadIG(igDirectory); } - IParser parser = FhirPathUtils.FHIR_CTX.newJsonParser().setPrettyPrint(true); + IParser parser = FhirR4.getContext().newJsonParser().setPrettyPrint(true); if (sourceFhir.isDirectory()) { @@ -134,8 +149,7 @@ public static void convertFhir(File mappingFile, File igDirectory, File sourceFh } } - // bundle is modified in-place - convertFhir(bundle, mapping); + bundle = convertFhir(bundle, mapping); String bundleJson = parser.encodeResourceToString(bundle); @@ -158,7 +172,7 @@ static void loadIG(File igDirectory) throws IOException { for (File artifact : artifacts) { if (artifact.isFile() && FilenameUtils.getExtension(artifact.toString()).equals("json")) { - IParser parser = FhirPathUtils.FHIR_CTX.newJsonParser(); + IParser parser = FhirR4.getContext().newJsonParser(); String fhirJson = new String(Files.readAllBytes(artifact.toPath())); IBaseResource resource = null; diff --git a/src/main/java/org/mitre/synthea/export/Exporter.java b/src/main/java/org/mitre/synthea/export/Exporter.java index efde62fdce..7ac16fe578 100644 --- a/src/main/java/org/mitre/synthea/export/Exporter.java +++ b/src/main/java/org/mitre/synthea/export/Exporter.java @@ -20,10 +20,6 @@ import java.util.concurrent.LinkedBlockingQueue; import java.util.function.Predicate; -import javax.script.Invocable; -import javax.script.ScriptEngine; -import javax.script.ScriptEngineManager; - import org.apache.commons.lang3.tuple.ImmutablePair; import org.apache.commons.lang3.tuple.Pair; @@ -129,6 +125,11 @@ public boolean isRecordQueueEmpty() { return recordQueue == null || recordQueue.size() == 0; } + /** + * Register a new Flexporter mapping to be applied to Bundles from the FHIR exporter. + * Multiple mappings may be added and will be processed in order. + * @param mapping Flexporter mapping to add to list + */ public void addFlexporterMapping(Mapping mapping) { if (this.flexporterMappings == null) { this.flexporterMappings = new LinkedList<>(); @@ -247,12 +248,11 @@ private static boolean exportRecord(Person person, String fileTag, long stopTime org.hl7.fhir.r4.model.Bundle bundle = FhirR4.convertToFHIR(person, stopTime); if (options.flexporterMappings != null) { - FlexporterJavascriptContext fjContext = new FlexporterJavascriptContext(); for (Mapping mapping : options.flexporterMappings) { // flexport on the bundle here - Actions.applyMapping(bundle, mapping, person, fjContext); + bundle = Actions.applyMapping(bundle, mapping, person, fjContext); } } diff --git a/src/main/java/org/mitre/synthea/export/flexporter/Actions.java b/src/main/java/org/mitre/synthea/export/flexporter/Actions.java index 05e8a80625..5ea489e58a 100644 --- a/src/main/java/org/mitre/synthea/export/flexporter/Actions.java +++ b/src/main/java/org/mitre/synthea/export/flexporter/Actions.java @@ -20,6 +20,7 @@ import org.hl7.fhir.r4.model.Bundle.HTTPVerb; import org.hl7.fhir.r4.model.Meta; import org.hl7.fhir.r4.model.Resource; +import org.mitre.synthea.export.FhirR4; import org.mitre.synthea.helpers.RandomCodeGenerator; import org.mitre.synthea.world.agents.Person; @@ -27,6 +28,16 @@ @SuppressWarnings("unchecked") public abstract class Actions { + /** + * Apply the given Mapping to the provided Bundle. + * @param bundle FHIR bundle + * @param mapping Flexporter mapping + * @param person Synthea Person object that was used to create the Bundle. + * This will be null if running the flexporter standalone from the run_flexporter task. + * @param fjContext Flexporter Javascript Context associated with this run + * @return the Bundle after all transformations have been applied. + * Important: in many cases it will be the same Bundle object as passed in, but not always! + */ public static Bundle applyMapping(Bundle bundle, Mapping mapping, Person person, FlexporterJavascriptContext fjContext) { @@ -37,6 +48,16 @@ public static Bundle applyMapping(Bundle bundle, Mapping mapping, Person person, return bundle; } + /** + * Apply the given single Action to the provided Bundle. + * @param bundle FHIR bundle + * @param action Flexporter action + * @param person Synthea Person object that was used to create the Bundle. + * This will be null if running the flexporter standalone from the run_flexporter task. + * @param fjContext Flexporter Javascript Context associated with this run + * @return the Bundle after the transformation has been applied. + * Important: in many cases it will be the same Bundle object as passed in, but not always! + */ public static Bundle applyAction(Bundle bundle, Map action, Person person, FlexporterJavascriptContext fjContext) { // TODO: this could be handled better but for now just key off a specific field in the action @@ -60,20 +81,24 @@ public static Bundle applyAction(Bundle bundle, Map action, Pers createResource(bundle, (List>) action.get("create_resource"), person, null); - } else if (action.containsKey("create_resource_js")) { - createResource(bundle, (List>) action.get("create_resource_js"), person, - fjContext); - } else if (action.containsKey("execute_script")) { returnBundle = executeScript((List>) action.get("execute_script"), bundle, fjContext); - } return returnBundle; } + /** + * Apply a profile to resources matching certain rules. Note this only adds the profile URL to + * resource.meta.profile, it does not apply any other transformations or checking. + * Resources to apply the profile to are selected by FHIRPath. (Or simply resource type) + * + * @param bundle Bundle to apply profiles to + * @param items List of rule definitions for applying profiles. Each item should have a "profile" + * for the URL and "applicability" for the FHIRPath to select resources. + */ public static void applyProfiles(Bundle bundle, List> items) { // TODO: might it be faster to loop over all the resources // and check applicability for each item only once? @@ -91,7 +116,14 @@ public static void applyProfiles(Bundle bundle, List> items) } } - private static void applyProfile(Resource resource, String profileURL) { + /** + * Helper function to add a single profile URL to a resource, + * and set the Meta if not already set. + * + * @param resource FHIR resource + * @param profileURL Profile URL to add, if not already present + */ + public static void applyProfile(Resource resource, String profileURL) { Meta meta = resource.getMeta(); if (meta == null) { meta = new Meta(); @@ -102,6 +134,16 @@ private static void applyProfile(Resource resource, String profileURL) { } } + /** + * Set values on existing resources within the Bundle, based on rules. + * + * @param bundle Bundle to apply rules to + * @param items List of rules. Rules include "applicability" to select which resources to apply + * values to, and "fields" which are "location" and "value" pairs defining which field to set + * and what value to put there. + * @param person Synthea person object to fetch values from (e.g, attributes). May be null + * @param fjContext Javascript context for this run + */ public static void setValues(Bundle bundle, List> items, Person person, FlexporterJavascriptContext fjContext) { for (Map entry : items) { @@ -116,7 +158,7 @@ public static void setValues(Bundle bundle, List> items, Per createFhirPathMapping(fields, bundle, (Resource) match, person, fjContext); CustomFHIRPathResourceGeneratorR4 fhirPathgenerator = - new CustomFHIRPathResourceGeneratorR4<>(FhirPathUtils.FHIR_CTX); + new CustomFHIRPathResourceGeneratorR4<>(); fhirPathgenerator.setMapping(fhirPathMapping); fhirPathgenerator.setResource((Resource) match); @@ -126,7 +168,18 @@ public static void setValues(Bundle bundle, List> items, Per } } - + /** + * Create new resources to add to the Bundle, either a single resource or a resource based on + * other instances of existing resources. Fields on the resource as well as the "based on" + * resource will be set based on rules. + * + * @param bundle Bundle to add resources to + * @param resourcesToCreate List of rules. Rules include a "resourceType", optionally a "based_on" + * FHIRPath to select resources to base the new one off of, and "fields" which are "location" + * and "value" pairs defining which field to set and what value. + * @param person Synthea person object to fetch values from (e.g, attributes). May be null + * @param fjContext Javascript context for this run + */ public static void createResource(Bundle bundle, List> resourcesToCreate, Person person, FlexporterJavascriptContext fjContext) { // TODO: this is fundamentally similar to setValues, so extract common logic @@ -159,7 +212,7 @@ public static void createResource(Bundle bundle, List> resou createFhirPathMapping(fields, bundle, (Resource) basedOnItem, person, fjContext); CustomFHIRPathResourceGeneratorR4 fhirPathgenerator = - new CustomFHIRPathResourceGeneratorR4<>(FhirPathUtils.FHIR_CTX); + new CustomFHIRPathResourceGeneratorR4<>(); fhirPathgenerator.setMapping(fhirPathMapping); Resource createdResource = fhirPathgenerator.generateResource(resourceType); @@ -189,7 +242,7 @@ public static void createResource(Bundle bundle, List> resou createFhirPathMapping(writeback, bundle, createdResource, person, fjContext); CustomFHIRPathResourceGeneratorR4 writebackGenerator = - new CustomFHIRPathResourceGeneratorR4<>(FhirPathUtils.FHIR_CTX); + new CustomFHIRPathResourceGeneratorR4<>(); writebackGenerator.setMapping(writebackMapping); writebackGenerator.setResource((Resource) basedOnItem); @@ -240,7 +293,6 @@ private static Map createFhirPathMapping(List fhirPathMapping, } } + /** + * Filter the Bundle by only keeping selected resources. + * + * @param bundle FHIR Bundle to filter + * @param list List of resource types to retain, all other types not listed will be removed + */ public static void keepResources(Bundle bundle, List list) { // TODO: make this FHIRPath instead of just straight resource types @@ -306,7 +364,12 @@ public static void keepResources(Bundle bundle, List list) { // TODO: additional passes for deleted resource IDs } - + /** + * Filter the Bundle by removing selected resources. + * + * @param bundle FHIR Bundle to filter + * @param list List of resource types to delete, all other types not listed will be kept + */ public static void deleteResources(Bundle bundle, List list) { // TODO: make this FHIRPath instead of just straight resource types @@ -330,15 +393,26 @@ public static void deleteResources(Bundle bundle, List list) { // TODO: additional passes for deleted resource IDs } - private static Bundle executeScript(List> fields, Bundle bundle, + /** + * Execute scripts against the given Bundle. + * + * @param scripts Script definitions, containing a definition of one or more JS functions, the + * name of the function to invoke, and whether it applies to the bundle as a whole, or to the + * individual resources. + * @param bundle FHIR bundle to apply scripts against + * @param fjContext Javascript context for this run + * @return The new Bundle. IMPORTANT - using the JS context will always result in a new bundle, + * not modify the existing one in-place. + */ + public static Bundle executeScript(List> scripts, Bundle bundle, FlexporterJavascriptContext fjContext) { - IParser parser = FhirPathUtils.FHIR_CTX.newJsonParser(); + IParser parser = FhirR4.getContext().newJsonParser(); String bundleJson = parser.encodeResourceToString(bundle); fjContext.loadBundle(bundleJson); - for (Map scriptDef : fields) { + for (Map scriptDef : scripts) { String function = scriptDef.get("function"); String functionName = scriptDef.get("function_name"); diff --git a/src/main/java/org/mitre/synthea/export/flexporter/CustomFHIRPathResourceGeneratorR4.java b/src/main/java/org/mitre/synthea/export/flexporter/CustomFHIRPathResourceGeneratorR4.java index 84f29fa246..69b278d0a3 100644 --- a/src/main/java/org/mitre/synthea/export/flexporter/CustomFHIRPathResourceGeneratorR4.java +++ b/src/main/java/org/mitre/synthea/export/flexporter/CustomFHIRPathResourceGeneratorR4.java @@ -22,15 +22,16 @@ import org.hl7.fhir.r4.model.ExpressionNode.Kind; import org.hl7.fhir.r4.model.Resource; import org.hl7.fhir.r4.utils.FHIRPathEngine; +import org.mitre.synthea.export.FhirR4; /** * This class can be used to generate resources using FHIRPath expressions. * - * Note that this is an experimental feature and the API is expected to change. Ideally this will be - * made version independent and moved out of the validation module in a future release. + *

Note that this is an experimental feature and the API is expected to change. + * Ideally this will be made version independent in a future release. * - * Modified for the Flexporter: + *

Modified for the Flexporter: * -- allow adding to an existing resource * -- add class lookup by resourceType * -- add support for BackboneElements @@ -40,7 +41,7 @@ * (some functions now take in Class<? extends T> instead of just T) * -- reformatted per Synthea style guidelines * - * Original: + *

Original: * https://github.com/hapifhir/hapi-fhir/blob/master/hapi-fhir-validation/src/main/java/org/hl7/fhir/common/hapi/validation/validator/FHIRPathResourceGeneratorR4.java * * @@ -80,15 +81,11 @@ public GenerationTier(BaseRuntimeElementDefinition nodeDef, IBase firstNode) } /** - * Constructor without parameters, needs a call to `setMapping` later on in order to generate any + * Default constructor, needs a call to `setMapping` later on in order to generate any * Resources. */ public CustomFHIRPathResourceGeneratorR4() { - this(FhirContext.forR4()); - } - - public CustomFHIRPathResourceGeneratorR4(FhirContext fhirCtx) { - this.ctx = fhirCtx; + this.ctx = FhirR4.getContext(); this.pathMapping = new HashMap(); this.engine = new FHIRPathEngine(new HapiWorkerContext(ctx, ctx.getValidationSupport())); } @@ -262,8 +259,6 @@ private void handlePrimitiveNode(ExpressionNode fhirPath) { // create a nodeDefinition for the next tier nextTier.nodeDefinition = nextTier.childDefinition.getChildByName(nextTier.fhirPathName); - - // Get the primitive type definition from the childDeftinion RuntimePrimitiveDatatypeDefinition primitiveTarget = (RuntimePrimitiveDatatypeDefinition) nextTier.childDefinition @@ -288,7 +283,6 @@ private void handlePrimitiveNode(ExpressionNode fhirPath) { nextTier.childDefinition.getMutator().addValue(nodeElement, primitive); } - nextTier.nodes.add(primitive); } diff --git a/src/main/java/org/mitre/synthea/export/flexporter/FhirPathUtils.java b/src/main/java/org/mitre/synthea/export/flexporter/FhirPathUtils.java index ca377c82fd..9f933fca90 100644 --- a/src/main/java/org/mitre/synthea/export/flexporter/FhirPathUtils.java +++ b/src/main/java/org/mitre/synthea/export/flexporter/FhirPathUtils.java @@ -1,7 +1,5 @@ package org.mitre.synthea.export.flexporter; -import ca.uhn.fhir.context.FhirContext; - import java.util.ArrayList; import java.util.List; @@ -10,21 +8,41 @@ import org.hl7.fhir.r4.model.BooleanType; import org.hl7.fhir.r4.model.Bundle; import org.hl7.fhir.r4.model.Bundle.BundleEntryComponent; -import org.hl7.fhir.r4.model.DateType; -import org.hl7.fhir.r4.model.Patient; import org.hl7.fhir.r4.model.Resource; import org.hl7.fhir.r4.model.StringType; +import org.mitre.synthea.export.FhirR4; public abstract class FhirPathUtils { - public static final FhirContext FHIR_CTX = FhirContext.forR4(); - private static final FhirPathR4 FHIRPATH = new FhirPathR4(FHIR_CTX); + private static final FhirPathR4 FHIRPATH = new FhirPathR4(FhirR4.getContext()); + /** + * Execute the given FHIRPath against the given resource and return the results. + * + * @param resource FHIR resource to execute FHIRPath against + * @param fhirpath FHIRPath string + * @return Raw values from FHIRPath engine evaluating the string + */ public static List evaluateResource(Resource resource, String fhirpath) { return FHIRPATH.evaluate(resource, fhirpath, Base.class); } + /** + * Execute the given FHIRPath against the given Bundle and return the results. There are a few + * different possibilities in how this works. + * - If the FHIRPath string starts with "Bundle" then this will execute the FHIRPath once + * against the Bundle as a whole, otherwise it will be executed against each resource. + * - If "returnResources" is true, then resources from the Bundle + * that return a truthy value will be returned, otherwise the raw value from the FHIRpath engine + * will be returned. + * + * @param bundle FHIR bundle to evaluate FHIRpath against + * @param fhirpath FHIRPath string + * @param returnResources If true, return resources from bundle matching FHIRPath; if false, + * return raw values from FHIRPath engine + * @return Differs based on input - see above + */ public static List evaluateBundle(Bundle bundle, String fhirpath, boolean returnResources) { if (fhirpath.startsWith("Bundle")) { // run it on the entire bundle @@ -60,6 +78,10 @@ public static boolean appliesToBundle(Bundle bundle, String fhirpath) { return isTruthy(evaluateBundle(bundle, fhirpath, false)); } + /** + * Helper function to convert FHIRPath evaluation primitives into a boolean. + * Nulls, empty strings, and boolean false all mean "false" here. Everything else means "true". + */ static boolean isTruthy(Base result) { if (result == null) { return false; @@ -74,6 +96,11 @@ static boolean isTruthy(Base result) { return true; } + /** + * Helper function to convert FHIRPath evaluation results into a boolean. + * FHIRPath.evaluate returns a List which is matching pieces of resources. + * This will return false if the list is empty, or if everything in the list is falsy. + */ static boolean isTruthy(List result) { if (result == null || result.isEmpty()) { return false; diff --git a/src/main/java/org/mitre/synthea/export/flexporter/FlexporterJavascriptContext.java b/src/main/java/org/mitre/synthea/export/flexporter/FlexporterJavascriptContext.java index bd1de857d5..e86faf7097 100644 --- a/src/main/java/org/mitre/synthea/export/flexporter/FlexporterJavascriptContext.java +++ b/src/main/java/org/mitre/synthea/export/flexporter/FlexporterJavascriptContext.java @@ -12,6 +12,9 @@ public class FlexporterJavascriptContext { private Value workingBundleAsJSObject; + /** + * Default constructor for a Javascript Context. + */ public FlexporterJavascriptContext() { jsContext = Context.create("js"); // TODO: if we want to add custom libraries like fhirpath or fhir-mapper, do it here @@ -31,16 +34,32 @@ public FlexporterJavascriptContext() { // } } + /** + * Load the JS file referenced by the given file path into the JS context. + * Globals registered in the given file will be accessible to other loaded functions. + * @param filename Path to a JS file + * @throws IOException if the file doesn't exist, can't be read, or can't be parsed as JS + */ public void loadFile(String filename) throws IOException { URL url = FlexporterJavascriptContext.class.getClassLoader().getResource("./lib/" + filename); jsContext.eval(Source.newBuilder("js", url).build()); } + /** + * Load a JS function from string. + * @param functionDef JavaScript code + */ public void loadFunction(String functionDef) { jsContext.eval("js", functionDef); } + /** + * Load a Bundle as the JS context's working bundle. + * All executed functions will use the bundle as an argument. + * + * @param bundleAsString Bundle as JSON string + */ public void loadBundle(String bundleAsString) { // workingBundleAsJSObject = JSON.parse(bundleAsString) @@ -49,6 +68,9 @@ public void loadBundle(String bundleAsString) { workingBundleAsJSObject = parseFn.execute(bundleAsString); } + /** + * Get the current working Bundle as a JSON string. + */ public String getBundle() { // return JSON.stringify(workingBundleAsJSObject) @@ -59,6 +81,13 @@ public String getBundle() { return bundleString; } + /** + * Applies a function to the working Bundle. + * Invoked as `fnName(bundle)` + * The function must have already been loaded by loadFile or loadFunction. + * + * @param fnName Function name to invoke + */ public void applyFunctionToBundle(String fnName) { // assumption is the fn has already been loaded by loadFunction. // good news -- based on testing, if the bundle is modified in-place @@ -69,6 +98,14 @@ public void applyFunctionToBundle(String fnName) { applyFn.execute(workingBundleAsJSObject); } + /** + * Applies a function to each resource within the Bundle. + * Invoked as `fnName(resource, bundle)`. + * (i.e., the bundle itself is also passed to the function as context) + * The function must have already been loaded by loadFile or loadFunction. + * + * @param fnName Function name to invoke + */ public void applyFunctionToResources(String fnName) { // assumption is the fn has already been loaded by loadFunction @@ -86,25 +123,4 @@ public void applyFunctionToResources(String fnName) { applyFn.execute(resource, workingBundleAsJSObject); } } - - public String exec(String fnName, String... args) { - Value applyFn = jsContext.getBindings("js").getMember(fnName); - Value processedJson = applyFn.execute((Object[])args); - - - Value applyFn2 = jsContext.getBindings("js").getMember("getField2"); - - Value result2 = applyFn2.execute(processedJson); - - return result2.asString(); - } - - public String applyTransforms(String fhirJson) { - Value applyFn = jsContext.getBindings("js").getMember("apply"); - Value processedJson = applyFn.execute(fhirJson); - - String result = processedJson.asString(); - - return result; - } } diff --git a/src/main/java/org/mitre/synthea/export/flexporter/Mapping.java b/src/main/java/org/mitre/synthea/export/flexporter/Mapping.java index d57107d6f0..f185f658cb 100644 --- a/src/main/java/org/mitre/synthea/export/flexporter/Mapping.java +++ b/src/main/java/org/mitre/synthea/export/flexporter/Mapping.java @@ -19,6 +19,12 @@ public class Mapping { */ public List> actions; + /** + * Read the provided file into a Mapping. + * @param mappingFile Source file to read content from + * @return Mapping object + * @throws FileNotFoundException if the file doesn't exist + */ public static Mapping parseMapping(File mappingFile) throws FileNotFoundException { InputStream selectorInputSteam = new FileInputStream(mappingFile); Yaml yaml = new Yaml(new org.yaml.snakeyaml.constructor.Constructor(Mapping.class)); diff --git a/src/main/java/org/mitre/synthea/export/flexporter/ValueTransforms.java b/src/main/java/org/mitre/synthea/export/flexporter/ValueTransforms.java index 67f1798f17..abf3c86c30 100644 --- a/src/main/java/org/mitre/synthea/export/flexporter/ValueTransforms.java +++ b/src/main/java/org/mitre/synthea/export/flexporter/ValueTransforms.java @@ -1,13 +1,19 @@ package org.mitre.synthea.export.flexporter; import java.time.LocalDate; -import java.time.LocalDateTime; import java.time.ZoneId; import java.time.ZonedDateTime; import java.time.format.DateTimeFormatter; public abstract class ValueTransforms { + /** + * Apply the selected Value Transform on the given value. + * + * @param originalValue Source value + * @param transformName Name of the transform to apply + * @return transformed value + */ public static String apply(String originalValue, String transformName) { if (transformName == null) { return originalValue; @@ -39,7 +45,11 @@ public static String apply(String originalValue, String transformName) { return newValue; } - + /** + * Convert the given date/time string into an Instant. + * @param src Source date/time string + * @return Input date/time reformatted as an Instant + */ public static String toInstant(String src) { if (src == null) { return null; @@ -50,12 +60,22 @@ public static String toInstant(String src) { return dateTime.toInstant().toString(); } + /** + * Convert the given date/time string into a DateTime. + * @param src Source date/time string + * @return Input date/time reformatted as a DateTime + */ public static String toDateTime(String src) { ZonedDateTime dateTime = parse(src); return dateTime.toInstant().toString(); } + /** + * Convert the given date/time string into a Date. + * @param src Source date/time string + * @return Input date/time reformatted as a Date + */ public static String toDate(String src) { if (src == null) { return null; @@ -66,6 +86,11 @@ public static String toDate(String src) { return DateTimeFormatter.ISO_LOCAL_DATE.format(dateTime); } + /** + * Convert the given date/time string into a Time. + * @param src Source date/time string + * @return Input date/time reformatted as a Time + */ public static String toTime(String src) { if (src == null) { return null; diff --git a/src/main/java/org/mitre/synthea/helpers/RandomCodeGenerator.java b/src/main/java/org/mitre/synthea/helpers/RandomCodeGenerator.java index 64ac6802d2..23b934776f 100644 --- a/src/main/java/org/mitre/synthea/helpers/RandomCodeGenerator.java +++ b/src/main/java/org/mitre/synthea/helpers/RandomCodeGenerator.java @@ -51,7 +51,6 @@ public abstract class RandomCodeGenerator { * a random seed to ensure reproducibility of this result * @return the randomly selected Code */ - @SuppressWarnings("unchecked") public static Code getCode(String valueSetUri, long seed, Code code) { if (urlValidator.isValid(valueSetUri)) { Map codeMap = getCodeAsMap(valueSetUri, seed); @@ -63,6 +62,16 @@ public static Code getCode(String valueSetUri, long seed, Code code) { return code; } + /** + * Gets a random code from the expansion of a ValueSet, represented as a Map. + * + * @param valueSetUri + * the URI of the ValueSet + * @param seed + * a random seed to ensure reproducibility of this result + * @return the randomly selected code as a Map of String -> String + */ + @SuppressWarnings("unchecked") public static Map getCodeAsMap(String valueSetUri, long seed) { if (urlValidator.isValid(valueSetUri)) { expandValueSet(valueSetUri); @@ -75,6 +84,14 @@ public static Map getCodeAsMap(String valueSetUri, long seed) { return null; } + /** + * Check whether the given code is in the given ValueSet. + * + * @param code Code to check + * @param valueSetUri URI of the ValueSet to check the code for + * @return true if the code is in the given valueset + */ + @SuppressWarnings("unchecked") // TODO: this does not belong here, but this class is where the code cache is public static boolean codeInValueSet(Code code, String valueSetUri) { if (urlValidator.isValid(valueSetUri)) { @@ -110,7 +127,7 @@ public static boolean codeInValueSet(Code code, String valueSetUri) { return false; } - @SuppressWarnings("unchecked") + private static synchronized void expandValueSet(String valueSetUri) { if (!codeListCache.containsKey(valueSetUri)) { Request request = new Request.Builder() @@ -139,6 +156,11 @@ private static synchronized void expandValueSet(String valueSetUri) { } } + /** + * Load the given value set into our cache. + * @param valueSetUri URI to reference this value set + * @param valueSet Parsed JSON representation of FHIR valueset + */ @SuppressWarnings("unchecked") public static void loadValueSet(String valueSetUri, Map valueSet) { if (valueSetUri == null) { diff --git a/src/test/java/org/mitre/synthea/export/flexporter/ActionsTest.java b/src/test/java/org/mitre/synthea/export/flexporter/ActionsTest.java index 46fac5c12e..30db75b0ff 100644 --- a/src/test/java/org/mitre/synthea/export/flexporter/ActionsTest.java +++ b/src/test/java/org/mitre/synthea/export/flexporter/ActionsTest.java @@ -39,6 +39,7 @@ import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; +import org.mitre.synthea.export.FhirR4; import org.mitre.synthea.world.agents.Person; public class ActionsTest { @@ -52,6 +53,9 @@ private static Map buildApplyProfileAction(String profile, Strin private static Mapping testMapping; + /** + * Class setup - load the mapping file containing all tests. + */ @BeforeClass public static void setupClass() throws FileNotFoundException { ClassLoader classLoader = ActionsTest.class.getClassLoader(); @@ -70,7 +74,7 @@ private static Map getActionByName(String name) { } private static Bundle loadFixtureBundle(String filename) throws IOException { - IParser parser = FhirPathUtils.FHIR_CTX.newJsonParser().setPrettyPrint(true); + IParser parser = FhirR4.getContext().newJsonParser(); ClassLoader classLoader = ActionsTest.class.getClassLoader(); File file = new File(classLoader.getResource("flexporter/" + filename).getFile()); @@ -78,8 +82,6 @@ private static Bundle loadFixtureBundle(String filename) throws IOException { return parser.parseResource(Bundle.class, fhirJson); } - - @Test public void testApplyProfiles() { Patient p = new Patient(); @@ -100,7 +102,6 @@ public void testApplyProfiles() { assertEquals("http://example.com/Patient", p.getMeta().getProfile().get(0).getValueAsString()); } - @Test public void testApplyProfilesNoMatch() { Patient p = new Patient(); @@ -118,7 +119,6 @@ public void testApplyProfilesNoMatch() { || p.getMeta().getProfile().size() == 0); } - @Test public void testApplyProfilesComplexFhirPath() { Patient p = new Patient(); diff --git a/src/test/java/org/mitre/synthea/export/flexporter/CustomFHIRPathResourceGeneratorR4Test.java b/src/test/java/org/mitre/synthea/export/flexporter/CustomFHIRPathResourceGeneratorR4Test.java index 53cafac390..5e5542428c 100644 --- a/src/test/java/org/mitre/synthea/export/flexporter/CustomFHIRPathResourceGeneratorR4Test.java +++ b/src/test/java/org/mitre/synthea/export/flexporter/CustomFHIRPathResourceGeneratorR4Test.java @@ -19,30 +19,29 @@ import org.hl7.fhir.r4.model.StringType; import org.junit.Ignore; import org.junit.Test; +import org.mitre.synthea.export.FhirR4; public class CustomFHIRPathResourceGeneratorR4Test { - // share a context because these are slow to create - private static final FhirContext CTX = FhirPathUtils.FHIR_CTX; - @SuppressWarnings("unused") private static void logPatientJson(Patient p) { - String patientJson = CTX.newJsonParser().setPrettyPrint(true).encodeResourceToString(p); + String patientJson = FhirR4.getContext().newJsonParser().setPrettyPrint(true) + .encodeResourceToString(p); System.out.println(patientJson); } private Patient createPatient(Map fhirPathMapping) { CustomFHIRPathResourceGeneratorR4 fhirPathGenerator = - new CustomFHIRPathResourceGeneratorR4<>(CTX); + new CustomFHIRPathResourceGeneratorR4<>(); fhirPathGenerator.setMapping(fhirPathMapping); return fhirPathGenerator.generateResource(Patient.class); } private void updatePatient(Patient p, Map fhirPathMapping) { CustomFHIRPathResourceGeneratorR4 fhirPathGenerator = - new CustomFHIRPathResourceGeneratorR4<>(CTX); + new CustomFHIRPathResourceGeneratorR4<>(); fhirPathGenerator.setResource(p); fhirPathGenerator.setMapping(fhirPathMapping); fhirPathGenerator.generateResource(Patient.class); diff --git a/src/test/java/org/mitre/synthea/export/flexporter/FlexporterJavaScriptContextTest.java b/src/test/java/org/mitre/synthea/export/flexporter/FlexporterJavaScriptContextTest.java index b001e54a5b..c4cfde18d6 100644 --- a/src/test/java/org/mitre/synthea/export/flexporter/FlexporterJavaScriptContextTest.java +++ b/src/test/java/org/mitre/synthea/export/flexporter/FlexporterJavaScriptContextTest.java @@ -10,6 +10,7 @@ import org.hl7.fhir.r4.model.DomainResource; import org.hl7.fhir.r4.model.Patient; import org.junit.Test; +import org.mitre.synthea.export.FhirR4; public class FlexporterJavaScriptContextTest { @@ -37,8 +38,7 @@ public void testJavascriptContext() { Bundle b = new Bundle(); b.addEntry().setResource(p); - - IParser parser = FhirPathUtils.FHIR_CTX.newJsonParser(); + IParser parser = FhirR4.getContext().newJsonParser(); String bundleJson = parser.encodeResourceToString(b); context.loadBundle(bundleJson); From 9bff969731d5d19a8d070dbe21277a59a4b3b645 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Mon, 12 Dec 2022 15:19:17 -0500 Subject: [PATCH 18/78] fix javadoc error --- .../java/org/mitre/synthea/helpers/RandomCodeGenerator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/mitre/synthea/helpers/RandomCodeGenerator.java b/src/main/java/org/mitre/synthea/helpers/RandomCodeGenerator.java index 23b934776f..45fe10a612 100644 --- a/src/main/java/org/mitre/synthea/helpers/RandomCodeGenerator.java +++ b/src/main/java/org/mitre/synthea/helpers/RandomCodeGenerator.java @@ -69,7 +69,7 @@ public static Code getCode(String valueSetUri, long seed, Code code) { * the URI of the ValueSet * @param seed * a random seed to ensure reproducibility of this result - * @return the randomly selected code as a Map of String -> String + * @return the randomly selected code as a Map of Strings */ @SuppressWarnings("unchecked") public static Map getCodeAsMap(String valueSetUri, long seed) { From 6e8b0ccc3f39a1360606b176d1fec13cf168535a Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Tue, 13 Dec 2022 14:46:21 -0500 Subject: [PATCH 19/78] a couple sonatype fixes --- build.gradle | 2 +- src/main/java/RunFlexporter.java | 8 +++++--- src/main/java/org/mitre/synthea/export/Exporter.java | 2 +- .../org/mitre/synthea/helpers/RandomCodeGenerator.java | 3 +++ 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/build.gradle b/build.gradle index f1ebe6fe90..03dbfb997a 100644 --- a/build.gradle +++ b/build.gradle @@ -79,7 +79,7 @@ dependencies { // CSV Stuff implementation 'org.apache.commons:commons-csv:1.9.0' implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-csv:2.13.4' - implementation 'org.yaml:snakeyaml:1.32' + implementation 'org.yaml:snakeyaml:1.33' implementation 'org.apache.commons:commons-math3:3.6.1' implementation 'org.apache.commons:commons-text:1.9' implementation 'commons-validator:commons-validator:1.7' diff --git a/src/main/java/RunFlexporter.java b/src/main/java/RunFlexporter.java index a3d63e8aaa..360c32be74 100644 --- a/src/main/java/RunFlexporter.java +++ b/src/main/java/RunFlexporter.java @@ -7,12 +7,13 @@ import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; +import java.nio.charset.Charset; import java.nio.file.DirectoryStream; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.StandardOpenOption; +import java.util.ArrayDeque; import java.util.Arrays; -import java.util.LinkedList; import java.util.Map; import java.util.Queue; @@ -46,7 +47,7 @@ public class RunFlexporter { * @param args Command line args as described above */ public static void main(String[] args) throws Exception { - Queue argsQ = new LinkedList(Arrays.asList(args)); + Queue argsQ = new ArrayDeque(Arrays.asList(args)); File igDirectory = null; File sourceFile = null; @@ -160,7 +161,8 @@ private static void convertFhir(File mappingFile, File igDirectory, File sourceF File outFile = new File("./output/flexporter/" + outFileName); - Files.write(outFile.toPath(), bundleJson.getBytes(), StandardOpenOption.CREATE_NEW); + Files.write(outFile.toPath(), bundleJson.getBytes(Charset.defaultCharset()), + StandardOpenOption.CREATE_NEW); System.out.println("Wrote " + outFile); } diff --git a/src/main/java/org/mitre/synthea/export/Exporter.java b/src/main/java/org/mitre/synthea/export/Exporter.java index 7ac16fe578..c8139358b0 100644 --- a/src/main/java/org/mitre/synthea/export/Exporter.java +++ b/src/main/java/org/mitre/synthea/export/Exporter.java @@ -132,7 +132,7 @@ public boolean isRecordQueueEmpty() { */ public void addFlexporterMapping(Mapping mapping) { if (this.flexporterMappings == null) { - this.flexporterMappings = new LinkedList<>(); + this.flexporterMappings = new ArrayList<>(); } this.flexporterMappings.add(mapping); diff --git a/src/main/java/org/mitre/synthea/helpers/RandomCodeGenerator.java b/src/main/java/org/mitre/synthea/helpers/RandomCodeGenerator.java index 45fe10a612..17f4b93d1a 100644 --- a/src/main/java/org/mitre/synthea/helpers/RandomCodeGenerator.java +++ b/src/main/java/org/mitre/synthea/helpers/RandomCodeGenerator.java @@ -54,6 +54,9 @@ public abstract class RandomCodeGenerator { public static Code getCode(String valueSetUri, long seed, Code code) { if (urlValidator.isValid(valueSetUri)) { Map codeMap = getCodeAsMap(valueSetUri, seed); + if (codeMap == null) { + return code; + } validateCode(codeMap); Code newCode = new Code(codeMap.get("system"), codeMap.get("code"), codeMap.get("display")); selectedCodes.add(newCode); From 66eb1133c928cbbe5af14763805b8cb1a17f2c96 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Thu, 22 Dec 2022 12:16:56 -0500 Subject: [PATCH 20/78] top-level applicability now works --- src/main/java/RunFlexporter.java | 5 ++++- .../java/org/mitre/synthea/export/Exporter.java | 13 ++++++++++--- .../mitre/synthea/export/flexporter/Actions.java | 1 - src/test/resources/flexporter/mcode.yml | 13 +++++++++---- src/test/resources/flexporter/test_mapping.yaml | 2 +- 5 files changed, 24 insertions(+), 10 deletions(-) diff --git a/src/main/java/RunFlexporter.java b/src/main/java/RunFlexporter.java index 360c32be74..48ec6ce9cc 100644 --- a/src/main/java/RunFlexporter.java +++ b/src/main/java/RunFlexporter.java @@ -25,6 +25,7 @@ import org.hl7.fhir.r4.model.ValueSet; import org.mitre.synthea.export.FhirR4; import org.mitre.synthea.export.flexporter.Actions; +import org.mitre.synthea.export.flexporter.FhirPathUtils; import org.mitre.synthea.export.flexporter.FlexporterJavascriptContext; import org.mitre.synthea.export.flexporter.Mapping; import org.mitre.synthea.helpers.RandomCodeGenerator; @@ -113,7 +114,9 @@ public static void main(String[] args) throws Exception { private static Bundle convertFhir(Bundle bundle, Mapping mapping) { - Actions.applyMapping(bundle, mapping, null, new FlexporterJavascriptContext()); + if (FhirPathUtils.appliesToBundle(bundle, mapping.applicability)) { + bundle = Actions.applyMapping(bundle, mapping, null, new FlexporterJavascriptContext()); + } return bundle; } diff --git a/src/main/java/org/mitre/synthea/export/Exporter.java b/src/main/java/org/mitre/synthea/export/Exporter.java index c8139358b0..933bdf7221 100644 --- a/src/main/java/org/mitre/synthea/export/Exporter.java +++ b/src/main/java/org/mitre/synthea/export/Exporter.java @@ -25,6 +25,7 @@ import org.mitre.synthea.engine.Generator; import org.mitre.synthea.export.flexporter.Actions; +import org.mitre.synthea.export.flexporter.FhirPathUtils; import org.mitre.synthea.export.flexporter.FlexporterJavascriptContext; import org.mitre.synthea.export.flexporter.Mapping; import org.mitre.synthea.export.rif.BB2RIFExporter; @@ -248,11 +249,17 @@ private static boolean exportRecord(Person person, String fileTag, long stopTime org.hl7.fhir.r4.model.Bundle bundle = FhirR4.convertToFHIR(person, stopTime); if (options.flexporterMappings != null) { - FlexporterJavascriptContext fjContext = new FlexporterJavascriptContext(); + FlexporterJavascriptContext fjContext = null; for (Mapping mapping : options.flexporterMappings) { - // flexport on the bundle here - bundle = Actions.applyMapping(bundle, mapping, person, fjContext); + if (FhirPathUtils.appliesToBundle(bundle, mapping.applicability)) { + if (fjContext == null) { + // only set this the first time it is actually used + // TODO: figure out how to silence the truffle warnings + fjContext = new FlexporterJavascriptContext(); + } + bundle = Actions.applyMapping(bundle, mapping, person, fjContext); + } } } diff --git a/src/main/java/org/mitre/synthea/export/flexporter/Actions.java b/src/main/java/org/mitre/synthea/export/flexporter/Actions.java index 5ea489e58a..399f9e9423 100644 --- a/src/main/java/org/mitre/synthea/export/flexporter/Actions.java +++ b/src/main/java/org/mitre/synthea/export/flexporter/Actions.java @@ -272,7 +272,6 @@ private static Map createFhirPathMapping(List Date: Thu, 22 Dec 2022 12:17:15 -0500 Subject: [PATCH 21/78] cleanup --- .../synthea/export/flexporter/Actions.java | 22 ++++++------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/src/main/java/org/mitre/synthea/export/flexporter/Actions.java b/src/main/java/org/mitre/synthea/export/flexporter/Actions.java index 399f9e9423..4ab8f310ea 100644 --- a/src/main/java/org/mitre/synthea/export/flexporter/Actions.java +++ b/src/main/java/org/mitre/synthea/export/flexporter/Actions.java @@ -288,24 +288,16 @@ private static Map createFhirPathMapping(List) { Map valueMap = (Map) valueDef; populateFhirPathMapping(fhirPathMapping, location, valueMap); - } else if (valueDef instanceof Base) { - // we plucked a full FHIR object from somewhere - fhirPathMapping.put(location, valueDef); - } else { // unexpected type here - is it even possible to get anything else? System.err.println("Unhandled type in createFhirPathMapping: " + valueDef.getClass()); @@ -456,7 +448,7 @@ private static Object getValue(Bundle bundle, String valueDef, Resource currentR } else if (flag.equals("findRef")) { return findReference(bundle, flagValues); } else if (flag.equals("findValue")) { - return findValues(bundle, flagValues); + return findValue(bundle, flagValues); } else if (flag.equals("getAttribute")) { return getAttribute(person, flagValues); } else if (flag.equals("randomCode")) { @@ -526,7 +518,7 @@ private static String findReference(Bundle bundle, String... flagValues) { return createReference((Resource) matchingResources.get(0)); } - private static String findValues(Bundle bundle, String... args) { + private static Base findValue(Bundle bundle, String... args) { // args[0] = FHIRPath, from this resource // args[1] = how to disambiguate if there are multiple? TODO List fieldValues = FhirPathUtils.evaluateBundle(bundle, args[0], false); @@ -535,7 +527,7 @@ private static String findValues(Bundle bundle, String... args) { return null; } - return fieldValues.get(0).primitiveValue(); + return fieldValues.get(0); } private static Map randomCode(String valueSetUrl) { From b2717fe8bf1be912e69916c5b123f4b4e203afa4 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Fri, 23 Dec 2022 11:48:04 -0500 Subject: [PATCH 22/78] initial impl of fhirpath variables --- src/main/java/RunFlexporter.java | 2 +- .../org/mitre/synthea/export/Exporter.java | 2 +- .../export/flexporter/FhirPathUtils.java | 65 +++++++++++++++++++ .../synthea/export/flexporter/Mapping.java | 2 + .../export/flexporter/FhirPathUtilsTest.java | 21 ++++++ src/test/resources/flexporter/mcode.yml | 21 +++++- 6 files changed, 110 insertions(+), 3 deletions(-) diff --git a/src/main/java/RunFlexporter.java b/src/main/java/RunFlexporter.java index 48ec6ce9cc..9d9d9d066c 100644 --- a/src/main/java/RunFlexporter.java +++ b/src/main/java/RunFlexporter.java @@ -114,7 +114,7 @@ public static void main(String[] args) throws Exception { private static Bundle convertFhir(Bundle bundle, Mapping mapping) { - if (FhirPathUtils.appliesToBundle(bundle, mapping.applicability)) { + if (FhirPathUtils.appliesToBundle(bundle, mapping.applicability, mapping.variables)) { bundle = Actions.applyMapping(bundle, mapping, null, new FlexporterJavascriptContext()); } diff --git a/src/main/java/org/mitre/synthea/export/Exporter.java b/src/main/java/org/mitre/synthea/export/Exporter.java index 933bdf7221..3c52ff53fb 100644 --- a/src/main/java/org/mitre/synthea/export/Exporter.java +++ b/src/main/java/org/mitre/synthea/export/Exporter.java @@ -252,7 +252,7 @@ private static boolean exportRecord(Person person, String fileTag, long stopTime FlexporterJavascriptContext fjContext = null; for (Mapping mapping : options.flexporterMappings) { - if (FhirPathUtils.appliesToBundle(bundle, mapping.applicability)) { + if (FhirPathUtils.appliesToBundle(bundle, mapping.applicability, mapping.variables)) { if (fjContext == null) { // only set this the first time it is actually used // TODO: figure out how to silence the truffle warnings diff --git a/src/main/java/org/mitre/synthea/export/flexporter/FhirPathUtils.java b/src/main/java/org/mitre/synthea/export/flexporter/FhirPathUtils.java index 9f933fca90..1a727b5445 100644 --- a/src/main/java/org/mitre/synthea/export/flexporter/FhirPathUtils.java +++ b/src/main/java/org/mitre/synthea/export/flexporter/FhirPathUtils.java @@ -2,7 +2,10 @@ import java.util.ArrayList; import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import org.apache.commons.exec.util.StringUtils; import org.hl7.fhir.r4.hapi.fluentpath.FhirPathR4; import org.hl7.fhir.r4.model.Base; import org.hl7.fhir.r4.model.BooleanType; @@ -70,6 +73,63 @@ public static List evaluateBundle(Bundle bundle, String fhirpath, boolean } } + /** + * Execute the given FHIRPath against the given Bundle and return the results. There are a few + * different possibilities in how this works. + * - If the FHIRPath string starts with "Bundle" then this will execute the FHIRPath once + * against the Bundle as a whole, otherwise it will be executed against each resource. + * - If "returnResources" is true, then resources from the Bundle + * that return a truthy value will be returned, otherwise the raw value from the FHIRpath engine + * will be returned. + * This version allows for specifying variables to inject into the FHIRPath. + * + * @param bundle FHIR bundle to evaluate FHIRpath against + * @param fhirpath FHIRPath string + * @param variables FHIRPath variables to inject + * @param returnResources If true, return resources from bundle matching FHIRPath; if false, + * return raw values from FHIRPath engine + * @return Differs based on input - see above + */ + public static List evaluateBundle(Bundle bundle, String fhirpath, + Map variables, boolean returnResources) { + + for (Map.Entry entry : variables.entrySet()) { + Object replacementObj = entry.getValue(); + + String replacement = null; + if (replacementObj instanceof String) { + replacement = (String) replacementObj; + } else if (replacementObj instanceof List) { + List replacementList = (List) replacementObj; + + replacementList = replacementList.stream() + .map(s -> { + if (StringUtils.isQuoted(s)) { + return s; + } + // quoting strings is very difficult in general + // but for now assume this will simple things like codes + // which don't contain nested quotes + if (s.contains("'")) { + return "\"" + s + "\""; + } else { + return "'" + s + "'"; + } + }) + .collect(Collectors.toList()); + + replacement = "(" + String.join(" | ", replacementList) + ")"; + } + + if (replacement != null) { + fhirpath = fhirpath.replace("%" + entry.getKey(), replacement); + } + } + + return evaluateBundle(bundle, fhirpath, returnResources); + } + + public static boolean appliesToResource(Resource resource, String fhirpath) { return isTruthy(evaluateResource(resource, fhirpath)); } @@ -78,6 +138,11 @@ public static boolean appliesToBundle(Bundle bundle, String fhirpath) { return isTruthy(evaluateBundle(bundle, fhirpath, false)); } + public static boolean appliesToBundle(Bundle bundle, String fhirpath, + Map variables) { + return isTruthy(evaluateBundle(bundle, fhirpath, variables, false)); + } + /** * Helper function to convert FHIRPath evaluation primitives into a boolean. * Nulls, empty strings, and boolean false all mean "false" here. Everything else means "true". diff --git a/src/main/java/org/mitre/synthea/export/flexporter/Mapping.java b/src/main/java/org/mitre/synthea/export/flexporter/Mapping.java index f185f658cb..833f65045e 100644 --- a/src/main/java/org/mitre/synthea/export/flexporter/Mapping.java +++ b/src/main/java/org/mitre/synthea/export/flexporter/Mapping.java @@ -13,6 +13,8 @@ public class Mapping { public String name; public String applicability; + public Map variables; + /** * Each action is a Map<String,?>. Nested fields within the YAML become ArrayLists and * LinkedHashMaps. diff --git a/src/test/java/org/mitre/synthea/export/flexporter/FhirPathUtilsTest.java b/src/test/java/org/mitre/synthea/export/flexporter/FhirPathUtilsTest.java index c6eefb0d19..785eec0bf2 100644 --- a/src/test/java/org/mitre/synthea/export/flexporter/FhirPathUtilsTest.java +++ b/src/test/java/org/mitre/synthea/export/flexporter/FhirPathUtilsTest.java @@ -5,6 +5,7 @@ import static org.junit.Assert.assertTrue; import java.util.List; +import java.util.Map; import org.hl7.fhir.r4.model.Base; import org.hl7.fhir.r4.model.BooleanType; @@ -100,4 +101,24 @@ public void testAppliesToBundle() { assertFalse( FhirPathUtils.appliesToBundle(b, "Bundle.entry.resource.ofType(Patient).name.suffix")); } + + @Test + public void testVariables() { + Patient p1 = new Patient(); + p1.addName().addGiven("Jeff").setFamily("Goldblum"); + Bundle b1 = new Bundle(); + b1.addEntry().setResource(p1); + + Patient p2 = new Patient(); + p2.addName().addGiven("Jamie Lee").setFamily("Curtis"); + Bundle b2 = new Bundle(); + b2.addEntry().setResource(p2); + + String fhirpath = "Patient.name.family in %jurassicNames"; + + Map variables = Map.of("jurassicNames", List.of("Neill", "Dern", "Goldblum")); + + assertTrue(FhirPathUtils.appliesToBundle(b1, fhirpath, variables)); + assertFalse(FhirPathUtils.appliesToBundle(b2, fhirpath, variables)); + } } diff --git a/src/test/resources/flexporter/mcode.yml b/src/test/resources/flexporter/mcode.yml index 8560895d9e..c33962e412 100644 --- a/src/test/resources/flexporter/mcode.yml +++ b/src/test/resources/flexporter/mcode.yml @@ -4,7 +4,7 @@ name: mCODE Flexporter Test # applicability determines whether this mapping applies to a given file. # for now the assumption is 1 file = 1 synthea patient bundle. -applicability: Condition.code.coding.where($this.code = '254837009') +applicability: Condition.code.coding.where($this.code in %primaryCancerConditionCodes) # for real mCODE: # In FHIR terms, these are patients who have a Condition where # Condition.code is a member of the value set [PrimaryOrUncertainBehaviorCancerDisorderVS] @@ -12,6 +12,25 @@ applicability: Condition.code.coding.where($this.code = '254837009') # Condition.verificationStatus is confirmed. # -- https://build.fhir.org/ig/HL7/fhir-mCODE-ig/conformance-patients.html +variables: + primaryCancerConditionCodes: + - '188151006' # Malignant neoplasm of central part of female breast (disorder) + - '254837009' # Malignant neoplasm of breast (disorder) (B) + - '93761005' # Primary malignant neoplasm of colon (C) + - '109838007' # Overlapping malignant neoplasm of colon (C) + - '363406005' # Malignant tumor of colon (C) + - '94260004' # Secondary malignant neoplasm of colon (C) -- note this is a "secondary" code but is intended to be a primary cancer + - '254637007' # Non-small cell lung cancer (disorder) (L) + - '254632001' # Small cell carcinoma of lung (disorder) (L) + - '424132000' # Non-small cell carcinoma of lung, TNM stage 1 (disorder) (L) + - '425048006' # Non-small cell carcinoma of lung, TNM stage 2 (disorder) (L) + - '422968005' # Non-small cell carcinoma of lung, TNM stage 3 (disorder) (L) + - '423121009' # Non-small cell carcinoma of lung, TNM stage 4 (disorder) (L) + - '67811000119102' # Primary small cell malignant neoplasm of lung, TNM stage 1 (disorder) (L) + - '67821000119109' # Primary small cell malignant neoplasm of lung, TNM stage 2 (disorder) (L) + - '67831000119107' # Primary small cell malignant neoplasm of lung, TNM stage 3 (disorder) (L) + - '67841000119103' # Primary small cell malignant neoplasm of lung, TNM stage 4 (disorder) (L) + # reminder - the fhir_mapper for Synthea->mCODE 1.0 is here: # https://github.com/standardhealth/fhir-mapper/blob/mcode1/src/mapping/mappers/SyntheaToV10.js From 3b8069d761acae12b429494a20cc885e46607909 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Fri, 27 Jan 2023 13:48:24 -0500 Subject: [PATCH 23/78] WIP towards date filtering/shifting and cascade delete by reference --- .../synthea/export/flexporter/Actions.java | 202 +++++++++++- .../export/flexporter/FieldWrapper.java | 288 ++++++++++++++++++ .../export/flexporter/ActionsTest.java | 28 ++ .../resources/flexporter/test_mapping.yaml | 33 +- 4 files changed, 525 insertions(+), 26 deletions(-) create mode 100644 src/main/java/org/mitre/synthea/export/flexporter/FieldWrapper.java diff --git a/src/main/java/org/mitre/synthea/export/flexporter/Actions.java b/src/main/java/org/mitre/synthea/export/flexporter/Actions.java index 4ab8f310ea..d00bde2501 100644 --- a/src/main/java/org/mitre/synthea/export/flexporter/Actions.java +++ b/src/main/java/org/mitre/synthea/export/flexporter/Actions.java @@ -2,6 +2,7 @@ import ca.uhn.fhir.parser.IParser; +import java.time.LocalDateTime; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; @@ -18,9 +19,24 @@ import org.hl7.fhir.r4.model.Bundle.BundleEntryRequestComponent; import org.hl7.fhir.r4.model.Bundle.BundleType; import org.hl7.fhir.r4.model.Bundle.HTTPVerb; +import org.hl7.fhir.r4.model.CarePlan; +import org.hl7.fhir.r4.model.Claim; +import org.hl7.fhir.r4.model.Condition; +import org.hl7.fhir.r4.model.DiagnosticReport; +import org.hl7.fhir.r4.model.DocumentReference; +import org.hl7.fhir.r4.model.Encounter; +import org.hl7.fhir.r4.model.ExplanationOfBenefit; +import org.hl7.fhir.r4.model.MedicationAdministration; +import org.hl7.fhir.r4.model.MedicationRequest; import org.hl7.fhir.r4.model.Meta; +import org.hl7.fhir.r4.model.Observation; +import org.hl7.fhir.r4.model.Procedure; +import org.hl7.fhir.r4.model.Provenance; import org.hl7.fhir.r4.model.Resource; +import org.hl7.fhir.r4.model.ResourceType; import org.mitre.synthea.export.FhirR4; +import org.mitre.synthea.export.flexporter.FieldWrapper.DateFieldWrapper; +import org.mitre.synthea.export.flexporter.FieldWrapper.ReferenceFieldWrapper; import org.mitre.synthea.helpers.RandomCodeGenerator; import org.mitre.synthea.world.agents.Person; @@ -81,6 +97,9 @@ public static Bundle applyAction(Bundle bundle, Map action, Pers createResource(bundle, (List>) action.get("create_resource"), person, null); + } else if (action.containsKey("min_date") || action.containsKey("max_date")) { + dateFilter(returnBundle, (String)action.get("min_date"), (String)action.get("max_date")); + } else if (action.containsKey("execute_script")) { returnBundle = executeScript((List>) action.get("execute_script"), bundle, fjContext); @@ -352,7 +371,78 @@ public static void keepResources(Bundle bundle, List list) { } } - // TODO: additional passes for deleted resource IDs + if (!deletedResourceIDs.isEmpty()) { + pruneDeletedResources(bundle, deletedResourceIDs); + } + } + + + private static final Map> DATE_FIELDS = buildDateFields(); + + private static Map> buildDateFields() { + Map> dateFields = new HashMap<>(); + + dateFields.put(ResourceType.Encounter, List.of( + new DateFieldWrapper(Encounter.class, "period") + )); + + dateFields.put(ResourceType.Condition, List.of( + new DateFieldWrapper(Condition.class, "onsetDateTime") + )); + + dateFields.put(ResourceType.Procedure, List.of( + new DateFieldWrapper(Procedure.class, "performed[x]") // Period or dateTime + )); + + dateFields.put(ResourceType.MedicationRequest, List.of( + new DateFieldWrapper(MedicationRequest.class, "authoredOn") + )); + + return dateFields; + } + + public static void dateFilter(Bundle bundle, String minDateStr, String maxDateStr) { + if (minDateStr == null && maxDateStr == null) { + return; + } + + // TODO: support dates with or without time + LocalDateTime minDate = null; + LocalDateTime maxDate = null; + + if (minDateStr != null) { + minDate = LocalDateTime.parse(minDateStr); + } + + if (maxDateStr != null) { + maxDate = LocalDateTime.parse(maxDateStr); + } + + Set deletedResourceIDs = new HashSet<>(); + + Iterator itr = bundle.getEntry().iterator(); + + while (itr.hasNext()) { + BundleEntryComponent entry = itr.next(); + + Resource resource = entry.getResource(); + List dateFieldsOnResource = DATE_FIELDS.get(resource.getResourceType()); + + if (dateFieldsOnResource == null) { + continue; + } + + for (DateFieldWrapper dateField : dateFieldsOnResource) { + if (!dateField.valueInRange(resource, minDate, maxDate)) { + deletedResourceIDs.add(resource.getId()); + itr.remove(); + } + } + } + + if (!deletedResourceIDs.isEmpty()) { + pruneDeletedResources(bundle, deletedResourceIDs); + } } /** @@ -381,7 +471,115 @@ public static void deleteResources(Bundle bundle, List list) { } } - // TODO: additional passes for deleted resource IDs + if (!deletedResourceIDs.isEmpty()) { + pruneDeletedResources(bundle, deletedResourceIDs); + } + } + + private static final Map> REFERENCE_FIELDS = + buildReferenceFields(); + + private static Map> buildReferenceFields() { + Map> refFields = new HashMap<>(); + + refFields.put(ResourceType.Encounter, List.of( + new ReferenceFieldWrapper(Encounter.class, "subject") + )); + + refFields.put(ResourceType.Condition, List.of( + new ReferenceFieldWrapper(Condition.class, "subject"), + new ReferenceFieldWrapper(Condition.class, "encounter") + )); + + refFields.put(ResourceType.Procedure, List.of( + new ReferenceFieldWrapper(Procedure.class, "subject"), + new ReferenceFieldWrapper(Procedure.class, "encounter") + )); + + refFields.put(ResourceType.MedicationRequest, List.of( + new ReferenceFieldWrapper(MedicationRequest.class, "subject"), + new ReferenceFieldWrapper(MedicationRequest.class, "encounter") + )); + + refFields.put(ResourceType.MedicationAdministration, List.of( + new ReferenceFieldWrapper(MedicationAdministration.class, "subject"), + new ReferenceFieldWrapper(MedicationAdministration.class, "context") + )); + + refFields.put(ResourceType.Observation, List.of( + new ReferenceFieldWrapper(Observation.class, "subject"), + new ReferenceFieldWrapper(Observation.class, "encounter") + )); + + refFields.put(ResourceType.DiagnosticReport, List.of( + new ReferenceFieldWrapper(DiagnosticReport.class, "subject"), + new ReferenceFieldWrapper(DiagnosticReport.class, "encounter"), + new ReferenceFieldWrapper(DiagnosticReport.class, "result") + )); + + refFields.put(ResourceType.CarePlan, List.of( + new ReferenceFieldWrapper(CarePlan.class, "subject"), + new ReferenceFieldWrapper(CarePlan.class, "encounter") + )); + + refFields.put(ResourceType.DocumentReference, List.of( + new ReferenceFieldWrapper(DocumentReference.class, "subject") + )); + + refFields.put(ResourceType.Claim, List.of( + new ReferenceFieldWrapper(Claim.class, "patient") + )); + + refFields.put(ResourceType.ExplanationOfBenefit, List.of( + new ReferenceFieldWrapper(ExplanationOfBenefit.class, "patient"), + new ReferenceFieldWrapper(ExplanationOfBenefit.class, "claim") + )); + + refFields.put(ResourceType.Provenance, List.of( + new ReferenceFieldWrapper(Provenance.class, "target") + )); + + return refFields; + } + + // TODO: add modes -- cascade delete resources, clear out the one field, etc + private static void pruneDeletedResources(Bundle bundle, Set deletedResourceIDs) { + Iterator itr = bundle.getEntry().iterator(); + + Set deletedIDsThisRound = new HashSet<>(); + + while (itr.hasNext()) { + BundleEntryComponent entry = itr.next(); + + Resource resource = entry.getResource(); + + List references = REFERENCE_FIELDS.get(resource.getResourceType()); + + if (references == null) { + continue; + } + + for (ReferenceFieldWrapper rf : references) { + List referencedIDs = rf.getReferences(resource); + + boolean deleted = false; + for (String referencedID : referencedIDs) { + if (deletedResourceIDs.contains(referencedID)) { + deletedIDsThisRound.add(resource.getId()); + itr.remove(); + deleted = true; + break; + } + } + if (deleted) { + break; + } + } + } + + if (!deletedIDsThisRound.isEmpty()) { + pruneDeletedResources(bundle, deletedIDsThisRound); + } } /** diff --git a/src/main/java/org/mitre/synthea/export/flexporter/FieldWrapper.java b/src/main/java/org/mitre/synthea/export/flexporter/FieldWrapper.java new file mode 100644 index 0000000000..13c45fc280 --- /dev/null +++ b/src/main/java/org/mitre/synthea/export/flexporter/FieldWrapper.java @@ -0,0 +1,288 @@ +package org.mitre.synthea.export.flexporter; + +import ca.uhn.fhir.context.BaseRuntimeChildDefinition; +import ca.uhn.fhir.context.RuntimeResourceDefinition; + +import java.time.Duration; +import java.time.Instant; +import java.time.LocalDateTime; +import java.time.LocalTime; +import java.time.ZoneOffset; +import java.time.ZonedDateTime; +import java.time.temporal.TemporalAmount; +import java.util.Date; +import java.util.List; +import java.util.stream.Collectors; + +import org.hl7.fhir.instance.model.api.IBase; +import org.hl7.fhir.r4.model.Base; +import org.hl7.fhir.r4.model.DateTimeType; +import org.hl7.fhir.r4.model.DateType; +import org.hl7.fhir.r4.model.InstantType; +import org.hl7.fhir.r4.model.Period; +import org.hl7.fhir.r4.model.Reference; +import org.hl7.fhir.r4.model.Resource; +import org.hl7.fhir.r4.model.TimeType; +import org.mitre.synthea.export.FhirR4; + +public abstract class FieldWrapper { + protected BaseRuntimeChildDefinition fieldDef; + + public FieldWrapper(String fieldPath) { + String[] pathParts = fieldPath.split("\\.", 2); + + try { + String className = "org.hl7.fhir.r4.model." + pathParts[0]; + + @SuppressWarnings("unchecked") + Class clazz = + (Class) Class.forName(className); + init(clazz, pathParts[1]); + } catch (Exception e) { + // means we defined some classname that isn't a resource type + throw new RuntimeException(e); + } + } + + public FieldWrapper(Class clazz, String fieldName) { + init(clazz, fieldName); + } + + private void init(Class clazz, String fieldName) { + RuntimeResourceDefinition rd = FhirR4.getContext().getResourceDefinition(clazz); + // TODO: this only gets top-level fields. update to suport nested fields + this.fieldDef = rd.getChildByName(fieldName); + if (this.fieldDef == null) { + System.out.println("breakpoint"); + } + } + + public IBase getSingle(Resource resource) { + return fieldDef.getAccessor().getFirstValueOrNull(resource).orElse(null); + } + + public List getAll(Resource resource) { + return fieldDef.getAccessor().getValues(resource); + } + + public void set(Resource resource, IBase value) { + fieldDef.getMutator().setValue(resource, value); + } + + + public static class DateFieldWrapper extends FieldWrapper { + + public DateFieldWrapper(String fieldPath) { + super(fieldPath); + } + + public DateFieldWrapper(Class clazz, String fieldName) { + super(clazz, fieldName); + } + + private static LocalDateTime normalize(IBase rawValue) { + if (!(rawValue instanceof Base)) { + // should never happen, not sure it's possible + return null; + } + + Base rawValueBase = (Base) rawValue; + if (rawValueBase.isPrimitive()) { + String strValue = rawValueBase.primitiveValue(); + return ZonedDateTime.parse(strValue).toLocalDateTime(); + + } else { + // TODO - this would happen if it's a Period + throw new IllegalArgumentException("Unable to normalize " + rawValue); + } + } + + public static Period shift(Period period, TemporalAmount amount) { + if (period == null) { + return null; + } + + period.setStartElement(shift(period.getStartElement(), amount)); + period.setEndElement(shift(period.getEndElement(), amount)); + + return period; + } + + public static DateTimeType shift(DateTimeType dateTime, TemporalAmount amount) { + if (dateTime == null) { + return null; + } + + Date d = dateTime.getValue(); + + Instant shifted = d.toInstant().plus(amount); + + d.setTime(shifted.toEpochMilli()); + + // TODO: is it necessary to call dateTime.setValue(d) again? + + return dateTime; + } + + public static DateType shift(DateType date, TemporalAmount amount) { + if (date == null) { + return null; + } + + Date d = date.getValue(); + + Instant shifted = d.toInstant().plus(amount); + + d.setTime(shifted.toEpochMilli()); + + // TODO: is it necessary to call date.setValue(d) again? + + return date; + } + + public static TimeType shift(TimeType time, TemporalAmount amount) { + if (time == null) { + return null; + } + + String t = time.getValue(); + + LocalTime localTime = LocalTime.parse(t).plus(amount); + + time.setValue(localTime.toString()); + + return time; + } + + public static InstantType shift(InstantType instant, TemporalAmount amount) { + if (instant == null) { + return null; + } + + Date d = instant.getValue(); + + Instant shifted = d.toInstant().plus(amount); + + d.setTime(shifted.toEpochMilli()); + + // TODO: is it necessary to call instant.setValue(d) again? + + return instant; + } + + public void shift(Resource resource, String amountString) { + IBase value = getSingle(resource); + if (value == null) { + return; + } + + // note: amount can either be <= 1 day with second precision, or > 1 day with day precision + // not both + // (for example you can't shift by a year and 3 hours) + TemporalAmount amount = null; + + if (amountString.contains("Y") || (amountString.indexOf('M') < amountString.indexOf('T'))) { + // ISO-8601 period formats {@code PnYnMnD} + // if we see Y, or M before T, it's a Period + amount = java.time.Period.parse(amountString); + } else { + // ISO-8601 duration format {@code PnDTnHnMn.nS} + amount = Duration.parse(amountString); + } + + IBase newValue; + + if (value instanceof Period) { + newValue = shift((Period) value, amount); + } else if (value instanceof DateTimeType) { + newValue = shift((DateTimeType) value, amount); + } else if (value instanceof DateType) { + newValue = shift((DateType) value, amount); + } else if (value instanceof TimeType) { + newValue = shift((TimeType) value, amount); + } else if (value instanceof InstantType) { + newValue = shift((InstantType) value, amount); + } else { + throw new IllegalArgumentException("Unexpected value for a temporal field: " + value); + } + + set(resource, newValue); + } + + public boolean valueInRange(Resource resource, LocalDateTime min, LocalDateTime max) { + if (min == null && max == null) { + return true; + } + + if (min == null) { + min = LocalDateTime.MIN; + } + + if (max == null) { + max = LocalDateTime.MAX; + } + + IBase value = this.getSingle(resource); + + if (value instanceof Period) { + Period period = (Period) value; + + Date startDt = period.getStart(); + LocalDateTime start = startDt.toInstant().atOffset(ZoneOffset.UTC).toLocalDateTime(); + Date endDt = period.getEnd(); + + if (endDt == null) { + // use the same single value check as if this were not a Period + return (start.isAfter(min) || start.isEqual(min)) + && (start.isBefore(max) || start.isEqual(max)); + } + + LocalDateTime end = endDt.toInstant().atOffset(ZoneOffset.UTC).toLocalDateTime(); + + // https://stackoverflow.com/a/325964 + // (StartA <= EndB) and (EndA >= StartB) + + return (start.isBefore(max) || start.isEqual(max)) + && (end.isAfter(min) || end.isEqual(min)); + + } else if (value != null) { + LocalDateTime myValue = normalize(value); + + return (myValue.isAfter(min) || myValue.isEqual(min)) + && (myValue.isBefore(max) || myValue.isEqual(max)); + + } else { + // debatable which way this should go. we have a date field set to null, + // does that mean it's in the given range? + return true; + } + } + } + + public static class ReferenceFieldWrapper extends FieldWrapper { + public ReferenceFieldWrapper(String fieldPath) { + super(fieldPath); + } + + public ReferenceFieldWrapper(Class clazz, String fieldName) { + super(clazz, fieldName); + } + + public String getReference(Resource resource) { + IBase referenceObject = getSingle(resource); + if (!(referenceObject instanceof Reference)) { + return null; + } + Reference ref = (Reference)referenceObject; + return ref.getReference(); + } + + public List getReferences(Resource resource) { + List referenceObjects = getAll(resource); + + return referenceObjects.stream() + .map(ro -> ((Reference)ro).getReference()) + .collect(Collectors.toList()); + } + } +} diff --git a/src/test/java/org/mitre/synthea/export/flexporter/ActionsTest.java b/src/test/java/org/mitre/synthea/export/flexporter/ActionsTest.java index 30db75b0ff..5a025243bc 100644 --- a/src/test/java/org/mitre/synthea/export/flexporter/ActionsTest.java +++ b/src/test/java/org/mitre/synthea/export/flexporter/ActionsTest.java @@ -292,6 +292,34 @@ public void testDeleteResources() throws Exception { .filter(bec -> bec.getResource().getResourceType() == ResourceType.Provenance).count(); assertEquals(0, countProvenance); + } + + @Test + public void testDeleteResourcesCascade() throws Exception { + Bundle b = loadFixtureBundle("sample_complete_patient.json"); + + System.out.println(b.getEntry().size()); + + Map action = getActionByName("testDeleteResourcesCascade"); + + // action deletes Patient resource, everything should reference back to Patient + + Actions.applyAction(b, action, null, null); + + System.out.println(b.getEntry().size()); + b.getEntry().forEach(e -> System.out.println(e.getResource().getResourceType())); + } + + @Test + public void testDateFilter() throws Exception { + Bundle b = loadFixtureBundle("sample_complete_patient.json"); + + System.out.println(b.getEntry().size()); + Map action = getActionByName("testDateFilter"); + + Actions.applyAction(b, action, null, null); + + System.out.println(b.getEntry().size()); } diff --git a/src/test/resources/flexporter/test_mapping.yaml b/src/test/resources/flexporter/test_mapping.yaml index 82a0fdf917..265ccbab2a 100644 --- a/src/test/resources/flexporter/test_mapping.yaml +++ b/src/test/resources/flexporter/test_mapping.yaml @@ -108,39 +108,17 @@ actions: - location: ServiceRequest.code value: $getField([Procedure.code]) - # this works if the VS is loaded but otherwise tries to make a network lookup # so disable for now # - location: ServiceRequest.code.coding # value: $randomCode([http://hl7.org/fhir/us/mcode/ValueSet/mcode-laterality-vs]) - # TODO: is "writeback" the best term here? - writeback: - - location: Procedure.basedOn.reference - value: $setRef([ServiceRequest]) - - - name: testCreateResources_createBasedOn_JS - create_resource_js: - - resourceType: ServiceRequest - based_on: Procedure - fields: - - location: ServiceRequest.intent - value: plan - - location: ServiceRequest.encounter.reference - value: $getField([Procedure.encounter.reference]) - - location: ServiceRequest.subject.reference - value: $findRef([Patient]) - # - location: ServiceRequest.code.coding - # value: $getField([Procedure.code.coding]) # <-- STILL WIP - # this works if the VS is loaded but otherwise tries to make a network lookup - # so disable for now - # - location: ServiceRequest.code.coding - # value: $randomCode([http://hl7.org/fhir/us/mcode/ValueSet/mcode-laterality-vs]) # TODO: is "writeback" the best term here? writeback: - location: Procedure.basedOn.reference value: $setRef([ServiceRequest]) + - name: testCreateResources_getAttribute create_resource: - resourceType: Patient @@ -169,7 +147,10 @@ actions: } } -# TODO: on keep/delete, check for references to removed items!! + - name: testDateFilter + min_date: !!str "2000-01-01T00:00:00" + max_date: !!str "2000-12-31T23:59:59" + - name: testKeepResources keep_resources: - Patient @@ -179,3 +160,7 @@ actions: - name: testDeleteResources delete_resources: - Provenance + + - name: testDeleteResourcesCascade + delete_resources: + - Patient \ No newline at end of file From fdd33cb44b9c16bdce7758a09c0f6c62405708c8 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Fri, 10 Feb 2023 11:14:41 -0500 Subject: [PATCH 24/78] date shifting --- .../synthea/export/flexporter/Actions.java | 141 ++++--------- .../export/flexporter/FieldWrapper.java | 199 ++++++++++++++---- .../export/flexporter/ActionsTest.java | 31 +++ .../resources/flexporter/test_mapping.yaml | 4 + 4 files changed, 236 insertions(+), 139 deletions(-) diff --git a/src/main/java/org/mitre/synthea/export/flexporter/Actions.java b/src/main/java/org/mitre/synthea/export/flexporter/Actions.java index d00bde2501..2dca8d4627 100644 --- a/src/main/java/org/mitre/synthea/export/flexporter/Actions.java +++ b/src/main/java/org/mitre/synthea/export/flexporter/Actions.java @@ -2,7 +2,9 @@ import ca.uhn.fhir.parser.IParser; +import java.time.Duration; import java.time.LocalDateTime; +import java.time.temporal.TemporalAmount; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; @@ -19,21 +21,8 @@ import org.hl7.fhir.r4.model.Bundle.BundleEntryRequestComponent; import org.hl7.fhir.r4.model.Bundle.BundleType; import org.hl7.fhir.r4.model.Bundle.HTTPVerb; -import org.hl7.fhir.r4.model.CarePlan; -import org.hl7.fhir.r4.model.Claim; -import org.hl7.fhir.r4.model.Condition; -import org.hl7.fhir.r4.model.DiagnosticReport; -import org.hl7.fhir.r4.model.DocumentReference; -import org.hl7.fhir.r4.model.Encounter; -import org.hl7.fhir.r4.model.ExplanationOfBenefit; -import org.hl7.fhir.r4.model.MedicationAdministration; -import org.hl7.fhir.r4.model.MedicationRequest; import org.hl7.fhir.r4.model.Meta; -import org.hl7.fhir.r4.model.Observation; -import org.hl7.fhir.r4.model.Procedure; -import org.hl7.fhir.r4.model.Provenance; import org.hl7.fhir.r4.model.Resource; -import org.hl7.fhir.r4.model.ResourceType; import org.mitre.synthea.export.FhirR4; import org.mitre.synthea.export.flexporter.FieldWrapper.DateFieldWrapper; import org.mitre.synthea.export.flexporter.FieldWrapper.ReferenceFieldWrapper; @@ -98,7 +87,10 @@ public static Bundle applyAction(Bundle bundle, Map action, Pers null); } else if (action.containsKey("min_date") || action.containsKey("max_date")) { - dateFilter(returnBundle, (String)action.get("min_date"), (String)action.get("max_date")); + dateFilter(bundle, (String)action.get("min_date"), (String)action.get("max_date")); + + } else if (action.containsKey("shift_dates")) { + shiftDates(bundle, (String)action.get("shift_dates")); } else if (action.containsKey("execute_script")) { returnBundle = executeScript((List>) action.get("execute_script"), bundle, @@ -376,29 +368,37 @@ public static void keepResources(Bundle bundle, List list) { } } + public static void shiftDates(Bundle bundle, String amountString) { + if (amountString == null) { + return; + } - private static final Map> DATE_FIELDS = buildDateFields(); - - private static Map> buildDateFields() { - Map> dateFields = new HashMap<>(); - - dateFields.put(ResourceType.Encounter, List.of( - new DateFieldWrapper(Encounter.class, "period") - )); - - dateFields.put(ResourceType.Condition, List.of( - new DateFieldWrapper(Condition.class, "onsetDateTime") - )); - - dateFields.put(ResourceType.Procedure, List.of( - new DateFieldWrapper(Procedure.class, "performed[x]") // Period or dateTime - )); + // note: amount can either be <= 1 day with second precision, or > 1 day with day precision + // not both + // (for example you can't shift by a year and 3 hours) + TemporalAmount amount = null; + + if (amountString.contains("Y") || (amountString.indexOf('M') < amountString.indexOf('T'))) { + // ISO-8601 period formats {@code PnYnMnD} + // if we see Y, or M before T, it's a Period + amount = java.time.Period.parse(amountString); + } else { + // ISO-8601 duration format {@code PnDTnHnMn.nS} + amount = Duration.parse(amountString); + } - dateFields.put(ResourceType.MedicationRequest, List.of( - new DateFieldWrapper(MedicationRequest.class, "authoredOn") - )); + for (BundleEntryComponent entry : bundle.getEntry()) { + Resource resource = entry.getResource(); + List dateFieldsOnResource = + FieldWrapper.DATE_FIELDS.get(resource.getResourceType()); + if (dateFieldsOnResource == null) { + continue; + } - return dateFields; + for (DateFieldWrapper dateField : dateFieldsOnResource) { + dateField.shift(resource, amount); + } + } } public static void dateFilter(Bundle bundle, String minDateStr, String maxDateStr) { @@ -426,7 +426,8 @@ public static void dateFilter(Bundle bundle, String minDateStr, String maxDateSt BundleEntryComponent entry = itr.next(); Resource resource = entry.getResource(); - List dateFieldsOnResource = DATE_FIELDS.get(resource.getResourceType()); + List dateFieldsOnResource = + FieldWrapper.DATE_FIELDS.get(resource.getResourceType()); if (dateFieldsOnResource == null) { continue; @@ -436,6 +437,7 @@ public static void dateFilter(Bundle bundle, String minDateStr, String maxDateSt if (!dateField.valueInRange(resource, minDate, maxDate)) { deletedResourceIDs.add(resource.getId()); itr.remove(); + break; } } } @@ -476,72 +478,6 @@ public static void deleteResources(Bundle bundle, List list) { } } - private static final Map> REFERENCE_FIELDS = - buildReferenceFields(); - - private static Map> buildReferenceFields() { - Map> refFields = new HashMap<>(); - - refFields.put(ResourceType.Encounter, List.of( - new ReferenceFieldWrapper(Encounter.class, "subject") - )); - - refFields.put(ResourceType.Condition, List.of( - new ReferenceFieldWrapper(Condition.class, "subject"), - new ReferenceFieldWrapper(Condition.class, "encounter") - )); - - refFields.put(ResourceType.Procedure, List.of( - new ReferenceFieldWrapper(Procedure.class, "subject"), - new ReferenceFieldWrapper(Procedure.class, "encounter") - )); - - refFields.put(ResourceType.MedicationRequest, List.of( - new ReferenceFieldWrapper(MedicationRequest.class, "subject"), - new ReferenceFieldWrapper(MedicationRequest.class, "encounter") - )); - - refFields.put(ResourceType.MedicationAdministration, List.of( - new ReferenceFieldWrapper(MedicationAdministration.class, "subject"), - new ReferenceFieldWrapper(MedicationAdministration.class, "context") - )); - - refFields.put(ResourceType.Observation, List.of( - new ReferenceFieldWrapper(Observation.class, "subject"), - new ReferenceFieldWrapper(Observation.class, "encounter") - )); - - refFields.put(ResourceType.DiagnosticReport, List.of( - new ReferenceFieldWrapper(DiagnosticReport.class, "subject"), - new ReferenceFieldWrapper(DiagnosticReport.class, "encounter"), - new ReferenceFieldWrapper(DiagnosticReport.class, "result") - )); - - refFields.put(ResourceType.CarePlan, List.of( - new ReferenceFieldWrapper(CarePlan.class, "subject"), - new ReferenceFieldWrapper(CarePlan.class, "encounter") - )); - - refFields.put(ResourceType.DocumentReference, List.of( - new ReferenceFieldWrapper(DocumentReference.class, "subject") - )); - - refFields.put(ResourceType.Claim, List.of( - new ReferenceFieldWrapper(Claim.class, "patient") - )); - - refFields.put(ResourceType.ExplanationOfBenefit, List.of( - new ReferenceFieldWrapper(ExplanationOfBenefit.class, "patient"), - new ReferenceFieldWrapper(ExplanationOfBenefit.class, "claim") - )); - - refFields.put(ResourceType.Provenance, List.of( - new ReferenceFieldWrapper(Provenance.class, "target") - )); - - return refFields; - } - // TODO: add modes -- cascade delete resources, clear out the one field, etc private static void pruneDeletedResources(Bundle bundle, Set deletedResourceIDs) { Iterator itr = bundle.getEntry().iterator(); @@ -553,7 +489,8 @@ private static void pruneDeletedResources(Bundle bundle, Set deletedReso Resource resource = entry.getResource(); - List references = REFERENCE_FIELDS.get(resource.getResourceType()); + List references = + FieldWrapper.REFERENCE_FIELDS.get(resource.getResourceType()); if (references == null) { continue; diff --git a/src/main/java/org/mitre/synthea/export/flexporter/FieldWrapper.java b/src/main/java/org/mitre/synthea/export/flexporter/FieldWrapper.java index 13c45fc280..771127251a 100644 --- a/src/main/java/org/mitre/synthea/export/flexporter/FieldWrapper.java +++ b/src/main/java/org/mitre/synthea/export/flexporter/FieldWrapper.java @@ -3,28 +3,44 @@ import ca.uhn.fhir.context.BaseRuntimeChildDefinition; import ca.uhn.fhir.context.RuntimeResourceDefinition; -import java.time.Duration; -import java.time.Instant; +import java.time.LocalDate; import java.time.LocalDateTime; import java.time.LocalTime; import java.time.ZoneOffset; import java.time.ZonedDateTime; import java.time.temporal.TemporalAmount; import java.util.Date; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.stream.Collectors; import org.hl7.fhir.instance.model.api.IBase; import org.hl7.fhir.r4.model.Base; +import org.hl7.fhir.r4.model.CarePlan; +import org.hl7.fhir.r4.model.Claim; +import org.hl7.fhir.r4.model.Condition; import org.hl7.fhir.r4.model.DateTimeType; import org.hl7.fhir.r4.model.DateType; +import org.hl7.fhir.r4.model.DiagnosticReport; +import org.hl7.fhir.r4.model.DocumentReference; +import org.hl7.fhir.r4.model.Encounter; +import org.hl7.fhir.r4.model.ExplanationOfBenefit; import org.hl7.fhir.r4.model.InstantType; +import org.hl7.fhir.r4.model.MedicationAdministration; +import org.hl7.fhir.r4.model.MedicationRequest; +import org.hl7.fhir.r4.model.Observation; +import org.hl7.fhir.r4.model.Patient; import org.hl7.fhir.r4.model.Period; +import org.hl7.fhir.r4.model.Procedure; +import org.hl7.fhir.r4.model.Provenance; import org.hl7.fhir.r4.model.Reference; import org.hl7.fhir.r4.model.Resource; +import org.hl7.fhir.r4.model.ResourceType; import org.hl7.fhir.r4.model.TimeType; import org.mitre.synthea.export.FhirR4; + public abstract class FieldWrapper { protected BaseRuntimeChildDefinition fieldDef; @@ -88,13 +104,25 @@ private static LocalDateTime normalize(IBase rawValue) { Base rawValueBase = (Base) rawValue; if (rawValueBase.isPrimitive()) { + String strValue = rawValueBase.primitiveValue(); - return ZonedDateTime.parse(strValue).toLocalDateTime(); - } else { - // TODO - this would happen if it's a Period - throw new IllegalArgumentException("Unable to normalize " + rawValue); + if (rawValueBase instanceof DateType) { + return LocalDate.parse(strValue).atStartOfDay(); + } else if (rawValueBase instanceof DateTimeType) { + return ZonedDateTime.parse(strValue).toLocalDateTime(); + } else if (rawValueBase instanceof DateType) { + return ZonedDateTime.parse(strValue).toLocalDateTime(); + } else if (rawValueBase instanceof TimeType) { + return ZonedDateTime.parse(strValue).toLocalDateTime(); + } else if (rawValueBase instanceof InstantType) { + return ZonedDateTime.parse(strValue).toLocalDateTime(); + } } + + // various reasons we arrive here, for example a choice type that includes non-time values + return null; + } public static Period shift(Period period, TemporalAmount amount) { @@ -113,13 +141,11 @@ public static DateTimeType shift(DateTimeType dateTime, TemporalAmount amount) { return null; } - Date d = dateTime.getValue(); + String s = dateTime.getValueAsString(); - Instant shifted = d.toInstant().plus(amount); + ZonedDateTime shifted = ZonedDateTime.parse(s).plus(amount); - d.setTime(shifted.toEpochMilli()); - - // TODO: is it necessary to call dateTime.setValue(d) again? + dateTime.setValueAsString(shifted.toString()); return dateTime; } @@ -129,13 +155,11 @@ public static DateType shift(DateType date, TemporalAmount amount) { return null; } - Date d = date.getValue(); - - Instant shifted = d.toInstant().plus(amount); + String s = date.getValueAsString(); - d.setTime(shifted.toEpochMilli()); + LocalDate shifted = LocalDate.parse(s).plus(amount); - // TODO: is it necessary to call date.setValue(d) again? + date.setValueAsString(shifted.toString()); return date; } @@ -145,6 +169,12 @@ public static TimeType shift(TimeType time, TemporalAmount amount) { return null; } + if (amount instanceof java.time.Period) { + // trying to shift years/months/days but we only have a time of day + // so just keep it the same + return time; + } + String t = time.getValue(); LocalTime localTime = LocalTime.parse(t).plus(amount); @@ -159,37 +189,23 @@ public static InstantType shift(InstantType instant, TemporalAmount amount) { return null; } - Date d = instant.getValue(); + String s = instant.getValueAsString(); - Instant shifted = d.toInstant().plus(amount); + // note that we use ZonedDateTime vs java Instant here + // because Instant doesn't allow shifting by time units > Days + ZonedDateTime shifted = ZonedDateTime.parse(s).plus(amount); - d.setTime(shifted.toEpochMilli()); - - // TODO: is it necessary to call instant.setValue(d) again? + instant.setValueAsString(shifted.toString()); return instant; } - public void shift(Resource resource, String amountString) { + public void shift(Resource resource, TemporalAmount amount) { IBase value = getSingle(resource); if (value == null) { return; } - // note: amount can either be <= 1 day with second precision, or > 1 day with day precision - // not both - // (for example you can't shift by a year and 3 hours) - TemporalAmount amount = null; - - if (amountString.contains("Y") || (amountString.indexOf('M') < amountString.indexOf('T'))) { - // ISO-8601 period formats {@code PnYnMnD} - // if we see Y, or M before T, it's a Period - amount = java.time.Period.parse(amountString); - } else { - // ISO-8601 duration format {@code PnDTnHnMn.nS} - amount = Duration.parse(amountString); - } - IBase newValue; if (value instanceof Period) { @@ -203,7 +219,11 @@ public void shift(Resource resource, String amountString) { } else if (value instanceof InstantType) { newValue = shift((InstantType) value, amount); } else { - throw new IllegalArgumentException("Unexpected value for a temporal field: " + value); + // many choice fields have both temporal and non-temporal options, + // for example Observation.value + // just do nothing + + return; } set(resource, newValue); @@ -248,6 +268,11 @@ public boolean valueInRange(Resource resource, LocalDateTime min, LocalDateTime } else if (value != null) { LocalDateTime myValue = normalize(value); + if (myValue == null) { + return true; + // probably wasn't actually a temporal value + } + return (myValue.isAfter(min) || myValue.isEqual(min)) && (myValue.isBefore(max) || myValue.isEqual(max)); @@ -259,6 +284,40 @@ public boolean valueInRange(Resource resource, LocalDateTime min, LocalDateTime } } + public static final Map> DATE_FIELDS = buildDateFields(); + + private static Map> buildDateFields() { + Map> dateFields = new HashMap<>(); + + dateFields.put(ResourceType.Patient, List.of( + new DateFieldWrapper(Patient.class, "birthDate") + )); + + dateFields.put(ResourceType.Encounter, List.of( + new DateFieldWrapper(Encounter.class, "period") + )); + + dateFields.put(ResourceType.Condition, List.of( + new DateFieldWrapper(Condition.class, "onsetDateTime") + )); + + dateFields.put(ResourceType.Procedure, List.of( + new DateFieldWrapper(Procedure.class, "performed[x]") // Period or dateTime + )); + + dateFields.put(ResourceType.Observation, List.of( + new DateFieldWrapper(Observation.class, "effective[x]"), + new DateFieldWrapper(Observation.class, "value[x]"), + new DateFieldWrapper(Observation.class, "issued") + )); + + dateFields.put(ResourceType.MedicationRequest, List.of( + new DateFieldWrapper(MedicationRequest.class, "authoredOn") + )); + + return dateFields; + } + public static class ReferenceFieldWrapper extends FieldWrapper { public ReferenceFieldWrapper(String fieldPath) { super(fieldPath); @@ -285,4 +344,70 @@ public List getReferences(Resource resource) { .collect(Collectors.toList()); } } + + public static final Map> REFERENCE_FIELDS = + buildReferenceFields(); + + private static Map> buildReferenceFields() { + Map> refFields = new HashMap<>(); + + refFields.put(ResourceType.Encounter, List.of( + new ReferenceFieldWrapper(Encounter.class, "subject") + )); + + refFields.put(ResourceType.Condition, List.of( + new ReferenceFieldWrapper(Condition.class, "subject"), + new ReferenceFieldWrapper(Condition.class, "encounter") + )); + + refFields.put(ResourceType.Procedure, List.of( + new ReferenceFieldWrapper(Procedure.class, "subject"), + new ReferenceFieldWrapper(Procedure.class, "encounter") + )); + + refFields.put(ResourceType.MedicationRequest, List.of( + new ReferenceFieldWrapper(MedicationRequest.class, "subject"), + new ReferenceFieldWrapper(MedicationRequest.class, "encounter") + )); + + refFields.put(ResourceType.MedicationAdministration, List.of( + new ReferenceFieldWrapper(MedicationAdministration.class, "subject"), + new ReferenceFieldWrapper(MedicationAdministration.class, "context") + )); + + refFields.put(ResourceType.Observation, List.of( + new ReferenceFieldWrapper(Observation.class, "subject"), + new ReferenceFieldWrapper(Observation.class, "encounter") + )); + + refFields.put(ResourceType.DiagnosticReport, List.of( + new ReferenceFieldWrapper(DiagnosticReport.class, "subject"), + new ReferenceFieldWrapper(DiagnosticReport.class, "encounter"), + new ReferenceFieldWrapper(DiagnosticReport.class, "result") + )); + + refFields.put(ResourceType.CarePlan, List.of( + new ReferenceFieldWrapper(CarePlan.class, "subject"), + new ReferenceFieldWrapper(CarePlan.class, "encounter") + )); + + refFields.put(ResourceType.DocumentReference, List.of( + new ReferenceFieldWrapper(DocumentReference.class, "subject") + )); + + refFields.put(ResourceType.Claim, List.of( + new ReferenceFieldWrapper(Claim.class, "patient") + )); + + refFields.put(ResourceType.ExplanationOfBenefit, List.of( + new ReferenceFieldWrapper(ExplanationOfBenefit.class, "patient"), + new ReferenceFieldWrapper(ExplanationOfBenefit.class, "claim") + )); + + refFields.put(ResourceType.Provenance, List.of( + new ReferenceFieldWrapper(Provenance.class, "target") + )); + + return refFields; + } } diff --git a/src/test/java/org/mitre/synthea/export/flexporter/ActionsTest.java b/src/test/java/org/mitre/synthea/export/flexporter/ActionsTest.java index 5a025243bc..e35327533d 100644 --- a/src/test/java/org/mitre/synthea/export/flexporter/ActionsTest.java +++ b/src/test/java/org/mitre/synthea/export/flexporter/ActionsTest.java @@ -31,10 +31,12 @@ import org.hl7.fhir.r4.model.InstantType; import org.hl7.fhir.r4.model.Observation; import org.hl7.fhir.r4.model.Patient; +import org.hl7.fhir.r4.model.Period; import org.hl7.fhir.r4.model.Procedure; import org.hl7.fhir.r4.model.Resource; import org.hl7.fhir.r4.model.ResourceType; import org.hl7.fhir.r4.model.ServiceRequest; +import org.hl7.fhir.r4.model.TimeType; import org.hl7.fhir.r4.model.Type; import org.junit.AfterClass; import org.junit.BeforeClass; @@ -353,6 +355,35 @@ public void testCreateResources_createSingle() throws Exception { assertEquals(p.getId(), createdSR.getSubject().getReference()); } + @Test + public void testShiftDates() throws Exception { + Patient p = new Patient(); + p.addName().addGiven("Terry").setFamily("Teal"); + DateType date = new DateType(); + date.fromStringValue("1999-09-29"); + p.setBirthDateElement(date); + + Bundle b = new Bundle(); + b.addEntry().setResource(p); + + Observation o = new Observation(); + Period period = new Period(); + period.setStartElement(new DateTimeType("1999-10-05T10:24:01-05:00")); + period.setEndElement(new DateTimeType("1999-10-06T10:24:01-05:00")); + o.setEffective(period); + o.setIssuedElement(new InstantType("1999-10-06T10:24:01-05:00")); + o.setValue(new TimeType("10:24:01")); + + b.addEntry().setResource(o); + + Map action = getActionByName("testShiftDates"); + Actions.applyAction(b, action, null, null); + + assertEquals("1998-09-29", p.getBirthDateElement().getValueAsString()); + assertEquals("1998-10-05T10:24:01-05:00", period.getStartElement().getValueAsString()); + assertEquals("1998-10-06T10:24:01-05:00", period.getEndElement().getValueAsString()); + } + @Test public void testExec() throws Exception { Map action = getActionByName("testExecuteScript"); diff --git a/src/test/resources/flexporter/test_mapping.yaml b/src/test/resources/flexporter/test_mapping.yaml index 265ccbab2a..d713b04a39 100644 --- a/src/test/resources/flexporter/test_mapping.yaml +++ b/src/test/resources/flexporter/test_mapping.yaml @@ -147,6 +147,10 @@ actions: } } + - name: testShiftDates + shift_dates: P-1Y + # P[n]Y[n]M[n]DT[n]H[n]M[n]S + - name: testDateFilter min_date: !!str "2000-01-01T00:00:00" max_date: !!str "2000-12-31T23:59:59" From 2c95c63f26f18c2a0681922b3dac25c0dedcbfe9 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Tue, 14 Mar 2023 15:21:17 -0400 Subject: [PATCH 25/78] qi core extension testing --- .../export/flexporter/FhirPathUtils.java | 65 ++++++++++--------- .../export/flexporter/ActionsTest.java | 39 +++++++++++ .../resources/flexporter/qicore_minimal.yaml | 13 +++- .../resources/flexporter/test_mapping.yaml | 10 +++ 4 files changed, 94 insertions(+), 33 deletions(-) diff --git a/src/main/java/org/mitre/synthea/export/flexporter/FhirPathUtils.java b/src/main/java/org/mitre/synthea/export/flexporter/FhirPathUtils.java index 1a727b5445..14cc987792 100644 --- a/src/main/java/org/mitre/synthea/export/flexporter/FhirPathUtils.java +++ b/src/main/java/org/mitre/synthea/export/flexporter/FhirPathUtils.java @@ -92,37 +92,40 @@ public static List evaluateBundle(Bundle bundle, String fhirpath, boolean */ public static List evaluateBundle(Bundle bundle, String fhirpath, Map variables, boolean returnResources) { - - for (Map.Entry entry : variables.entrySet()) { - Object replacementObj = entry.getValue(); - - String replacement = null; - if (replacementObj instanceof String) { - replacement = (String) replacementObj; - } else if (replacementObj instanceof List) { - List replacementList = (List) replacementObj; - - replacementList = replacementList.stream() - .map(s -> { - if (StringUtils.isQuoted(s)) { - return s; - } - // quoting strings is very difficult in general - // but for now assume this will simple things like codes - // which don't contain nested quotes - if (s.contains("'")) { - return "\"" + s + "\""; - } else { - return "'" + s + "'"; - } - }) - .collect(Collectors.toList()); - - replacement = "(" + String.join(" | ", replacementList) + ")"; - } - - if (replacement != null) { - fhirpath = fhirpath.replace("%" + entry.getKey(), replacement); + + if (variables != null) { + for (Map.Entry entry : variables.entrySet()) { + Object replacementObj = entry.getValue(); + + String replacement = null; + if (replacementObj instanceof String) { + replacement = (String) replacementObj; + } else if (replacementObj instanceof List) { + List replacementList = (List) replacementObj; + + replacementList = replacementList.stream() + .map(s -> { + if (StringUtils.isQuoted(s)) { + return s; + } + // quoting strings is very difficult in general + // but for now assume this will simple things like codes + // which don't contain nested quotes + if (s.contains("'")) { + return "\"" + s + "\""; + } else { + return "'" + s + "'"; + } + }) + .collect(Collectors.toList()); + + replacement = "(" + String.join(" | ", replacementList) + ")"; + } + + + if (replacement != null) { + fhirpath = fhirpath.replace("%" + entry.getKey(), replacement); + } } } diff --git a/src/test/java/org/mitre/synthea/export/flexporter/ActionsTest.java b/src/test/java/org/mitre/synthea/export/flexporter/ActionsTest.java index e35327533d..2fbb08b2f3 100644 --- a/src/test/java/org/mitre/synthea/export/flexporter/ActionsTest.java +++ b/src/test/java/org/mitre/synthea/export/flexporter/ActionsTest.java @@ -10,7 +10,11 @@ import java.io.FileNotFoundException; import java.io.IOException; import java.nio.file.Files; +import java.time.Instant; +import java.time.ZoneId; +import java.time.format.DateTimeFormatter; import java.util.Arrays; +import java.util.Date; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -26,6 +30,7 @@ import org.hl7.fhir.r4.model.Coding; import org.hl7.fhir.r4.model.DateTimeType; import org.hl7.fhir.r4.model.DateType; +import org.hl7.fhir.r4.model.Extension; import org.hl7.fhir.r4.model.HumanName; import org.hl7.fhir.r4.model.Immunization; import org.hl7.fhir.r4.model.InstantType; @@ -180,6 +185,40 @@ public void testSetValues_getField() { assertEquals("2022-02-22", i.getRecordedElement().getValueAsString()); } + @Test + public void testSetValues_getField_diff_applicability() { + Procedure p1 = new Procedure(); + Date startDate = new Date(0); + Date endDate = new Date(1000000); + p1.setPerformed(new Period().setStart(startDate).setEnd(endDate)); + + Procedure p2 = new Procedure(); + p2.setPerformed(new DateTimeType(new Date(0))); + + Bundle b = new Bundle(); + b.addEntry().setResource(p1); + b.addEntry().setResource(p2); + + Map action = getActionByName("testSetValues_getField_diff_applicability"); + + Actions.applyAction(b, action, null, null); + + // HAPI automatically applies the local timezone to dates, + // so we can't just pick a fixed string to compare to + String timeZeroInLocalTime = Instant.ofEpochMilli(0).atZone(ZoneId.systemDefault()) + .format(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + + Extension e1 = p1.getExtensionByUrl("http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-recorded"); + assertNotNull(e1); + DateTimeType d1 = (DateTimeType) e1.getValue(); + assertEquals(timeZeroInLocalTime, d1.getValueAsString()); + + Extension e2 = p2.getExtensionByUrl("http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-recorded"); + assertNotNull(e2); + DateTimeType d2 = (DateTimeType) e2.getValue(); + assertEquals(timeZeroInLocalTime, d2.getValueAsString()); + } + @Test public void testSetValues_overwrite() { Observation o = new Observation(); diff --git a/src/test/resources/flexporter/qicore_minimal.yaml b/src/test/resources/flexporter/qicore_minimal.yaml index b7498614c9..113df6dcff 100644 --- a/src/test/resources/flexporter/qicore_minimal.yaml +++ b/src/test/resources/flexporter/qicore_minimal.yaml @@ -20,8 +20,8 @@ actions: applicability: Patient - profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter applicability: Encounter - - profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-condition - applicability: Condition + # - profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-condition + # applicability: Condition - profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation applicability: Observation - profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-procedure @@ -56,5 +56,14 @@ actions: # since that's what's actually in the JSON # but that doesn't seem to work with HAPI's FhirPath + - applicability: Procedure.performed.ofType(Period) + fields: + - location: Procedure.extension.where(url='http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-recorded').valueDateTime + value: $getField([Procedure.performed.start]) + - applicability: Procedure.performed.ofType(dateTime) + fields: + - location: Procedure.extension.where(url='http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-recorded').valueDateTime + value: $getField([Procedure.performed]) + diff --git a/src/test/resources/flexporter/test_mapping.yaml b/src/test/resources/flexporter/test_mapping.yaml index d713b04a39..6dc54780c6 100644 --- a/src/test/resources/flexporter/test_mapping.yaml +++ b/src/test/resources/flexporter/test_mapping.yaml @@ -43,6 +43,16 @@ actions: # but that doesn't seem to work with HAPI's FhirPath + - name: testSetValues_getField_diff_applicability + set_values: + - applicability: Procedure.performed.ofType(Period) + fields: + - location: Procedure.extension.where(url='http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-recorded').valueDateTime + value: $getField([Procedure.performed.start]) + - applicability: Procedure.performed.ofType(dateTime) + fields: + - location: Procedure.extension.where(url='http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-recorded').valueDateTime + value: $getField([Procedure.performed]) - name: testSetValues_overwrite set_values: From ba34ba8a3a2194e8beb7a687e49a594bfa82db8e Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Tue, 14 Mar 2023 15:58:00 -0400 Subject: [PATCH 26/78] it's always timezones --- .../synthea/export/flexporter/ActionsTest.java | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/test/java/org/mitre/synthea/export/flexporter/ActionsTest.java b/src/test/java/org/mitre/synthea/export/flexporter/ActionsTest.java index 2fbb08b2f3..0d3ce7fa56 100644 --- a/src/test/java/org/mitre/synthea/export/flexporter/ActionsTest.java +++ b/src/test/java/org/mitre/synthea/export/flexporter/ActionsTest.java @@ -12,6 +12,7 @@ import java.nio.file.Files; import java.time.Instant; import java.time.ZoneId; +import java.time.ZonedDateTime; import java.time.format.DateTimeFormatter; import java.util.Arrays; import java.util.Date; @@ -202,21 +203,16 @@ public void testSetValues_getField_diff_applicability() { Map action = getActionByName("testSetValues_getField_diff_applicability"); Actions.applyAction(b, action, null, null); - - // HAPI automatically applies the local timezone to dates, - // so we can't just pick a fixed string to compare to - String timeZeroInLocalTime = Instant.ofEpochMilli(0).atZone(ZoneId.systemDefault()) - .format(DateTimeFormatter.ISO_OFFSET_DATE_TIME); Extension e1 = p1.getExtensionByUrl("http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-recorded"); assertNotNull(e1); - DateTimeType d1 = (DateTimeType) e1.getValue(); - assertEquals(timeZeroInLocalTime, d1.getValueAsString()); + String d1 = ((DateTimeType) e1.getValue()).getValueAsString(); + assertEquals(0, ZonedDateTime.parse(d1).toInstant().getEpochSecond()); Extension e2 = p2.getExtensionByUrl("http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-recorded"); assertNotNull(e2); - DateTimeType d2 = (DateTimeType) e2.getValue(); - assertEquals(timeZeroInLocalTime, d2.getValueAsString()); + String d2 = ((DateTimeType) e2.getValue()).getValueAsString(); + assertEquals(0, ZonedDateTime.parse(d2).toInstant().getEpochSecond()); } @Test From 636afa9f6a43bc5de80e1bf69c36b4262e50ece1 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Wed, 29 Mar 2023 14:30:27 -0400 Subject: [PATCH 27/78] allow create_resource based on state --- .../synthea/export/flexporter/Actions.java | 75 ++++++++++++-- .../export/flexporter/FhirPathUtils.java | 12 +-- .../FlexporterJavascriptContext.java | 12 ++- .../export/flexporter/ActionsTest.java | 97 +++++++++++++++++-- .../FlexporterJavaScriptContextTest.java | 2 +- .../resources/flexporter/qicore_minimal.yaml | 4 +- .../resources/flexporter/test_mapping.yaml | 31 +++++- 7 files changed, 203 insertions(+), 30 deletions(-) diff --git a/src/main/java/org/mitre/synthea/export/flexporter/Actions.java b/src/main/java/org/mitre/synthea/export/flexporter/Actions.java index 2dca8d4627..952664e0a9 100644 --- a/src/main/java/org/mitre/synthea/export/flexporter/Actions.java +++ b/src/main/java/org/mitre/synthea/export/flexporter/Actions.java @@ -5,7 +5,9 @@ import java.time.Duration; import java.time.LocalDateTime; import java.time.temporal.TemporalAmount; +import java.util.ArrayList; import java.util.Collections; +import java.util.Date; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; @@ -13,6 +15,7 @@ import java.util.Map; import java.util.Set; import java.util.UUID; +import java.util.stream.Collectors; import org.apache.commons.lang3.StringUtils; import org.hl7.fhir.r4.model.Base; @@ -21,8 +24,12 @@ import org.hl7.fhir.r4.model.Bundle.BundleEntryRequestComponent; import org.hl7.fhir.r4.model.Bundle.BundleType; import org.hl7.fhir.r4.model.Bundle.HTTPVerb; +import org.hl7.fhir.r4.model.DateTimeType; +import org.hl7.fhir.r4.model.Encounter; import org.hl7.fhir.r4.model.Meta; +import org.hl7.fhir.r4.model.Period; import org.hl7.fhir.r4.model.Resource; +import org.mitre.synthea.engine.State; import org.mitre.synthea.export.FhirR4; import org.mitre.synthea.export.flexporter.FieldWrapper.DateFieldWrapper; import org.mitre.synthea.export.flexporter.FieldWrapper.ReferenceFieldWrapper; @@ -198,20 +205,74 @@ public static void createResource(Bundle bundle, List> resou for (Map newResourceDef : resourcesToCreate) { String resourceType = (String) newResourceDef.get("resourceType"); - String basedOnPath = (String) newResourceDef.get("based_on"); + + String basedOnPath = null; + String basedOnState = null; + String basedOnModule = null; + Map basedOn = (Map) newResourceDef.get("based_on"); + if (basedOn != null) { + basedOnPath = (String) basedOn.get("resource"); + basedOnState = (String) basedOn.get("state"); + basedOnModule = (String) basedOn.get("module"); + } + List profiles = (List) newResourceDef.get("profiles"); List basedOnResources; List> writeback; - if (basedOnPath == null) { - basedOnResources = Collections.singletonList(null); - writeback = null; - } else { + if (basedOnPath != null) { basedOnResources = FhirPathUtils.evaluateBundle(bundle, basedOnPath, true); // this may return empty list, in which no new resources will be created writeback = (List>) newResourceDef.get("writeback"); + + } else if (basedOnState != null && basedOnModule != null) { + String moduleKey = String.format("%s Module", basedOnModule); + List moduleHistory = (List)person.attributes.get(moduleKey); + + if (moduleHistory == null) { + + // TODO - maybe throw an exception? + return; + } + final String basedOnStateName = basedOnState; // java weirdness + List instances = moduleHistory.stream() + .filter(s -> s.name.equals(basedOnStateName)) + .collect(Collectors.toList()); + + basedOnResources = new ArrayList<>(); + + for (State instance : instances) { + Long entered = instance.entered; + Long exited = instance.exited; + + // map these to a FHIR type so that we can re-use the existing concepts + + // TODO: not sure Encounter is the best but it gives us a Period + // and a reference to another encounter. + // Parameters could also work if we want more generic things, + // but the FHIRPath to retrieve from it is ugly + Encounter dummyEncounter = new Encounter(); + Period period = new Period(); + if (entered != null) { + period.setStartElement(new DateTimeType(new Date(entered))); + } + if (exited != null) { + period.setEndElement(new DateTimeType(new Date(exited))); + } + dummyEncounter.setPeriod(period); + // TODO: figure out what encounter, if any, was active at this time + // and set the dummy.partOf as a reference to it + // dummyEncounter.setPartOf(new Reference("urn:uuid:" + enc.uuid.toString())); + + basedOnResources.add(dummyEncounter); + } + + writeback = null; + } else { + basedOnResources = Collections.singletonList(null); + writeback = null; } List> fields = (List>) newResourceDef.get("fields"); @@ -232,6 +293,7 @@ public static void createResource(Bundle bundle, List> resou // seems like this should work as part of the fhirpathgenerator, but it didn't // this might be easier anyway createdResource.setId(UUID.randomUUID().toString()); + // TODO: consistent UUIDs if (profiles != null) { profiles.forEach(p -> applyProfile(createdResource, p)); } @@ -549,7 +611,8 @@ public static Bundle executeScript(List> scripts, Bundle bun if (applyTo.equalsIgnoreCase("bundle")) { fjContext.applyFunctionToBundle(functionName); } else if (applyTo.equalsIgnoreCase("resource") || applyTo.equalsIgnoreCase("resources")) { - fjContext.applyFunctionToResources(functionName); + String resourceType = scriptDef.get("resource_type"); + fjContext.applyFunctionToResources(functionName, resourceType); } else { throw new IllegalArgumentException("Unknown option for execute_script.apply_to: '" + applyTo + "'. Valid options are 'bundle' and 'resources'"); diff --git a/src/main/java/org/mitre/synthea/export/flexporter/FhirPathUtils.java b/src/main/java/org/mitre/synthea/export/flexporter/FhirPathUtils.java index 14cc987792..4849ff42dc 100644 --- a/src/main/java/org/mitre/synthea/export/flexporter/FhirPathUtils.java +++ b/src/main/java/org/mitre/synthea/export/flexporter/FhirPathUtils.java @@ -92,17 +92,17 @@ public static List evaluateBundle(Bundle bundle, String fhirpath, boolean */ public static List evaluateBundle(Bundle bundle, String fhirpath, Map variables, boolean returnResources) { - + if (variables != null) { for (Map.Entry entry : variables.entrySet()) { Object replacementObj = entry.getValue(); - + String replacement = null; if (replacementObj instanceof String) { replacement = (String) replacementObj; } else if (replacementObj instanceof List) { List replacementList = (List) replacementObj; - + replacementList = replacementList.stream() .map(s -> { if (StringUtils.isQuoted(s)) { @@ -118,11 +118,11 @@ public static List evaluateBundle(Bundle bundle, String fhirpath, } }) .collect(Collectors.toList()); - + replacement = "(" + String.join(" | ", replacementList) + ")"; } - - + + if (replacement != null) { fhirpath = fhirpath.replace("%" + entry.getKey(), replacement); } diff --git a/src/main/java/org/mitre/synthea/export/flexporter/FlexporterJavascriptContext.java b/src/main/java/org/mitre/synthea/export/flexporter/FlexporterJavascriptContext.java index e86faf7097..d031c3c19b 100644 --- a/src/main/java/org/mitre/synthea/export/flexporter/FlexporterJavascriptContext.java +++ b/src/main/java/org/mitre/synthea/export/flexporter/FlexporterJavascriptContext.java @@ -3,6 +3,7 @@ import java.io.IOException; import java.net.URL; +import org.apache.commons.lang3.StringUtils; import org.graalvm.polyglot.Context; import org.graalvm.polyglot.Source; import org.graalvm.polyglot.Value; @@ -105,8 +106,9 @@ public void applyFunctionToBundle(String fnName) { * The function must have already been loaded by loadFile or loadFunction. * * @param fnName Function name to invoke + * @param resourceType Resource Type to apply the function to, other resources will be ignored */ - public void applyFunctionToResources(String fnName) { + public void applyFunctionToResources(String fnName, String resourceType) { // assumption is the fn has already been loaded by loadFunction Value applyFn = jsContext.getBindings("js").getMember(fnName); @@ -115,9 +117,15 @@ public void applyFunctionToResources(String fnName) { for (int i = 0; i < entries.getArraySize(); i++) { Value entry = entries.getArrayElement(i); - Value resource = entry.getMember("resource"); + if (StringUtils.isNotBlank(resourceType)) { + String type = resource.getMember("resourceType").asString(); + if (!resourceType.equalsIgnoreCase(type)) { + continue; + } + } + // provide both the resource and the full bundle for context // (eg, so we can create references to other resources) applyFn.execute(resource, workingBundleAsJSObject); diff --git a/src/test/java/org/mitre/synthea/export/flexporter/ActionsTest.java b/src/test/java/org/mitre/synthea/export/flexporter/ActionsTest.java index 0d3ce7fa56..a1907d54e5 100644 --- a/src/test/java/org/mitre/synthea/export/flexporter/ActionsTest.java +++ b/src/test/java/org/mitre/synthea/export/flexporter/ActionsTest.java @@ -10,14 +10,12 @@ import java.io.FileNotFoundException; import java.io.IOException; import java.nio.file.Files; -import java.time.Instant; -import java.time.ZoneId; import java.time.ZonedDateTime; -import java.time.format.DateTimeFormatter; import java.util.Arrays; import java.util.Date; import java.util.HashMap; import java.util.HashSet; +import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Set; @@ -35,6 +33,7 @@ import org.hl7.fhir.r4.model.HumanName; import org.hl7.fhir.r4.model.Immunization; import org.hl7.fhir.r4.model.InstantType; +import org.hl7.fhir.r4.model.MedicationRequest; import org.hl7.fhir.r4.model.Observation; import org.hl7.fhir.r4.model.Patient; import org.hl7.fhir.r4.model.Period; @@ -47,6 +46,8 @@ import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; +import org.mitre.synthea.engine.Module; +import org.mitre.synthea.engine.State; import org.mitre.synthea.export.FhirR4; import org.mitre.synthea.world.agents.Person; @@ -192,29 +193,29 @@ public void testSetValues_getField_diff_applicability() { Date startDate = new Date(0); Date endDate = new Date(1000000); p1.setPerformed(new Period().setStart(startDate).setEnd(endDate)); - + Procedure p2 = new Procedure(); p2.setPerformed(new DateTimeType(new Date(0))); - + Bundle b = new Bundle(); b.addEntry().setResource(p1); b.addEntry().setResource(p2); - + Map action = getActionByName("testSetValues_getField_diff_applicability"); Actions.applyAction(b, action, null, null); - + Extension e1 = p1.getExtensionByUrl("http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-recorded"); assertNotNull(e1); String d1 = ((DateTimeType) e1.getValue()).getValueAsString(); assertEquals(0, ZonedDateTime.parse(d1).toInstant().getEpochSecond()); - + Extension e2 = p2.getExtensionByUrl("http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-recorded"); assertNotNull(e2); String d2 = ((DateTimeType) e2.getValue()).getValueAsString(); assertEquals(0, ZonedDateTime.parse(d2).toInstant().getEpochSecond()); } - + @Test public void testSetValues_overwrite() { Observation o = new Observation(); @@ -504,6 +505,84 @@ public void testCreateResources_createBasedOn() throws Exception { } + @Test + public void testCreateResources_createBasedOnState() throws Exception { + Patient p = new Patient(); + p.setId("mypatient"); + + Bundle b = new Bundle(); + b.setType(BundleType.COLLECTION); + b.addEntry().setResource(p); + + Person person = new Person(0L); + person.history = new LinkedList(); + Module m = Module.getModuleByPath("sinusitis"); + + // this is cheating but the alternative is to pick a seed that goes through this path + // which is flaky + for (String stateName : List.of("Initial", "Potential_Onset", "Bacterial_Infection_Starts", + "Doctor_Visit", "Penicillin_Allergy_Check", "Prescribe_Alternative_Antibiotic")) { + State s = m.getState(stateName).clone(); + + s.entered = 120_000L; + s.exited = 120_000L; + + person.history.add(0, s); + } + person.attributes.put(m.name, person.history); + + + Map action = getActionByName("testCreateResources_createBasedOnState"); + + Actions.applyAction(b, action, person, null); + + + + List entries = b.getEntry(); + assertEquals(2, entries.size()); + /* + - name: testCreateResources_createBasedOnState + create_resource: + - resourceType: MedicationRequest + based_on: + module: Sinusitis + state: Prescribe_Alternative_Antibiotic + profiles: + - http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-medicationnotrequested + fields: + - location: MedicationRequest.doNotPerform + value: "true" + - location: MedicationRequest.status + value: completed + - location: MedicationRequest.intent + value: order + # - location: MedicationRequest.encounter.reference + # value: $getField([Procedure.encounter.reference]) + - location: MedicationRequest.subject.reference + value: $findRef([Patient]) + # - location: MedicationRequest.medicationCodeableConcept + # value: $getField([Procedure.code]) + - location: MedicationRequest.authoredOn + value: $getField([Encounter.period.start]) + */ + + Resource newResource = entries.get(1).getResource(); + + assertEquals("MedicationRequest", newResource.getResourceType().toString()); + + MedicationRequest mr = (MedicationRequest) newResource; + + assertEquals(true, mr.getDoNotPerform()); + assertEquals("COMPLETED", mr.getStatus().toString()); + assertEquals("ORDER", mr.getIntent().toString()); + assertEquals("Patient/mypatient", mr.getSubject().getReference()); + + // note: the date conversion loses the millis part + // so this will only work if the value % 1000 == 0 + assertEquals(120_000L, mr.getAuthoredOn().toInstant().toEpochMilli()); + } + + @Test public void testGetAttribute() throws Exception { Bundle b = new Bundle(); diff --git a/src/test/java/org/mitre/synthea/export/flexporter/FlexporterJavaScriptContextTest.java b/src/test/java/org/mitre/synthea/export/flexporter/FlexporterJavaScriptContextTest.java index c4cfde18d6..6e912f2d9b 100644 --- a/src/test/java/org/mitre/synthea/export/flexporter/FlexporterJavaScriptContextTest.java +++ b/src/test/java/org/mitre/synthea/export/flexporter/FlexporterJavaScriptContextTest.java @@ -44,7 +44,7 @@ public void testJavascriptContext() { context.loadBundle(bundleJson); context.applyFunctionToBundle("giveEveryResourceSomeText"); - context.applyFunctionToResources("applySomeProfile"); + context.applyFunctionToResources("applySomeProfile", "Patient"); String outBundleJson = context.getBundle(); diff --git a/src/test/resources/flexporter/qicore_minimal.yaml b/src/test/resources/flexporter/qicore_minimal.yaml index 113df6dcff..822469e153 100644 --- a/src/test/resources/flexporter/qicore_minimal.yaml +++ b/src/test/resources/flexporter/qicore_minimal.yaml @@ -20,8 +20,8 @@ actions: applicability: Patient - profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter applicability: Encounter - # - profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-condition - # applicability: Condition + - profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-condition-encounter-diagnosis + applicability: Condition - profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation applicability: Observation - profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-procedure diff --git a/src/test/resources/flexporter/test_mapping.yaml b/src/test/resources/flexporter/test_mapping.yaml index 6dc54780c6..55351938fd 100644 --- a/src/test/resources/flexporter/test_mapping.yaml +++ b/src/test/resources/flexporter/test_mapping.yaml @@ -107,7 +107,8 @@ actions: - name: testCreateResources_createBasedOn create_resource: - resourceType: ServiceRequest - based_on: Procedure + based_on: + resource: Procedure fields: - location: ServiceRequest.intent value: plan @@ -128,6 +129,29 @@ actions: - location: Procedure.basedOn.reference value: $setRef([ServiceRequest]) + - name: testCreateResources_createBasedOnState + create_resource: + - resourceType: MedicationRequest + based_on: + module: Sinusitis + state: Prescribe_Alternative_Antibiotic + profiles: + - http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-medicationnotrequested + fields: + - location: MedicationRequest.doNotPerform + value: "true" + - location: MedicationRequest.status + value: completed + - location: MedicationRequest.intent + value: order + # - location: MedicationRequest.encounter.reference + # value: $getField([Procedure.encounter.reference]) + - location: MedicationRequest.subject.reference + value: $findRef([Patient]) + # - location: MedicationRequest.medicationCodeableConcept + # value: $getField([Procedure.code]) + - location: MedicationRequest.authoredOn + value: $getField([Encounter.period.start]) - name: testCreateResources_getAttribute create_resource: @@ -150,11 +174,10 @@ actions: } - apply_to: resource function_name: apply2 + resource_type: Patient function: | function apply2(resource, bundle) { - if (resource.resourceType == 'Patient') { - resource.birthDate = '2022-02-22'; - } + resource.birthDate = '2022-02-22'; } - name: testShiftDates From b2454d051bf6568c253f1226d5a525e0524b3c64 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Wed, 31 May 2023 15:00:01 -0400 Subject: [PATCH 28/78] cleanup --- .../synthea/export/flexporter/Actions.java | 31 ++++++++++++++++--- .../export/flexporter/FieldWrapper.java | 1 - .../export/flexporter/ActionsTest.java | 2 +- .../resources/flexporter/test_mapping.yaml | 2 +- 4 files changed, 28 insertions(+), 8 deletions(-) diff --git a/src/main/java/org/mitre/synthea/export/flexporter/Actions.java b/src/main/java/org/mitre/synthea/export/flexporter/Actions.java index 952664e0a9..9670a6da65 100644 --- a/src/main/java/org/mitre/synthea/export/flexporter/Actions.java +++ b/src/main/java/org/mitre/synthea/export/flexporter/Actions.java @@ -217,6 +217,7 @@ public static void createResource(Bundle bundle, List> resou } List profiles = (List) newResourceDef.get("profiles"); + List> fields = (List>) newResourceDef.get("fields"); List basedOnResources; List> writeback; @@ -269,13 +270,32 @@ public static void createResource(Bundle bundle, List> resou basedOnResources.add(dummyEncounter); } + if (!basedOnResources.isEmpty()) { + // rewrite "State.entered" to "Encounter.period.start", etc + // so that the end user doesn't have to know we used an Encounter + + for (Map field : fields) { + Object valueDef = field.get("value"); + if (valueDef instanceof String && ((String) valueDef).startsWith("$")) { + String value = (String) valueDef; + if (value.contains("State.")) { + value = value + .replace("State.entered", "Encounter.period.start") + .replace("State.exited", "Encounter.period.end"); + + field.put("value", value); + } + } + } + + } + writeback = null; } else { basedOnResources = Collections.singletonList(null); writeback = null; } - List> fields = (List>) newResourceDef.get("fields"); for (Base basedOnItem : basedOnResources) { // IMPORTANT: basedOnItem may be null @@ -373,7 +393,8 @@ private static Map createFhirPathMapping(List fhirPathMapping, * @param bundle FHIR Bundle to filter * @param list List of resource types to retain, all other types not listed will be removed */ - public static void keepResources(Bundle bundle, List list) { + private static void keepResources(Bundle bundle, List list) { // TODO: make this FHIRPath instead of just straight resource types Set resourceTypesToKeep = new HashSet<>(list); @@ -430,7 +451,7 @@ public static void keepResources(Bundle bundle, List list) { } } - public static void shiftDates(Bundle bundle, String amountString) { + private static void shiftDates(Bundle bundle, String amountString) { if (amountString == null) { return; } @@ -463,7 +484,7 @@ public static void shiftDates(Bundle bundle, String amountString) { } } - public static void dateFilter(Bundle bundle, String minDateStr, String maxDateStr) { + private static void dateFilter(Bundle bundle, String minDateStr, String maxDateStr) { if (minDateStr == null && maxDateStr == null) { return; } diff --git a/src/main/java/org/mitre/synthea/export/flexporter/FieldWrapper.java b/src/main/java/org/mitre/synthea/export/flexporter/FieldWrapper.java index 771127251a..29b037be98 100644 --- a/src/main/java/org/mitre/synthea/export/flexporter/FieldWrapper.java +++ b/src/main/java/org/mitre/synthea/export/flexporter/FieldWrapper.java @@ -87,7 +87,6 @@ public void set(Resource resource, IBase value) { public static class DateFieldWrapper extends FieldWrapper { - public DateFieldWrapper(String fieldPath) { super(fieldPath); } diff --git a/src/test/java/org/mitre/synthea/export/flexporter/ActionsTest.java b/src/test/java/org/mitre/synthea/export/flexporter/ActionsTest.java index a1907d54e5..c8bdecde48 100644 --- a/src/test/java/org/mitre/synthea/export/flexporter/ActionsTest.java +++ b/src/test/java/org/mitre/synthea/export/flexporter/ActionsTest.java @@ -563,7 +563,7 @@ public void testCreateResources_createBasedOnState() throws Exception { # - location: MedicationRequest.medicationCodeableConcept # value: $getField([Procedure.code]) - location: MedicationRequest.authoredOn - value: $getField([Encounter.period.start]) + value: $getField([State.entered]) */ Resource newResource = entries.get(1).getResource(); diff --git a/src/test/resources/flexporter/test_mapping.yaml b/src/test/resources/flexporter/test_mapping.yaml index 55351938fd..fce2713676 100644 --- a/src/test/resources/flexporter/test_mapping.yaml +++ b/src/test/resources/flexporter/test_mapping.yaml @@ -151,7 +151,7 @@ actions: # - location: MedicationRequest.medicationCodeableConcept # value: $getField([Procedure.code]) - location: MedicationRequest.authoredOn - value: $getField([Encounter.period.start]) + value: $getField([State.entered]) - name: testCreateResources_getAttribute create_resource: From d9eae1aed95abebd8bd6bfca10278fcce1a57817 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Thu, 22 Jun 2023 13:44:52 -0400 Subject: [PATCH 29/78] update javadocs --- .../synthea/export/flexporter/Actions.java | 5 +- .../export/flexporter/FieldWrapper.java | 93 +++++++++++++++---- 2 files changed, 77 insertions(+), 21 deletions(-) diff --git a/src/main/java/org/mitre/synthea/export/flexporter/Actions.java b/src/main/java/org/mitre/synthea/export/flexporter/Actions.java index 9670a6da65..f5ac594cfe 100644 --- a/src/main/java/org/mitre/synthea/export/flexporter/Actions.java +++ b/src/main/java/org/mitre/synthea/export/flexporter/Actions.java @@ -532,9 +532,12 @@ private static void dateFilter(Bundle bundle, String minDateStr, String maxDateS /** * Filter the Bundle by removing selected resources. + * Resources that reference deleted resources will also be deleted, and so on. + * TODO: Support different methods for handling references: + * Cascade (current), Delete reference field but leave object, Do nothing * * @param bundle FHIR Bundle to filter - * @param list List of resource types to delete, all other types not listed will be kept + * @param list List of resource types to delete, other types not listed will be kept */ public static void deleteResources(Bundle bundle, List list) { // TODO: make this FHIRPath instead of just straight resource types diff --git a/src/main/java/org/mitre/synthea/export/flexporter/FieldWrapper.java b/src/main/java/org/mitre/synthea/export/flexporter/FieldWrapper.java index 29b037be98..327a764d51 100644 --- a/src/main/java/org/mitre/synthea/export/flexporter/FieldWrapper.java +++ b/src/main/java/org/mitre/synthea/export/flexporter/FieldWrapper.java @@ -44,7 +44,15 @@ public abstract class FieldWrapper { protected BaseRuntimeChildDefinition fieldDef; + /** + * Create a FieldWrapper for the field defined by the given path. + * + * @param fieldPath Path to FHIR field (not FHIRPath). Should be of the form: + * Resource.field.nestedField.nested2... + */ public FieldWrapper(String fieldPath) { + // split at the first . so we get two items in the array: + // [0] = resource, [1] = field[.nestedField etc] String[] pathParts = fieldPath.split("\\.", 2); try { @@ -60,6 +68,12 @@ public FieldWrapper(String fieldPath) { } } + /** + * Create a FieldWrapper for the field on the given resource type defined by the given path. + * + * @param fieldName Path to FHIR field (not FHIRPath). Should not include resourceType and + * should be of the form: field.nestedField.nested2... + */ public FieldWrapper(Class clazz, String fieldName) { init(clazz, fieldName); } @@ -68,24 +82,44 @@ private void init(Class clazz, String fieldName) { RuntimeResourceDefinition rd = FhirR4.getContext().getResourceDefinition(clazz); // TODO: this only gets top-level fields. update to suport nested fields this.fieldDef = rd.getChildByName(fieldName); - if (this.fieldDef == null) { - System.out.println("breakpoint"); - } } + /** + * Get a single value from the field this FieldWrapper represents from the given resource. + * For fields that may have more than a single value, use getAll(Resource) instead. + * Calling this on a field that has more than one value will return only the first value. + * @param resource Resource to get value from + * @return the value from the field + */ public IBase getSingle(Resource resource) { return fieldDef.getAccessor().getFirstValueOrNull(resource).orElse(null); } + /** + * Get the values from the field this FieldWrapper represents from the given resource. + * @param resource Resource to get value from + * @return the list of values from the field + */ public List getAll(Resource resource) { return fieldDef.getAccessor().getValues(resource); } + /** + * Set the given value for the field this FieldWrapper represents on the given resource. + * @param resource The resource to set a value on + * @param value The value to set + */ public void set(Resource resource, IBase value) { fieldDef.getMutator().setValue(resource, value); } + /** + * DateFieldWrapper is used to represent a field on a resource representing a date and/or time. + * This wrapper offers convenience features such as normalizing the various types that a FHIR + * field can be to a LocalDateTime, checking if the value is in a given range, + * and shifting the value by a given amount. + */ public static class DateFieldWrapper extends FieldWrapper { public DateFieldWrapper(String fieldPath) { super(fieldPath); @@ -95,9 +129,16 @@ public DateFieldWrapper(Class clazz, String fieldName) { super(clazz, fieldName); } + /** + * Normalize the given raw date value into a LocalDateTime. FHIR values can be a number of + * different types so this checks which one the value is and converts accordingly. + * @param rawValue Original raw FHIR value + * @return parsed date as LocalDateTime + */ private static LocalDateTime normalize(IBase rawValue) { if (!(rawValue instanceof Base)) { // should never happen, not sure it's possible + // (though this also catches nulls) return null; } @@ -121,53 +162,51 @@ private static LocalDateTime normalize(IBase rawValue) { // various reasons we arrive here, for example a choice type that includes non-time values return null; - } - public static Period shift(Period period, TemporalAmount amount) { + /** + * Shift the Period by the given TemporalAmount, by shifting both the start and end + * elements of the Period by the given amount. + * @param period Period to shift + * @param amount TemporalAmount to shift by + * @return the shifted Period (note: the same object instance as passed in) + */ + static Period shift(Period period, TemporalAmount amount) { if (period == null) { return null; } period.setStartElement(shift(period.getStartElement(), amount)); period.setEndElement(shift(period.getEndElement(), amount)); - return period; } - public static DateTimeType shift(DateTimeType dateTime, TemporalAmount amount) { + static DateTimeType shift(DateTimeType dateTime, TemporalAmount amount) { if (dateTime == null) { return null; } String s = dateTime.getValueAsString(); - ZonedDateTime shifted = ZonedDateTime.parse(s).plus(amount); - dateTime.setValueAsString(shifted.toString()); - return dateTime; } - public static DateType shift(DateType date, TemporalAmount amount) { + static DateType shift(DateType date, TemporalAmount amount) { if (date == null) { return null; } String s = date.getValueAsString(); - LocalDate shifted = LocalDate.parse(s).plus(amount); - date.setValueAsString(shifted.toString()); - return date; } - public static TimeType shift(TimeType time, TemporalAmount amount) { + static TimeType shift(TimeType time, TemporalAmount amount) { if (time == null) { return null; } - if (amount instanceof java.time.Period) { // trying to shift years/months/days but we only have a time of day // so just keep it the same @@ -175,15 +214,12 @@ public static TimeType shift(TimeType time, TemporalAmount amount) { } String t = time.getValue(); - LocalTime localTime = LocalTime.parse(t).plus(amount); - time.setValue(localTime.toString()); - return time; } - public static InstantType shift(InstantType instant, TemporalAmount amount) { + static InstantType shift(InstantType instant, TemporalAmount amount) { if (instant == null) { return null; } @@ -199,6 +235,11 @@ public static InstantType shift(InstantType instant, TemporalAmount amount) { return instant; } + /** + * Shift the value of the field represented by this FieldWrapper by the given amount. + * @param resource Resource to modify the value on + * @param amount Amount to shift the date by + */ public void shift(Resource resource, TemporalAmount amount) { IBase value = getSingle(resource); if (value == null) { @@ -228,6 +269,15 @@ public void shift(Resource resource, TemporalAmount amount) { set(resource, newValue); } + /** + * Tests if the value of the field represented by this FieldWrapper is in the given range. + * At least one or both of min or max is required, an "open range" is possible by + * providing only one. + * @param resource Resource to get the value from + * @param min Earliest/start value of the time range + * @param max Latest/stop/end value of the time range + * @return Whether the value is in the range. + */ public boolean valueInRange(Resource resource, LocalDateTime min, LocalDateTime max) { if (min == null && max == null) { return true; @@ -285,6 +335,9 @@ public boolean valueInRange(Resource resource, LocalDateTime min, LocalDateTime public static final Map> DATE_FIELDS = buildDateFields(); + // TODO: this could instead iterate over all fields on relevant resources, + // which might be cleaner but also slower, especially if it means a lot of iteration + // over resource types or fields we never use private static Map> buildDateFields() { Map> dateFields = new HashMap<>(); From e3f376e6e1a4ff6ee78cea51cea1520438006fa3 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Thu, 6 Jul 2023 16:54:09 -0400 Subject: [PATCH 30/78] more javadocs --- .../mitre/synthea/export/flexporter/Actions.java | 14 ++++++++++++++ .../synthea/export/flexporter/FieldWrapper.java | 12 ++++++++++++ 2 files changed, 26 insertions(+) diff --git a/src/main/java/org/mitre/synthea/export/flexporter/Actions.java b/src/main/java/org/mitre/synthea/export/flexporter/Actions.java index f5ac594cfe..bde9d50464 100644 --- a/src/main/java/org/mitre/synthea/export/flexporter/Actions.java +++ b/src/main/java/org/mitre/synthea/export/flexporter/Actions.java @@ -451,6 +451,12 @@ private static void keepResources(Bundle bundle, List list) { } } + /** + * Shift all dates on all resources in the Bundle. Note this only modifies date/time-type fields + * on resources and cannot modify dates embedded within strings (for example, clinical notes). + * @param bundle FHIR Bundle to shift dates for + * @param amountString Amount to shift in ISO-8601 format, either Period or Duration + */ private static void shiftDates(Bundle bundle, String amountString) { if (amountString == null) { return; @@ -484,6 +490,14 @@ private static void shiftDates(Bundle bundle, String amountString) { } } + /** + * Filter the Bundle by date. If any resource has a date outside the provided range + * it will be filtered out. + * TODO: align this with export.years_of_history filter. "active" items outside range? + * @param bundle The Bundle to filter + * @param minDateStr Earliest/start value of the time range, in ISO-8601 format + * @param maxDateStr Latest/stop/end value of the time range, in ISO-8601 format + */ private static void dateFilter(Bundle bundle, String minDateStr, String maxDateStr) { if (minDateStr == null && maxDateStr == null) { return; diff --git a/src/main/java/org/mitre/synthea/export/flexporter/FieldWrapper.java b/src/main/java/org/mitre/synthea/export/flexporter/FieldWrapper.java index 327a764d51..f0820e4268 100644 --- a/src/main/java/org/mitre/synthea/export/flexporter/FieldWrapper.java +++ b/src/main/java/org/mitre/synthea/export/flexporter/FieldWrapper.java @@ -379,6 +379,12 @@ public ReferenceFieldWrapper(Class clazz, String fieldName) super(clazz, fieldName); } + /** + * Get a single reference from the field this FieldWrapper represents on the given resource, + * as a string. + * @param resource Resource to get the value from + * @return Reference as string, ex. "Patient/123" or "urn:uuid:98d1c..." + */ public String getReference(Resource resource) { IBase referenceObject = getSingle(resource); if (!(referenceObject instanceof Reference)) { @@ -388,6 +394,12 @@ public String getReference(Resource resource) { return ref.getReference(); } + /** + * Get all references from the field this FieldWrapper represents on the given resource, + * as a list of strings. + * @param resource Resource to get the value from + * @return References as strings, ex. "Patient/123" or "urn:uuid:98d1c..." + */ public List getReferences(Resource resource) { List referenceObjects = getAll(resource); From 9d2ffa19a2c3bbc26b64dfca28102bb8d84372dd Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Tue, 1 Aug 2023 11:23:55 -0400 Subject: [PATCH 31/78] bump graal dependency per sonatype --- build.gradle | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index 03dbfb997a..12f5388b11 100644 --- a/build.gradle +++ b/build.gradle @@ -71,10 +71,9 @@ dependencies { implementation 'guru.nidi:graphviz-java:0.18.1' // JavaScript engine included for graphviz. It gets used // if someone does not have graphviz installed in their environment - implementation 'org.graalvm.js:js:22.2.0' - implementation 'org.graalvm.js:js:22.2.0' - implementation 'org.graalvm.js:js-scriptengine:22.2.0' - implementation 'org.graalvm.sdk:graal-sdk:22.2.0' + implementation 'org.graalvm.js:js:23.0.1' + implementation 'org.graalvm.js:js-scriptengine:23.0.1' + implementation 'org.graalvm.sdk:graal-sdk:23.0.1' // CSV Stuff implementation 'org.apache.commons:commons-csv:1.9.0' From c884f24f0ccc8c91821aabe3ea323a46a26c9ea7 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Thu, 3 Aug 2023 14:52:05 -0400 Subject: [PATCH 32/78] update readme text to emphasize LTS versions of java --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1ef3859678..7eaad93e79 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ These instructions are intended for those wishing to examine the Synthea source ### Installation **System Requirements:** -SyntheaTM requires Java JDK 11 or newer, and is tested to work with up to Java 19. +SyntheaTM requires Java JDK 11 or newer. We strongly recommend using a Long-Term Support (LTS) release of Java, 11 or 17, as issues may occur with more recent non-LTS versions. To clone the SyntheaTM repo, then build and run the test suite: ``` From cfc890efab530a19a7058fa9a1d52c364a52c6e6 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Thu, 10 Aug 2023 14:15:11 -0400 Subject: [PATCH 33/78] target graaljs 22 instead of 23 to ensure jdk11 support --- build.gradle | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index 12f5388b11..c5874128d8 100644 --- a/build.gradle +++ b/build.gradle @@ -71,9 +71,9 @@ dependencies { implementation 'guru.nidi:graphviz-java:0.18.1' // JavaScript engine included for graphviz. It gets used // if someone does not have graphviz installed in their environment - implementation 'org.graalvm.js:js:23.0.1' - implementation 'org.graalvm.js:js-scriptengine:23.0.1' - implementation 'org.graalvm.sdk:graal-sdk:23.0.1' + implementation 'org.graalvm.js:js:22.3.3' + implementation 'org.graalvm.js:js-scriptengine:22.3.3' + implementation 'org.graalvm.sdk:graal-sdk:22.3.3' // CSV Stuff implementation 'org.apache.commons:commons-csv:1.9.0' From 758b44dac1b6f77e99123cb5169394c0b68f760a Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Thu, 10 Aug 2023 14:40:29 -0400 Subject: [PATCH 34/78] add support for nested fields in FieldWrapper --- .../CustomFHIRPathResourceGeneratorR4.java | 17 +++++++ .../export/flexporter/FieldWrapper.java | 27 +++++++--- ...CustomFHIRPathResourceGeneratorR4Test.java | 9 +++- .../export/flexporter/FieldWrapperTest.java | 50 +++++++++++++++++++ 4 files changed, 95 insertions(+), 8 deletions(-) create mode 100644 src/test/java/org/mitre/synthea/export/flexporter/FieldWrapperTest.java diff --git a/src/main/java/org/mitre/synthea/export/flexporter/CustomFHIRPathResourceGeneratorR4.java b/src/main/java/org/mitre/synthea/export/flexporter/CustomFHIRPathResourceGeneratorR4.java index 69b278d0a3..3212796afc 100644 --- a/src/main/java/org/mitre/synthea/export/flexporter/CustomFHIRPathResourceGeneratorR4.java +++ b/src/main/java/org/mitre/synthea/export/flexporter/CustomFHIRPathResourceGeneratorR4.java @@ -720,4 +720,21 @@ private PathType getTypeOfFhirPath(String fhirPath) { public enum PathType { WHERE_EQUALS, WHERE_UNEQUALS, WITHOUT_WHERE } + + /** + * Helper function to set a single value on a resource. + * @param resource Resource to set value on + * @param fieldPath Path to set value to. May be a nested field + * @param value Value to set at given path on the resource + */ + public static void setField(T resource, String fieldPath, Object value) { + CustomFHIRPathResourceGeneratorR4 generator = + new CustomFHIRPathResourceGeneratorR4<>(); + generator.setResource(resource); + + HashMap mapping = new HashMap<>(); + mapping.put(fieldPath, value); + generator.setMapping(mapping); + generator.generateResource(resource.getClass()); + } } diff --git a/src/main/java/org/mitre/synthea/export/flexporter/FieldWrapper.java b/src/main/java/org/mitre/synthea/export/flexporter/FieldWrapper.java index f0820e4268..f4f299a0e1 100644 --- a/src/main/java/org/mitre/synthea/export/flexporter/FieldWrapper.java +++ b/src/main/java/org/mitre/synthea/export/flexporter/FieldWrapper.java @@ -13,6 +13,8 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.function.BiConsumer; +import java.util.function.Function; import java.util.stream.Collectors; import org.hl7.fhir.instance.model.api.IBase; @@ -42,7 +44,8 @@ public abstract class FieldWrapper { - protected BaseRuntimeChildDefinition fieldDef; + protected Function> getter; + protected BiConsumer setter; /** * Create a FieldWrapper for the field defined by the given path. @@ -80,8 +83,20 @@ public FieldWrapper(Class clazz, String fieldName) { private void init(Class clazz, String fieldName) { RuntimeResourceDefinition rd = FhirR4.getContext().getResourceDefinition(clazz); - // TODO: this only gets top-level fields. update to suport nested fields - this.fieldDef = rd.getChildByName(fieldName); + if (fieldName.contains(".")) { + // the .stream() and everything after it is just turning List into List ugh + this.getter = (resource) -> + FhirPathUtils.evaluateResource(resource, fieldName) + .stream() + .map(b -> (IBase)b) + .collect(Collectors.toList()); + this.setter = (resource, value) -> + CustomFHIRPathResourceGeneratorR4.setField(resource, fieldName, value); + } else { + BaseRuntimeChildDefinition fieldDef = rd.getChildByName(fieldName); + this.getter = fieldDef.getAccessor()::getValues; + this.setter = fieldDef.getMutator()::setValue; + } } /** @@ -92,7 +107,7 @@ private void init(Class clazz, String fieldName) { * @return the value from the field */ public IBase getSingle(Resource resource) { - return fieldDef.getAccessor().getFirstValueOrNull(resource).orElse(null); + return getAll(resource).stream().findFirst().orElse(null); } /** @@ -101,7 +116,7 @@ public IBase getSingle(Resource resource) { * @return the list of values from the field */ public List getAll(Resource resource) { - return fieldDef.getAccessor().getValues(resource); + return this.getter.apply(resource); } /** @@ -110,7 +125,7 @@ public List getAll(Resource resource) { * @param value The value to set */ public void set(Resource resource, IBase value) { - fieldDef.getMutator().setValue(resource, value); + this.setter.accept(resource, value); } diff --git a/src/test/java/org/mitre/synthea/export/flexporter/CustomFHIRPathResourceGeneratorR4Test.java b/src/test/java/org/mitre/synthea/export/flexporter/CustomFHIRPathResourceGeneratorR4Test.java index 5e5542428c..30d163d2da 100644 --- a/src/test/java/org/mitre/synthea/export/flexporter/CustomFHIRPathResourceGeneratorR4Test.java +++ b/src/test/java/org/mitre/synthea/export/flexporter/CustomFHIRPathResourceGeneratorR4Test.java @@ -3,8 +3,6 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; -import ca.uhn.fhir.context.FhirContext; - import java.util.Date; import java.util.HashMap; import java.util.List; @@ -185,4 +183,11 @@ public void testExtensionOnPrimitive() { birthdate.getExtensionByUrl("http://hl7.org/fhir/StructureDefinition/patient-birthTime"); assertEquals("2021-12-15T17:57:28-05:00", birthTime.getValueAsPrimitive().getValueAsString()); } + + @Test + public void testSingleFieldSetter() { + Patient p = new Patient(); + CustomFHIRPathResourceGeneratorR4.setField(p, "name.given", "TestName"); + assertEquals("TestName", p.getNameFirstRep().getGivenAsSingleString()); + } } diff --git a/src/test/java/org/mitre/synthea/export/flexporter/FieldWrapperTest.java b/src/test/java/org/mitre/synthea/export/flexporter/FieldWrapperTest.java new file mode 100644 index 0000000000..189dba8686 --- /dev/null +++ b/src/test/java/org/mitre/synthea/export/flexporter/FieldWrapperTest.java @@ -0,0 +1,50 @@ +package org.mitre.synthea.export.flexporter; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +import java.time.LocalDateTime; + +import org.hl7.fhir.instance.model.api.IBase; +import org.hl7.fhir.r4.model.DateType; +import org.hl7.fhir.r4.model.Goal; +import org.hl7.fhir.r4.model.Observation; +import org.hl7.fhir.r4.model.Reference; +import org.junit.Test; +import org.mitre.synthea.export.flexporter.FieldWrapper.DateFieldWrapper; +import org.mitre.synthea.export.flexporter.FieldWrapper.ReferenceFieldWrapper; + + +public class FieldWrapperTest { + @Test + public void testGetReference() { + ReferenceFieldWrapper rfw = new ReferenceFieldWrapper(Observation.class, "subject"); + + Observation obs = new Observation(); + obs.setSubject(new Reference().setReference("Patient/1")); + + assertEquals("Patient/1", rfw.getReference(obs)); + } + + @Test + public void testNestedField() { + DateFieldWrapper dfw = new DateFieldWrapper(Goal.class, "target.due"); + + Goal goal = new Goal(); + goal.addTarget().setDue(new DateType("2023-08-01")); + + IBase result = dfw.getSingle(goal); + + assertTrue(result instanceof DateType); + assertEquals("2023-08-01", ((DateType)result).getValueAsString()); + + LocalDateTime jan12023 = LocalDateTime.of(2023, 1, 1, 0, 0); + LocalDateTime dec312023 = LocalDateTime.of(2023, 12, 31, 0, 0); + LocalDateTime jan11999 = LocalDateTime.of(1999, 1, 1, 0, 0); + LocalDateTime dec312021 = LocalDateTime.of(2021, 12, 31, 0, 0); + + assertTrue(dfw.valueInRange(goal, jan12023, dec312023)); + assertFalse(dfw.valueInRange(goal, jan11999, dec312021)); + } +} From 75e77c7b68b7051f9f1d0618caad20682a434cad Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Fri, 11 Aug 2023 15:14:28 -0400 Subject: [PATCH 35/78] add fieldwrapper for remaining fields --- .../export/flexporter/FieldWrapper.java | 161 ++++++++++++++++-- .../export/flexporter/FieldWrapperTest.java | 29 +++- 2 files changed, 173 insertions(+), 17 deletions(-) diff --git a/src/main/java/org/mitre/synthea/export/flexporter/FieldWrapper.java b/src/main/java/org/mitre/synthea/export/flexporter/FieldWrapper.java index f4f299a0e1..ba44c3c9fa 100644 --- a/src/main/java/org/mitre/synthea/export/flexporter/FieldWrapper.java +++ b/src/main/java/org/mitre/synthea/export/flexporter/FieldWrapper.java @@ -18,17 +18,24 @@ import java.util.stream.Collectors; import org.hl7.fhir.instance.model.api.IBase; +import org.hl7.fhir.r4.model.AllergyIntolerance; import org.hl7.fhir.r4.model.Base; import org.hl7.fhir.r4.model.CarePlan; +import org.hl7.fhir.r4.model.CareTeam; import org.hl7.fhir.r4.model.Claim; import org.hl7.fhir.r4.model.Condition; import org.hl7.fhir.r4.model.DateTimeType; import org.hl7.fhir.r4.model.DateType; +import org.hl7.fhir.r4.model.Device; import org.hl7.fhir.r4.model.DiagnosticReport; import org.hl7.fhir.r4.model.DocumentReference; import org.hl7.fhir.r4.model.Encounter; import org.hl7.fhir.r4.model.ExplanationOfBenefit; +import org.hl7.fhir.r4.model.Goal; +import org.hl7.fhir.r4.model.ImagingStudy; +import org.hl7.fhir.r4.model.Immunization; import org.hl7.fhir.r4.model.InstantType; +import org.hl7.fhir.r4.model.Media; import org.hl7.fhir.r4.model.MedicationAdministration; import org.hl7.fhir.r4.model.MedicationRequest; import org.hl7.fhir.r4.model.Observation; @@ -39,10 +46,10 @@ import org.hl7.fhir.r4.model.Reference; import org.hl7.fhir.r4.model.Resource; import org.hl7.fhir.r4.model.ResourceType; +import org.hl7.fhir.r4.model.SupplyDelivery; import org.hl7.fhir.r4.model.TimeType; import org.mitre.synthea.export.FhirR4; - public abstract class FieldWrapper { protected Function> getter; protected BiConsumer setter; @@ -94,6 +101,15 @@ private void init(Class clazz, String fieldName) { CustomFHIRPathResourceGeneratorR4.setField(resource, fieldName, value); } else { BaseRuntimeChildDefinition fieldDef = rd.getChildByName(fieldName); + if (fieldDef == null) { + // maybe it's a choice type. + fieldDef = rd.getChildByName(fieldName + "[x]"); + if (fieldDef == null) { + throw new IllegalArgumentException( + "Unknown field " + fieldName + " on resourceType " + clazz.getSimpleName()); + } + + } this.getter = fieldDef.getAccessor()::getValues; this.setter = fieldDef.getMutator()::setValue; } @@ -351,13 +367,16 @@ public boolean valueInRange(Resource resource, LocalDateTime min, LocalDateTime public static final Map> DATE_FIELDS = buildDateFields(); // TODO: this could instead iterate over all fields on relevant resources, - // which might be cleaner but also slower, especially if it means a lot of iteration - // over resource types or fields we never use + // which might be cleaner or slower, especially if it means a lot of iteration + // over resource types or fields we never use. + // A human would do it by looking at all fields that are actually present on a resource + // and see if they are dates. But I don't see an easy way to do that here private static Map> buildDateFields() { Map> dateFields = new HashMap<>(); dateFields.put(ResourceType.Patient, List.of( - new DateFieldWrapper(Patient.class, "birthDate") + new DateFieldWrapper(Patient.class, "birthDate"), + new DateFieldWrapper(Patient.class, "deceased") )); dateFields.put(ResourceType.Encounter, List.of( @@ -365,16 +384,23 @@ private static Map> buildDateFields() { )); dateFields.put(ResourceType.Condition, List.of( - new DateFieldWrapper(Condition.class, "onsetDateTime") + new DateFieldWrapper(Condition.class, "onset"), + new DateFieldWrapper(Condition.class, "abatement"), + new DateFieldWrapper(Condition.class, "recordedDate") )); + dateFields.put(ResourceType.AllergyIntolerance, List.of( + new DateFieldWrapper(AllergyIntolerance.class, "recordedDate") + )); + dateFields.put(ResourceType.Procedure, List.of( - new DateFieldWrapper(Procedure.class, "performed[x]") // Period or dateTime + new DateFieldWrapper(Procedure.class, "performed") // Period or dateTime )); dateFields.put(ResourceType.Observation, List.of( - new DateFieldWrapper(Observation.class, "effective[x]"), - new DateFieldWrapper(Observation.class, "value[x]"), + new DateFieldWrapper(Observation.class, "effective"), + // new DateFieldWrapper(Observation.class, "value"), + // value could technically be a date but I don't think we ever use that new DateFieldWrapper(Observation.class, "issued") )); @@ -382,6 +408,50 @@ private static Map> buildDateFields() { new DateFieldWrapper(MedicationRequest.class, "authoredOn") )); + dateFields.put(ResourceType.MedicationAdministration, List.of( + new DateFieldWrapper(MedicationAdministration.class, "effective") + )); + + dateFields.put(ResourceType.CarePlan, List.of( + new DateFieldWrapper(CarePlan.class, "period") + )); + + dateFields.put(ResourceType.Goal, List.of( + new DateFieldWrapper(Goal.class, "target.due") + )); + + dateFields.put(ResourceType.CareTeam, List.of( + new DateFieldWrapper(CareTeam.class, "period") + )); + + dateFields.put(ResourceType.ImagingStudy, List.of( + new DateFieldWrapper(ImagingStudy.class, "started"), + new DateFieldWrapper(ImagingStudy.class, "series.started") + )); + + dateFields.put(ResourceType.DiagnosticReport, List.of( + new DateFieldWrapper(DiagnosticReport.class, "effective"), + new DateFieldWrapper(DiagnosticReport.class, "issued") + )); + + dateFields.put(ResourceType.Device, List.of( + new DateFieldWrapper(Device.class, "manufactureDate"), + new DateFieldWrapper(Device.class, "expirationDate") + )); + + dateFields.put(ResourceType.SupplyDelivery, List.of( + new DateFieldWrapper(SupplyDelivery.class, "occurrence") + )); + + dateFields.put(ResourceType.ExplanationOfBenefit, List.of( + new DateFieldWrapper(ExplanationOfBenefit.class, "billablePeriod"), + new DateFieldWrapper(ExplanationOfBenefit.class, "procedure.date") + )); + + dateFields.put(ResourceType.Provenance, List.of( + new DateFieldWrapper(Provenance.class, "recorded") + )); + return dateFields; } @@ -419,7 +489,13 @@ public List getReferences(Resource resource) { List referenceObjects = getAll(resource); return referenceObjects.stream() - .map(ro -> ((Reference)ro).getReference()) + .map(ro -> { + if (!(ro instanceof Reference)) { + return null; + } + return ((Reference)ro).getReference(); + }) + .filter(ro -> ro != null) .collect(Collectors.toList()); } } @@ -431,7 +507,9 @@ private static Map> buildReferenceFiel Map> refFields = new HashMap<>(); refFields.put(ResourceType.Encounter, List.of( - new ReferenceFieldWrapper(Encounter.class, "subject") + new ReferenceFieldWrapper(Encounter.class, "subject"), + new ReferenceFieldWrapper(Encounter.class, "location.location"), + new ReferenceFieldWrapper(Encounter.class, "participant.individual") )); refFields.put(ResourceType.Condition, List.of( @@ -439,19 +517,27 @@ private static Map> buildReferenceFiel new ReferenceFieldWrapper(Condition.class, "encounter") )); + refFields.put(ResourceType.AllergyIntolerance, List.of( + new ReferenceFieldWrapper(AllergyIntolerance.class, "patient") + )); + refFields.put(ResourceType.Procedure, List.of( new ReferenceFieldWrapper(Procedure.class, "subject"), - new ReferenceFieldWrapper(Procedure.class, "encounter") + new ReferenceFieldWrapper(Procedure.class, "encounter"), + new ReferenceFieldWrapper(Procedure.class, "reasonReference") )); refFields.put(ResourceType.MedicationRequest, List.of( new ReferenceFieldWrapper(MedicationRequest.class, "subject"), - new ReferenceFieldWrapper(MedicationRequest.class, "encounter") + new ReferenceFieldWrapper(MedicationRequest.class, "encounter"), + new ReferenceFieldWrapper(MedicationRequest.class, "medication"), + new ReferenceFieldWrapper(MedicationRequest.class, "reasonReference") )); refFields.put(ResourceType.MedicationAdministration, List.of( new ReferenceFieldWrapper(MedicationAdministration.class, "subject"), - new ReferenceFieldWrapper(MedicationAdministration.class, "context") + new ReferenceFieldWrapper(MedicationAdministration.class, "context"), + new ReferenceFieldWrapper(MedicationAdministration.class, "reasonReference") )); refFields.put(ResourceType.Observation, List.of( @@ -467,20 +553,63 @@ private static Map> buildReferenceFiel refFields.put(ResourceType.CarePlan, List.of( new ReferenceFieldWrapper(CarePlan.class, "subject"), - new ReferenceFieldWrapper(CarePlan.class, "encounter") + new ReferenceFieldWrapper(CarePlan.class, "encounter"), + new ReferenceFieldWrapper(CarePlan.class, "careTeam"), + new ReferenceFieldWrapper(CarePlan.class, "addresses"), + new ReferenceFieldWrapper(CarePlan.class, "activity.detail.reason"), + new ReferenceFieldWrapper(CarePlan.class, "goal") + )); + + refFields.put(ResourceType.Goal, List.of( + new ReferenceFieldWrapper(Goal.class, "subject"), + new ReferenceFieldWrapper(Goal.class, "addresses") + )); + + refFields.put(ResourceType.CareTeam, List.of( + new ReferenceFieldWrapper(CareTeam.class, "subject"), + new ReferenceFieldWrapper(CareTeam.class, "encounter") + )); + + refFields.put(ResourceType.Immunization, List.of( + new ReferenceFieldWrapper(Immunization.class, "patient"), + new ReferenceFieldWrapper(Immunization.class, "encounter") + )); + + refFields.put(ResourceType.Device, List.of( + new ReferenceFieldWrapper(Device.class, "patient") + )); + + refFields.put(ResourceType.SupplyDelivery, List.of( + new ReferenceFieldWrapper(SupplyDelivery.class, "patient") + )); + + refFields.put(ResourceType.ImagingStudy, List.of( + new ReferenceFieldWrapper(ImagingStudy.class, "subject"), + new ReferenceFieldWrapper(ImagingStudy.class, "encounter") )); refFields.put(ResourceType.DocumentReference, List.of( new ReferenceFieldWrapper(DocumentReference.class, "subject") )); + refFields.put(ResourceType.Media, List.of( + new ReferenceFieldWrapper(Media.class, "subject"), + new ReferenceFieldWrapper(Media.class, "encounter") + )); + refFields.put(ResourceType.Claim, List.of( - new ReferenceFieldWrapper(Claim.class, "patient") + new ReferenceFieldWrapper(Claim.class, "patient"), + new ReferenceFieldWrapper(Claim.class, "item.encounter"), + new ReferenceFieldWrapper(Claim.class, "prescription"), + new ReferenceFieldWrapper(Claim.class, "procedure.procedure"), // procedureReference + new ReferenceFieldWrapper(Claim.class, "diagnosis.diagnosis") // diagnosisReference + )); refFields.put(ResourceType.ExplanationOfBenefit, List.of( new ReferenceFieldWrapper(ExplanationOfBenefit.class, "patient"), - new ReferenceFieldWrapper(ExplanationOfBenefit.class, "claim") + new ReferenceFieldWrapper(ExplanationOfBenefit.class, "claim"), + new ReferenceFieldWrapper(ExplanationOfBenefit.class, "provider") )); refFields.put(ResourceType.Provenance, List.of( diff --git a/src/test/java/org/mitre/synthea/export/flexporter/FieldWrapperTest.java b/src/test/java/org/mitre/synthea/export/flexporter/FieldWrapperTest.java index 189dba8686..d547f71473 100644 --- a/src/test/java/org/mitre/synthea/export/flexporter/FieldWrapperTest.java +++ b/src/test/java/org/mitre/synthea/export/flexporter/FieldWrapperTest.java @@ -7,9 +7,11 @@ import java.time.LocalDateTime; import org.hl7.fhir.instance.model.api.IBase; +import org.hl7.fhir.r4.model.DateTimeType; import org.hl7.fhir.r4.model.DateType; import org.hl7.fhir.r4.model.Goal; import org.hl7.fhir.r4.model.Observation; +import org.hl7.fhir.r4.model.Procedure; import org.hl7.fhir.r4.model.Reference; import org.junit.Test; import org.mitre.synthea.export.flexporter.FieldWrapper.DateFieldWrapper; @@ -28,7 +30,7 @@ public void testGetReference() { } @Test - public void testNestedField() { + public void testGetNestedField() { DateFieldWrapper dfw = new DateFieldWrapper(Goal.class, "target.due"); Goal goal = new Goal(); @@ -47,4 +49,29 @@ public void testNestedField() { assertTrue(dfw.valueInRange(goal, jan12023, dec312023)); assertFalse(dfw.valueInRange(goal, jan11999, dec312021)); } + + + @Test + public void testGetNestedFieldChoiceType() { + DateFieldWrapper dfw = new DateFieldWrapper(Procedure.class, "performed"); + + Procedure p = new Procedure(); + p.setPerformed(new DateTimeType("2023-08-11T13:51:00")); + + IBase result = dfw.getSingle(p); + assertTrue(result instanceof DateTimeType); + assertEquals("2023-08-11T13:51:00", ((DateTimeType)result).getValueAsString()); + } + + @Test + public void testSetNestedFieldChoiceType() { + DateFieldWrapper dfw = new DateFieldWrapper(Procedure.class, "performed"); + + Procedure p = new Procedure(); + dfw.set(p, new DateTimeType("2002-08-11T13:51:00")); + + IBase result = dfw.getSingle(p); + assertTrue(result instanceof DateTimeType); + assertEquals("2002-08-11T13:51:00", ((DateTimeType)result).getValueAsString()); + } } From 5eb4b14eff749b446b27e63befb06c8352e9d9ff Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Fri, 11 Aug 2023 15:14:53 -0400 Subject: [PATCH 36/78] sonatype fix --- .../java/org/mitre/synthea/export/flexporter/Mapping.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/mitre/synthea/export/flexporter/Mapping.java b/src/main/java/org/mitre/synthea/export/flexporter/Mapping.java index 833f65045e..6920c256e7 100644 --- a/src/main/java/org/mitre/synthea/export/flexporter/Mapping.java +++ b/src/main/java/org/mitre/synthea/export/flexporter/Mapping.java @@ -8,6 +8,7 @@ import java.util.Map; import org.yaml.snakeyaml.Yaml; +import org.yaml.snakeyaml.constructor.Constructor; public class Mapping { public String name; @@ -16,7 +17,7 @@ public class Mapping { public Map variables; /** - * Each action is a Map<String,?>. Nested fields within the YAML become ArrayLists and + * Each action is a {@code Map>String,?>}. Nested fields within the YAML become ArrayLists and * LinkedHashMaps. */ public List> actions; @@ -29,7 +30,7 @@ public class Mapping { */ public static Mapping parseMapping(File mappingFile) throws FileNotFoundException { InputStream selectorInputSteam = new FileInputStream(mappingFile); - Yaml yaml = new Yaml(new org.yaml.snakeyaml.constructor.Constructor(Mapping.class)); + Yaml yaml = new Yaml(new Constructor(Mapping.class)); return yaml.loadAs(selectorInputSteam, Mapping.class); } From 6ed713780794b9d575d6828ceb7ed500cdc2c288 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Mon, 30 Aug 2021 17:08:16 -0400 Subject: [PATCH 37/78] custom exporter concept --- build.gradle | 2 ++ lib/custom/.keep | 0 .../org/mitre/synthea/engine/Generator.java | 1 + .../org/mitre/synthea/export/Exporter.java | 36 +++++++++++++++++++ .../mitre/synthea/export/PatientExporter.java | 19 ++++++++++ .../export/PostCompletionExporter.java | 17 +++++++++ src/main/resources/synthea.properties | 3 ++ 7 files changed, 78 insertions(+) create mode 100644 lib/custom/.keep create mode 100644 src/main/java/org/mitre/synthea/export/PatientExporter.java create mode 100644 src/main/java/org/mitre/synthea/export/PostCompletionExporter.java diff --git a/build.gradle b/build.gradle index 0079a6ae0b..fd457d0fe5 100644 --- a/build.gradle +++ b/build.gradle @@ -113,6 +113,8 @@ dependencies { // JfreeChart for drawing physiology charts implementation 'org.jfree:jfreechart:1.5.3' + implementation fileTree(dir: 'lib/custom', include: '*.jar') + // Use JUnit test framework testImplementation('junit:junit') { version { diff --git a/lib/custom/.keep b/lib/custom/.keep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/main/java/org/mitre/synthea/engine/Generator.java b/src/main/java/org/mitre/synthea/engine/Generator.java index 3a9af8f413..013385cf21 100644 --- a/src/main/java/org/mitre/synthea/engine/Generator.java +++ b/src/main/java/org/mitre/synthea/engine/Generator.java @@ -219,6 +219,7 @@ private void init() { if (Config.getAsBoolean("exporter.cdw.export")) { CDWExporter.getInstance().setKeyStart((stateIndex * 1_000_000) + 1); } + Exporter.loadCustomExporters(); this.populationRandom = new DefaultRandomNumberGenerator(options.seed); this.clinicianRandom = new DefaultRandomNumberGenerator(options.clinicianSeed); diff --git a/src/main/java/org/mitre/synthea/export/Exporter.java b/src/main/java/org/mitre/synthea/export/Exporter.java index ca3e9f8852..b79d0ac3ea 100644 --- a/src/main/java/org/mitre/synthea/export/Exporter.java +++ b/src/main/java/org/mitre/synthea/export/Exporter.java @@ -16,6 +16,7 @@ import java.util.Iterator; import java.util.LinkedList; import java.util.List; +import java.util.ServiceLoader; import java.util.concurrent.BlockingQueue; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.LinkedBlockingQueue; @@ -57,6 +58,28 @@ public enum SupportedFhirVersion { private static final int FILE_BUFFER_SIZE = 4 * 1024 * 1024; + private static List patientExporters; + private static List postCompletionExporters; + + public static void loadCustomExporters() { + if (Config.getAsBoolean("exporter.enable_custom_exporters", false)) { + patientExporters = new LinkedList<>(); + postCompletionExporters = new LinkedList<>(); + + ServiceLoader loader = ServiceLoader.load(PatientExporter.class); + for (PatientExporter instance : loader) { + System.out.println(instance.getClass().getCanonicalName()); + patientExporters.add(instance); + } + + ServiceLoader loader2 = ServiceLoader.load(PostCompletionExporter.class); + for (PostCompletionExporter instance : loader2) { + System.out.println(instance.getClass().getCanonicalName()); + postCompletionExporters.add(instance); + } + } + } + /** * Runtime configuration of the record exporter. */ @@ -318,6 +341,13 @@ private static boolean exportRecord(Person person, String fileTag, long stopTime String consolidatedNotes = ClinicalNoteExporter.export(person); writeNewFile(outFilePath, consolidatedNotes); } + + if (patientExporters != null && !patientExporters.isEmpty()) { + for (PatientExporter patientExporter : patientExporters) { + patientExporter.export(person, stopTime, options); + } + } + if (options.isQueueEnabled()) { try { switch (options.queuedFhirVersion()) { @@ -508,6 +538,12 @@ public static void runPostCompletionExports(Generator generator, ExporterRuntime e.printStackTrace(); } } + + if (postCompletionExporters != null && !postCompletionExporters.isEmpty()) { + for (PostCompletionExporter postCompletionExporter : postCompletionExporters) { + postCompletionExporter.export(generator, options); + } + } closeOpenFiles(); } diff --git a/src/main/java/org/mitre/synthea/export/PatientExporter.java b/src/main/java/org/mitre/synthea/export/PatientExporter.java new file mode 100644 index 0000000000..ae2f7bcf01 --- /dev/null +++ b/src/main/java/org/mitre/synthea/export/PatientExporter.java @@ -0,0 +1,19 @@ +package org.mitre.synthea.export; + +import org.mitre.synthea.export.Exporter.ExporterRuntimeOptions; +import org.mitre.synthea.world.agents.Person; + +/** + * + * + */ +public interface PatientExporter { + + /** + * + * @param person Patient to export + * @param stopTime Time at which the simulation stopped + * @param options Runtime exporter options + */ + void export(Person person, long stopTime, ExporterRuntimeOptions options); +} diff --git a/src/main/java/org/mitre/synthea/export/PostCompletionExporter.java b/src/main/java/org/mitre/synthea/export/PostCompletionExporter.java new file mode 100644 index 0000000000..192e711ccf --- /dev/null +++ b/src/main/java/org/mitre/synthea/export/PostCompletionExporter.java @@ -0,0 +1,17 @@ +package org.mitre.synthea.export; + +import org.mitre.synthea.engine.Generator; +import org.mitre.synthea.export.Exporter.ExporterRuntimeOptions; + +/** + * + * + */ +public interface PostCompletionExporter { + /** + * + * @param generator + * @param options + */ + void export(Generator generator, ExporterRuntimeOptions options); +} diff --git a/src/main/resources/synthea.properties b/src/main/resources/synthea.properties index 843845d50a..310ea91336 100644 --- a/src/main/resources/synthea.properties +++ b/src/main/resources/synthea.properties @@ -93,6 +93,9 @@ exporter.symptoms.csv.append_mode = false exporter.symptoms.csv.folder_per_run = false exporter.symptoms.text.export = false +# enable searching for custom exporter implementations +exporter.enable_custom_exporters = true + # the number of patients to generate, by default # this can be overridden by passing a different value to the Generator constructor generate.default_population = 1 From c09ed32c07ef22202b7e6c0c992508079e352005 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Thu, 17 Aug 2023 11:17:37 -0400 Subject: [PATCH 38/78] bump version number --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index fd457d0fe5..4829d1f8e8 100644 --- a/build.gradle +++ b/build.gradle @@ -343,7 +343,7 @@ artifacts { } def mavenGroup = 'org.mitre.synthea' -def mavenVersion = '3.2.1-SNAPSHOT' +def mavenVersion = '3.2.2-SNAPSHOT' publishing { publications { From 3c23908e922534b5ce2b1ccca3782f84017b2a09 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Thu, 17 Aug 2023 11:38:13 -0400 Subject: [PATCH 39/78] cleanup --- .../org/mitre/synthea/export/Exporter.java | 24 ++++++++++++------- .../mitre/synthea/export/PatientExporter.java | 7 +++--- .../export/PostCompletionExporter.java | 12 ++++++---- 3 files changed, 25 insertions(+), 18 deletions(-) diff --git a/src/main/java/org/mitre/synthea/export/Exporter.java b/src/main/java/org/mitre/synthea/export/Exporter.java index b79d0ac3ea..c058a45e52 100644 --- a/src/main/java/org/mitre/synthea/export/Exporter.java +++ b/src/main/java/org/mitre/synthea/export/Exporter.java @@ -60,26 +60,32 @@ public enum SupportedFhirVersion { private static List patientExporters; private static List postCompletionExporters; - + + /** + * If the config setting "exporter.enable_custom_exporters" is enabled, + * load classes implementing the {@link PatientExporter} or {@link PostCompletionExporter} + * interfaces from the classpath, via the ServiceLoader. + */ public static void loadCustomExporters() { if (Config.getAsBoolean("exporter.enable_custom_exporters", false)) { - patientExporters = new LinkedList<>(); - postCompletionExporters = new LinkedList<>(); - + patientExporters = new ArrayList<>(); + postCompletionExporters = new ArrayList<>(); + ServiceLoader loader = ServiceLoader.load(PatientExporter.class); for (PatientExporter instance : loader) { System.out.println(instance.getClass().getCanonicalName()); patientExporters.add(instance); } - ServiceLoader loader2 = ServiceLoader.load(PostCompletionExporter.class); + ServiceLoader loader2 = + ServiceLoader.load(PostCompletionExporter.class); for (PostCompletionExporter instance : loader2) { System.out.println(instance.getClass().getCanonicalName()); postCompletionExporters.add(instance); } } } - + /** * Runtime configuration of the record exporter. */ @@ -341,13 +347,13 @@ private static boolean exportRecord(Person person, String fileTag, long stopTime String consolidatedNotes = ClinicalNoteExporter.export(person); writeNewFile(outFilePath, consolidatedNotes); } - + if (patientExporters != null && !patientExporters.isEmpty()) { for (PatientExporter patientExporter : patientExporters) { patientExporter.export(person, stopTime, options); } } - + if (options.isQueueEnabled()) { try { switch (options.queuedFhirVersion()) { @@ -538,7 +544,7 @@ public static void runPostCompletionExports(Generator generator, ExporterRuntime e.printStackTrace(); } } - + if (postCompletionExporters != null && !postCompletionExporters.isEmpty()) { for (PostCompletionExporter postCompletionExporter : postCompletionExporters) { postCompletionExporter.export(generator, options); diff --git a/src/main/java/org/mitre/synthea/export/PatientExporter.java b/src/main/java/org/mitre/synthea/export/PatientExporter.java index ae2f7bcf01..e5f3a800e9 100644 --- a/src/main/java/org/mitre/synthea/export/PatientExporter.java +++ b/src/main/java/org/mitre/synthea/export/PatientExporter.java @@ -4,13 +4,12 @@ import org.mitre.synthea.world.agents.Person; /** - * - * + * This interface defines an exporter that will be run for every patient + * in a simulation. */ public interface PatientExporter { - /** - * + * Export the given Person object. * @param person Patient to export * @param stopTime Time at which the simulation stopped * @param options Runtime exporter options diff --git a/src/main/java/org/mitre/synthea/export/PostCompletionExporter.java b/src/main/java/org/mitre/synthea/export/PostCompletionExporter.java index 192e711ccf..1871ca78ea 100644 --- a/src/main/java/org/mitre/synthea/export/PostCompletionExporter.java +++ b/src/main/java/org/mitre/synthea/export/PostCompletionExporter.java @@ -4,14 +4,16 @@ import org.mitre.synthea.export.Exporter.ExporterRuntimeOptions; /** - * - * + * This interface defines an exporter that will be invoked + * after the entire population has been generated. + * Example uses for this type of exporter include metadata, + * Payer- or Provider-based data, or working in combination with a separate + * PatientExporter where a final step is only performed once every patient + * has been handled. */ public interface PostCompletionExporter { /** - * - * @param generator - * @param options + * Export data based on the given Generator and options. */ void export(Generator generator, ExporterRuntimeOptions options); } From 6192ed703d8517e7bfab801d9fbee622ec4e8161 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Thu, 28 Sep 2023 14:03:17 -0400 Subject: [PATCH 40/78] add links to FAQ and customizer to readme --- README.md | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 7eaad93e79..e71f204fdc 100644 --- a/README.md +++ b/README.md @@ -2,10 +2,7 @@ SyntheaTM is a Synthetic Patient Population Simulator. The goal is to output synthetic, realistic (but not real), patient data and associated health records in a variety of formats. -Read our [wiki](https://github.com/synthetichealth/synthea/wiki) for more information. - -:wave::information_source: -**May-June 2023 - We're interested in hearing how you use Synthea and what features are most useful to you! Please consider helping direct future effort by filling out our brief user survey: https://share.hsforms.com/1PDnYPuS6Ql6TVkUOohNqOw4m7ji** +Read our [wiki](https://github.com/synthetichealth/synthea/wiki) and [Frequently Asked Questions](https://github.com/synthetichealth/synthea/wiki/Frequently-Asked-Questions) for more information. Currently, SyntheaTM features include: - Birth to Death Lifecycle @@ -45,7 +42,7 @@ cd synthea The default properties file values can be found at `src/main/resources/synthea.properties`. By default, synthea does not generate CCDA, CPCDA, CSV, or Bulk FHIR (ndjson). You'll need to adjust this file to activate these features. See the [wiki](https://github.com/synthetichealth/synthea/wiki) -for more details. +for more details, or use our [guided customizer tool](https://synthetichealth.github.io/spt/#/customizer). @@ -114,7 +111,7 @@ Generate a list of concepts (used in the records) or attributes (variables on ea # License -Copyright 2017-2022 The MITRE Corporation +Copyright 2017-2023 The MITRE Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. From c06a7f45b2ee22bdf62c3c57360c64caeb6dfce6 Mon Sep 17 00:00:00 2001 From: Andy Gregorowicz Date: Mon, 23 Oct 2023 12:06:16 -0400 Subject: [PATCH 41/78] Adjustment to lookUp to prevent issues when close to 100th percentile. --- .../world/concepts/GrowthChartEntry.java | 19 ++++++++++++++++-- .../synthea/modules/GrowthChartTest.java | 3 ++- .../world/concepts/GrowthChartTest.java | 20 +++++++++++++++++++ 3 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 src/test/java/org/mitre/synthea/world/concepts/GrowthChartTest.java diff --git a/src/main/java/org/mitre/synthea/world/concepts/GrowthChartEntry.java b/src/main/java/org/mitre/synthea/world/concepts/GrowthChartEntry.java index f83edae5e1..350d84b076 100644 --- a/src/main/java/org/mitre/synthea/world/concepts/GrowthChartEntry.java +++ b/src/main/java/org/mitre/synthea/world/concepts/GrowthChartEntry.java @@ -6,6 +6,16 @@ * Represents the LMS parameters on the CDC growth chart for a particular sex and age in months. */ public class GrowthChartEntry implements Serializable { + + /** + * The highest percentile to use when attempting to calculate a value. Tests with the BMI growth + * charts for females at 240 months show that values greater than 0.99739 cause a term in the + * equation to go negative causing the code to return NaN. Values slightly less than that can + * return unrealistic values. This provides a limit to the maximum percentile that will be looked + * up. + */ + public static double MAX_PERCENTILE = 0.995; + private double lboxCox; private double median; private double scov; @@ -51,11 +61,16 @@ public double percentileForValue(double value) { * @return The value for the given percentile */ public double lookUp(double percentile) { - double z = GrowthChart.calculateZScore(percentile); + double percentileToUse = percentile; + if (percentile > 0.995) { + percentileToUse = 0.995; + } + double z = GrowthChart.calculateZScore(percentileToUse); if (this.lboxCox == 0) { return this.median * Math.exp((this.scov * z)); } else { - return this.median * Math.pow((1 + (this.lboxCox * this.scov * z)), (1.0 / this.lboxCox)); + double expressionTerm = this.lboxCox * this.scov * z; + return this.median * Math.pow((1 + expressionTerm), (1.0 / this.lboxCox)); } } } diff --git a/src/test/java/org/mitre/synthea/modules/GrowthChartTest.java b/src/test/java/org/mitre/synthea/modules/GrowthChartTest.java index 4a40954467..e90636c883 100644 --- a/src/test/java/org/mitre/synthea/modules/GrowthChartTest.java +++ b/src/test/java/org/mitre/synthea/modules/GrowthChartTest.java @@ -58,7 +58,8 @@ public void testGrowthChartLookupHigh() throws Exception { @Test public void testGrowthChartLookupMax() throws Exception { double height = LifecycleModule.lookupGrowthChart("height", "M", 20, 1.0); - assertEquals(94.95447906, height, 0.01); + // Max value is now capped to the 99.5th percentile. + assertEquals(93.1240785326071, height, 0.01); } @Test diff --git a/src/test/java/org/mitre/synthea/world/concepts/GrowthChartTest.java b/src/test/java/org/mitre/synthea/world/concepts/GrowthChartTest.java new file mode 100644 index 0000000000..faa2c79419 --- /dev/null +++ b/src/test/java/org/mitre/synthea/world/concepts/GrowthChartTest.java @@ -0,0 +1,20 @@ +package org.mitre.synthea.world.concepts; + +import java.util.Map; + +import junit.framework.TestCase; + +public class GrowthChartTest extends TestCase { + + /** + * Test the look up of BMI values at the high end of the range. + */ + public void testLookUp() { + Map growthChart = + GrowthChart.loadCharts(); + double bmi = growthChart.get(GrowthChart.ChartType.BMI).lookUp(240, "F", 0.997394309960757); + assertFalse(Double.isNaN(bmi)); + bmi = growthChart.get(GrowthChart.ChartType.BMI).lookUp(240, "F", 0.5); + assertEquals(21.71699934, bmi, 0.01); + } +} \ No newline at end of file From 6aaccea8391c622f3dfe30e0e01d5d76d1a54e28 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Thu, 26 Oct 2023 10:21:57 -0400 Subject: [PATCH 42/78] fix export filter keeping old entries when there is an active entry of the same type --- .../org/mitre/synthea/export/Exporter.java | 26 +++++-------------- .../mitre/synthea/export/ExporterTest.java | 21 +++++++++++++++ 2 files changed, 28 insertions(+), 19 deletions(-) diff --git a/src/main/java/org/mitre/synthea/export/Exporter.java b/src/main/java/org/mitre/synthea/export/Exporter.java index c058a45e52..27d3e73e8e 100644 --- a/src/main/java/org/mitre/synthea/export/Exporter.java +++ b/src/main/java/org/mitre/synthea/export/Exporter.java @@ -598,25 +598,15 @@ private static HealthRecord filterForExport(HealthRecord record, int yearsToKeep long cutoffDate = endTime - Utilities.convertTime("years", yearsToKeep); Predicate notFutureDated = e -> e.start <= endTime; + Predicate entryIsActive = e -> e.stop == 0L || e.stop > cutoffDate; for (Encounter encounter : record.encounters) { List claimItems = encounter.claim.items; - // keep conditions if still active, regardless of start date - Predicate conditionActive = c -> record.conditionActive(c.type); - // or if the condition was active at any point since the cutoff date - Predicate activeWithinCutoff = c -> c.stop != 0L && c.stop > cutoffDate; - Predicate keepCondition = conditionActive.or(activeWithinCutoff); - filterEntries(encounter.conditions, claimItems, cutoffDate, endTime, keepCondition); + // keep a condition if it was active at any point since the cutoff date + filterEntries(encounter.conditions, claimItems, cutoffDate, endTime, entryIsActive); // allergies are essentially the same as conditions - // But we need to redefine all of the predicates, because we are talking about Allergies as - // opposed to Entries... You would think that it would work... but generics are hard - Predicate allergyActive = c -> record.allergyActive(c.type); - // or if the condition was active at any point since the cutoff date - Predicate allergyActiveWithinCutoff = - c -> c.stop != 0L && c.stop > cutoffDate; - Predicate keepAllergy = allergyActive.or(allergyActiveWithinCutoff); - filterEntries(encounter.allergies, claimItems, cutoffDate, endTime, keepAllergy); + filterEntries(encounter.allergies, claimItems, cutoffDate, endTime, entryIsActive); // some of the "future death" logic could potentially add a future-dated death certificate Predicate isCauseOfDeath = @@ -633,14 +623,12 @@ private static HealthRecord filterForExport(HealthRecord record, int yearsToKeep filterEntries(encounter.procedures, claimItems, cutoffDate, endTime, null); // keep medications if still active, regardless of start date - filterEntries(encounter.medications, claimItems, cutoffDate, endTime, - med -> record.medicationActive(med.type)); + filterEntries(encounter.medications, claimItems, cutoffDate, endTime, entryIsActive); filterEntries(encounter.immunizations, claimItems, cutoffDate, endTime, null); // keep careplans if they are still active, regardless of start date - filterEntries(encounter.careplans, claimItems, cutoffDate, endTime, - cp -> record.careplanActive(cp.type)); + filterEntries(encounter.careplans, claimItems, cutoffDate, endTime, entryIsActive); } // if ANY of these are not empty, the encounter is not empty @@ -675,7 +663,7 @@ private static HealthRecord filterForExport(HealthRecord record, int yearsToKeep */ private static void filterEntries(List entries, List claimItems, long cutoffDate, - long endTime, Predicate keepFunction) { + long endTime, Predicate keepFunction) { Iterator iterator = entries.iterator(); // iterator allows us to use the remove() method diff --git a/src/test/java/org/mitre/synthea/export/ExporterTest.java b/src/test/java/org/mitre/synthea/export/ExporterTest.java index d1cee91470..3eababb9cb 100644 --- a/src/test/java/org/mitre/synthea/export/ExporterTest.java +++ b/src/test/java/org/mitre/synthea/export/ExporterTest.java @@ -9,6 +9,7 @@ import org.mitre.synthea.TestHelper; import org.mitre.synthea.engine.Generator; import org.mitre.synthea.helpers.Config; +import org.mitre.synthea.helpers.Utilities; import org.mitre.synthea.modules.DeathModule; import org.mitre.synthea.world.agents.PayerManager; import org.mitre.synthea.world.agents.Person; @@ -257,4 +258,24 @@ public void testExportFilterShouldFilterClaimItems() { assertEquals("something_permanent", record.encounters.get(0).claim.items.get(0).entry.type); } + @Test + public void testExportFilterShouldNotKeepOldStuffWhenActiveOfSameType() { + // create old encounters with the same repeated condition, ended + long oneWeek = Utilities.convertTime("weeks", 1); + for (int i = 0 ; i < 3 ; i++) { + record.encounterStart(time - years(10 - i), EncounterType.EMERGENCY); + record.conditionStart(time - years(10 - i), "viral_sinusitis"); + record.conditionEnd(time - years(10 - i) + oneWeek, "viral_sinusitis"); + } + + // create a recent encounter with the same condition, still active + record.encounterStart(time - oneWeek, EncounterType.EMERGENCY); + record.conditionStart(time - oneWeek, "viral_sinusitis"); + + Person filtered = Exporter.filterForExport(patient, yearsToKeep, endTime); + + assertEquals(1, filtered.record.encounters.size()); + assertEquals(1, filtered.record.encounters.get(0).conditions.size()); + assertEquals("viral_sinusitis", filtered.record.encounters.get(0).conditions.get(0).type); + } } From 6352e2a1e4ec1d252fccbaedb291eb723c1d0d99 Mon Sep 17 00:00:00 2001 From: pramod2804 Date: Thu, 26 Oct 2023 14:57:14 -0700 Subject: [PATCH 43/78] Create CloudFormation.yaml Initial commit --- config/aws/CloudFormation.yaml | 161 +++++++++++++++++++++++++++++++++ 1 file changed, 161 insertions(+) create mode 100644 config/aws/CloudFormation.yaml diff --git a/config/aws/CloudFormation.yaml b/config/aws/CloudFormation.yaml new file mode 100644 index 0000000000..1a027c0537 --- /dev/null +++ b/config/aws/CloudFormation.yaml @@ -0,0 +1,161 @@ +AWSTemplateFormatVersion: 2010-09-09 + +Description: Sets up an Synthea on Amazon EC2 Instance + +Parameters: + InstanceType: + Type: String + Description: Instance type for Synth. Default is t2.micro. + AllowedValues: + - t3.small + - t3.medium + - t3.large + - t3.xlarge + - t3.2xlarge + - m4.large + - m4.xlarge + - m4.2xlarge + - m4.4xlarge + - m4.10xlarge + - m4.16xlarge + - c4.large + - c4.xlarge + - c4.2xlarge + - c4.4xlarge + - c4.8xlarge + - r4.large + - r4.xlarge + - r4.2xlarge + - r4.4xlarge + - r4.8xlarge + - r4.16xlarge + - g2.2xlarge + - g2.8xlarge + - p2.xlarge + - p2.8xlarge + - p2.16xlarge + - g3.4xlarge + - g3.8xlarge + - g3.16xlarge + ConstraintDescription: Valid instance type in the t23 m4, c4, r4, g2, p2, and g3 families + Default: t3.large + LatestAmiId: + Type: 'AWS::SSM::Parameter::Value' + Default: '/aws/service/ami-amazon-linux-latest/al2023-ami-kernel-default-x86_64' + VpcId: + Type: AWS::EC2::VPC::Id + Description: VPC this server will reside in + MyIp: + Type: String + Description: Provide your Public IP (you can find your ip address by visiting - https://whatismyipaddress.com/) + Default: 0.0.0.0/0 + KeyPair: + Type: "AWS::EC2::KeyPair::KeyName" + Description: Amazon EC2 Key Pair + SubnetId: + Type: "AWS::EC2::Subnet::Id" + Description: Subnet ID your instance will launch in. + +Resources: + SyntheOutPutS3Bucket: + Type: 'AWS::S3::Bucket' + Properties: + BucketName: !Join + - '-' + - - synthea-output + - !Ref 'AWS::AccountId' + PublicAccessBlockConfiguration: + BlockPublicAcls: true + BlockPublicPolicy: true + IgnorePublicAcls: true + RestrictPublicBuckets: true + + SyntheaInstanceProfile: + Type: AWS::IAM::InstanceProfile + Properties: + Path: / + Roles: + - !Ref SyntheaRole + + SyntheaRole: + Type: AWS::IAM::Role + Properties: + AssumeRolePolicyDocument: + Version: 2012-10-17 + Statement: + - Effect: Allow + Principal: + Service: + - "ec2.amazonaws.com" + Action: + - "sts:AssumeRole" + Policies: + - PolicyName: "S3InlinePolicy" + PolicyDocument: + Version: "2012-10-17" + Statement: + - Effect: "Allow" + Action: ["s3:ListBucket","s3:GetObject","s3:PutObject","s3:DeleteObject"] + Resource: + - "arn:aws:s3:::synthea-output*" + ManagedPolicyArns: + - "arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore" + + + SyntheaEC2SecurityGroup: + Type: AWS::EC2::SecurityGroup + Properties: + GroupDescription: Synthea Security Group + VpcId: !Ref VpcId + + SecurityGroupIngressMySSH: + Type: AWS::EC2::SecurityGroupIngress + Properties: + Description: "Allow SSH connections from MyIp" + GroupId: !Ref SyntheaEC2SecurityGroup + CidrIp: !Sub "${MyIp}" + IpProtocol: tcp + FromPort: 22 + ToPort: 22 + + SyntheaNetworkInterface: + Type: AWS::EC2::NetworkInterface + Properties: + SubnetId: !Ref SubnetId + Description: Interface for the Connection + GroupSet: + - !Ref SyntheaEC2SecurityGroup + SourceDestCheck: true + + SyntheaEC2Instance: + Type: AWS::EC2::Instance + Metadata: + 'AWS::CloudFormation::Init': + config: + files: + /tmp/test.txt: + content: Hello world! + mode: '000755' + owner: root + group: root + Properties: + ImageId: !Ref LatestAmiId + InstanceType: !Ref InstanceType + KeyName: !Ref KeyPair + IamInstanceProfile: !Ref SyntheaInstanceProfile + NetworkInterfaces: + - NetworkInterfaceId: !Ref SyntheaNetworkInterface + DeviceIndex: 0 + Tags: + - Key: Name + Value: Synthea + UserData: + Fn::Base64: | + #!/bin/bash + cd /home/ec2-user/ + sudo yum -y install java-17-amazon-corretto-headless + wget https://github.com/synthetichealth/synthea/releases/download/master-branch-latest/synthea-with-dependencies.jar + +Outputs: + PublicIp: + Value: !GetAtt SyntheaEC2Instance.PublicIp \ No newline at end of file From 17578ef5237941a4c80b0e8016ce99bfd720eb33 Mon Sep 17 00:00:00 2001 From: Andy Gregorowicz Date: Tue, 31 Oct 2023 17:07:39 -0400 Subject: [PATCH 44/78] Fix issues with NPEs related to the employment module The simulation expects every person to have an employment model set in their attributes. If a person was generated an a county where the `sdoh.csv` file did not have a row, the employment model would not get set. This change uses the state average information when the desired county can not be found. --- .../synthea/world/geography/Location.java | 2 +- .../synthea/world/geography/LocationTest.java | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/mitre/synthea/world/geography/Location.java b/src/main/java/org/mitre/synthea/world/geography/Location.java index 28e26853c2..13dd1c4407 100644 --- a/src/main/java/org/mitre/synthea/world/geography/Location.java +++ b/src/main/java/org/mitre/synthea/world/geography/Location.java @@ -389,7 +389,7 @@ public void assignPoint(Person person, String cityName) { */ public void setSocialDeterminants(Person person) { String county = (String) person.attributes.get(Person.COUNTY); - if (county == null) { + if (county == null || !socialDeterminantsOfHealth.containsKey(county)) { county = "AVERAGE"; } Map sdoh = socialDeterminantsOfHealth.get(county); diff --git a/src/test/java/org/mitre/synthea/world/geography/LocationTest.java b/src/test/java/org/mitre/synthea/world/geography/LocationTest.java index 289a8feb48..262ef9f32a 100644 --- a/src/test/java/org/mitre/synthea/world/geography/LocationTest.java +++ b/src/test/java/org/mitre/synthea/world/geography/LocationTest.java @@ -18,6 +18,7 @@ import org.mitre.synthea.helpers.SimpleCSV; import org.mitre.synthea.helpers.Utilities; import org.mitre.synthea.world.agents.Person; +import org.mitre.synthea.world.concepts.Employment; public class LocationTest { private static String locationDoesNotExist = "The Lost City of Atlantis"; @@ -238,5 +239,23 @@ public void testSocialDeterminantsOfHealth() { location.setSocialDeterminants(person); int attributeCountAfter = person.attributes.keySet().size(); Assert.assertTrue(attributeCountAfter > attributeCountBefore); + Assert.assertNotNull(person.attributes.get(Person.EMPLOYMENT_MODEL)); + + Person middlesexPerson = new Person(0L); + person.attributes.put(Person.COUNTY, "Middlesex County"); + attributeCountBefore = middlesexPerson.attributes.keySet().size(); + location.setSocialDeterminants(middlesexPerson); + attributeCountAfter = middlesexPerson.attributes.keySet().size(); + Assert.assertTrue(attributeCountAfter > attributeCountBefore); + Assert.assertNotNull(middlesexPerson.attributes.get(Person.EMPLOYMENT_MODEL)); + + Person nowherePerson = new Person(0L); + person.attributes.put(Person.COUNTY, "Nowhere County"); + attributeCountBefore = nowherePerson.attributes.keySet().size(); + location.setSocialDeterminants(nowherePerson); + attributeCountAfter = nowherePerson.attributes.keySet().size(); + Assert.assertTrue(attributeCountAfter > attributeCountBefore); + Assert.assertNotNull(nowherePerson.attributes.get(Person.EMPLOYMENT_MODEL)); + } } From d082b16f14f1de21b546b8cb9eacdfd66154bedd Mon Sep 17 00:00:00 2001 From: Andy Gregorowicz Date: Thu, 2 Nov 2023 09:33:28 -0400 Subject: [PATCH 45/78] Fix for NPE seen when sometimes trying to clone the next state Issue appears to be related to having two submodules with the same name as a part of a module. This renames the submodules to have unique names. --- .../modules/heart/avrr/{referral.json => avrr_referral.json} | 2 +- src/main/resources/modules/heart/avrr/sequence.json | 2 +- .../modules/heart/cabg/{referral.json => cabg_referral.json} | 2 +- src/main/resources/modules/heart/cabg_sequence.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) rename src/main/resources/modules/heart/avrr/{referral.json => avrr_referral.json} (99%) rename src/main/resources/modules/heart/cabg/{referral.json => cabg_referral.json} (99%) diff --git a/src/main/resources/modules/heart/avrr/referral.json b/src/main/resources/modules/heart/avrr/avrr_referral.json similarity index 99% rename from src/main/resources/modules/heart/avrr/referral.json rename to src/main/resources/modules/heart/avrr/avrr_referral.json index 08c033157c..5995a9add7 100644 --- a/src/main/resources/modules/heart/avrr/referral.json +++ b/src/main/resources/modules/heart/avrr/avrr_referral.json @@ -1,5 +1,5 @@ { - "name": "referral", + "name": "AVRr referral", "specialty": "CARDIOVASCULAR DISEASE (CARDIOLOGY)", "remarks": [ "AVRr Referral" diff --git a/src/main/resources/modules/heart/avrr/sequence.json b/src/main/resources/modules/heart/avrr/sequence.json index 97833a2c61..eaaf34112d 100644 --- a/src/main/resources/modules/heart/avrr/sequence.json +++ b/src/main/resources/modules/heart/avrr/sequence.json @@ -351,7 +351,7 @@ }, "Referral and Preoperative Testing": { "type": "CallSubmodule", - "submodule": "heart/avrr/referral", + "submodule": "heart/avrr/avrr_referral", "conditional_transition": [ { "transition": "Terminal", diff --git a/src/main/resources/modules/heart/cabg/referral.json b/src/main/resources/modules/heart/cabg/cabg_referral.json similarity index 99% rename from src/main/resources/modules/heart/cabg/referral.json rename to src/main/resources/modules/heart/cabg/cabg_referral.json index aea1617c02..6f6f158436 100644 --- a/src/main/resources/modules/heart/cabg/referral.json +++ b/src/main/resources/modules/heart/cabg/cabg_referral.json @@ -1,5 +1,5 @@ { - "name": "referral", + "name": "CABG referral", "specialty": "CARDIOVASCULAR DISEASE (CARDIOLOGY)", "remarks": [ "This submodule of Cardiac Surgery models Referral Pathways.", diff --git a/src/main/resources/modules/heart/cabg_sequence.json b/src/main/resources/modules/heart/cabg_sequence.json index dd696589dc..362c929259 100644 --- a/src/main/resources/modules/heart/cabg_sequence.json +++ b/src/main/resources/modules/heart/cabg_sequence.json @@ -163,7 +163,7 @@ }, "Referral and Preoperative Testing": { "type": "CallSubmodule", - "submodule": "heart/cabg/referral", + "submodule": "heart/cabg/cabg_referral", "conditional_transition": [ { "transition": "End Last Encounter", From dc9cedf792de7c3fe6e76ca0ee291918c2b6087f Mon Sep 17 00:00:00 2001 From: Arvind Shyamsundar Date: Sat, 4 Nov 2023 17:47:05 -0700 Subject: [PATCH 46/78] Replace SimpleDateFormat with FastDateFormat in ExportHelper ExportHelper originally used SimpleDateFormat, which is not thread-safe. Hence access to the static DATE_FORMAT and ISO_DATE_FORMAT had to be protected using `synchronized`, as noted in the original code. This synchronized access is especially visible on higher end machines. For example on a VM with 48 vCPUs, a `jstack -l` output analysis showed almost 50% of the pool threads were waiting on the static `ISO_DATE_FORMAT` instance within ExportHelper. On such machines, CPU usage would be low and Synthea's throughput was not scaling well with higher number of vCPUs. This change safely replaces those usage of SimpleDateFormat with FastDateFormat, which is thread-safe, thereby removing the need to synchronize access to those static instances across threads. The result of this is better scalability and improved usage of CPU, especially on higher-end compute. --- .../mitre/synthea/export/ExportHelper.java | 23 +++++++------------ 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/src/main/java/org/mitre/synthea/export/ExportHelper.java b/src/main/java/org/mitre/synthea/export/ExportHelper.java index d399e87108..173d0cf531 100644 --- a/src/main/java/org/mitre/synthea/export/ExportHelper.java +++ b/src/main/java/org/mitre/synthea/export/ExportHelper.java @@ -1,7 +1,7 @@ package org.mitre.synthea.export; import java.text.DecimalFormat; -import java.text.SimpleDateFormat; +import org.apache.commons.lang3.time.FastDateFormat; import java.time.DayOfWeek; import java.time.LocalDate; import java.time.temporal.TemporalAdjusters; @@ -162,20 +162,19 @@ public static String getObservationType(Observation observation) { /** * Year-Month-Day date format. */ - private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd"); + private static final FastDateFormat DATE_FORMAT = FastDateFormat.getInstance("yyyy-MM-dd"); /** * Iso8601 date time format. */ - private static final SimpleDateFormat ISO_DATE_FORMAT = iso(); + private static final FastDateFormat ISO_DATE_FORMAT = iso(); /** - * Create a SimpleDateFormat for iso8601. + * Create a FastDateFormat for iso8601. * @return Iso8601 date time format. */ - private static final SimpleDateFormat iso() { - SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'"); - f.setTimeZone(TimeZone.getTimeZone("UTC")); + private static final FastDateFormat iso() { + FastDateFormat f = FastDateFormat.getInstance("yyyy-MM-dd'T'HH:mm:ss'Z'", TimeZone.getTimeZone("UTC")); return f; } @@ -183,20 +182,14 @@ private static final SimpleDateFormat iso() { * Get a date string in the format YYYY-MM-DD from the given time stamp. */ public static String dateFromTimestamp(long time) { - synchronized (DATE_FORMAT) { - // http://bugs.java.com/bugdatabase/view_bug.do?bug_id=6231579 - return DATE_FORMAT.format(new Date(time)); - } + return DATE_FORMAT.format(new Date(time)); } /** * Get an iso8601 string for the given time stamp. */ public static String iso8601Timestamp(long time) { - synchronized (ISO_DATE_FORMAT) { - // http://bugs.java.com/bugdatabase/view_bug.do?bug_id=6231579 - return ISO_DATE_FORMAT.format(new Date(time)); - } + return ISO_DATE_FORMAT.format(new Date(time)); } /** From 574152ddcd48891d977424e1602229c4cf40408e Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Mon, 6 Nov 2023 11:55:41 -0500 Subject: [PATCH 47/78] checkstyle --- src/test/java/org/mitre/synthea/export/ExporterTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/java/org/mitre/synthea/export/ExporterTest.java b/src/test/java/org/mitre/synthea/export/ExporterTest.java index 3eababb9cb..d2c064479f 100644 --- a/src/test/java/org/mitre/synthea/export/ExporterTest.java +++ b/src/test/java/org/mitre/synthea/export/ExporterTest.java @@ -262,7 +262,7 @@ public void testExportFilterShouldFilterClaimItems() { public void testExportFilterShouldNotKeepOldStuffWhenActiveOfSameType() { // create old encounters with the same repeated condition, ended long oneWeek = Utilities.convertTime("weeks", 1); - for (int i = 0 ; i < 3 ; i++) { + for (int i = 0; i < 3; i++) { record.encounterStart(time - years(10 - i), EncounterType.EMERGENCY); record.conditionStart(time - years(10 - i), "viral_sinusitis"); record.conditionEnd(time - years(10 - i) + oneWeek, "viral_sinusitis"); @@ -271,7 +271,7 @@ public void testExportFilterShouldNotKeepOldStuffWhenActiveOfSameType() { // create a recent encounter with the same condition, still active record.encounterStart(time - oneWeek, EncounterType.EMERGENCY); record.conditionStart(time - oneWeek, "viral_sinusitis"); - + Person filtered = Exporter.filterForExport(patient, yearsToKeep, endTime); assertEquals(1, filtered.record.encounters.size()); From 4063fbc4476d2b0b6356ab372d0c9e29759e1488 Mon Sep 17 00:00:00 2001 From: Arvind Shyamsundar Date: Mon, 6 Nov 2023 14:20:08 -0800 Subject: [PATCH 48/78] Address checkstyle issues --- src/main/java/org/mitre/synthea/export/ExportHelper.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/mitre/synthea/export/ExportHelper.java b/src/main/java/org/mitre/synthea/export/ExportHelper.java index 173d0cf531..190274b14e 100644 --- a/src/main/java/org/mitre/synthea/export/ExportHelper.java +++ b/src/main/java/org/mitre/synthea/export/ExportHelper.java @@ -1,7 +1,6 @@ package org.mitre.synthea.export; import java.text.DecimalFormat; -import org.apache.commons.lang3.time.FastDateFormat; import java.time.DayOfWeek; import java.time.LocalDate; import java.time.temporal.TemporalAdjusters; @@ -13,6 +12,7 @@ import java.util.TimeZone; import java.util.UUID; +import org.apache.commons.lang3.time.FastDateFormat; import org.hl7.fhir.dstu3.model.Condition; import org.mitre.synthea.engine.Components.Attachment; import org.mitre.synthea.engine.Components.SampledData; @@ -174,7 +174,8 @@ public static String getObservationType(Observation observation) { * @return Iso8601 date time format. */ private static final FastDateFormat iso() { - FastDateFormat f = FastDateFormat.getInstance("yyyy-MM-dd'T'HH:mm:ss'Z'", TimeZone.getTimeZone("UTC")); + FastDateFormat f = FastDateFormat.getInstance("yyyy-MM-dd'T'HH:mm:ss'Z'", + TimeZone.getTimeZone("UTC")); return f; } From bea1b81d5dc4ff0d04141f0f1bc93457edb78f77 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Wed, 8 Nov 2023 15:12:42 -0500 Subject: [PATCH 49/78] fill in an obvious TODO --- src/main/java/RunFlexporter.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/java/RunFlexporter.java b/src/main/java/RunFlexporter.java index 9d9d9d066c..4d8cd79e46 100644 --- a/src/main/java/RunFlexporter.java +++ b/src/main/java/RunFlexporter.java @@ -132,9 +132,17 @@ private static void convertFhir(File mappingFile, File igDirectory, File sourceF IParser parser = FhirR4.getContext().newJsonParser().setPrettyPrint(true); - if (sourceFhir.isDirectory()) { + handleFile(sourceFhir, mapping, parser); + } - // TODO + private static void handleFile(File sourceFhir, Mapping mapping, IParser parser) + throws IOException { + if (sourceFhir.isDirectory()) { + for (File subfile : sourceFhir.listFiles()) { + if (subfile.isDirectory() || subfile.getName().endsWith(".json")) { + handleFile(subfile, mapping, parser); + } + } } else { String fhirJson = new String(Files.readAllBytes(sourceFhir.toPath())); From 34ddcb189fdf2cf237658ea00ede08bc8cb84d3e Mon Sep 17 00:00:00 2001 From: Andy Gregorowicz Date: Thu, 9 Nov 2023 08:45:38 -0500 Subject: [PATCH 50/78] Update src/main/java/org/mitre/synthea/world/concepts/GrowthChartEntry.java Co-authored-by: Dylan Hall --- .../org/mitre/synthea/world/concepts/GrowthChartEntry.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/mitre/synthea/world/concepts/GrowthChartEntry.java b/src/main/java/org/mitre/synthea/world/concepts/GrowthChartEntry.java index 350d84b076..01803b753f 100644 --- a/src/main/java/org/mitre/synthea/world/concepts/GrowthChartEntry.java +++ b/src/main/java/org/mitre/synthea/world/concepts/GrowthChartEntry.java @@ -62,8 +62,8 @@ public double percentileForValue(double value) { */ public double lookUp(double percentile) { double percentileToUse = percentile; - if (percentile > 0.995) { - percentileToUse = 0.995; + if (percentile > MAX_PERCENTILE) { + percentileToUse = MAX_PERCENTILE; } double z = GrowthChart.calculateZScore(percentileToUse); if (this.lboxCox == 0) { From c2f1f763c45424fbcca7adbde674ed94a7bd304e Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Thu, 9 Nov 2023 13:45:49 -0500 Subject: [PATCH 51/78] new script and deploy action step to generate 1k sample patient data --- .github/workflows/deploy.yml | 12 ++++++++++++ generate_samples.sh | 17 +++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100755 generate_samples.sh diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index f791228f94..a3768d5b8e 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -30,6 +30,7 @@ jobs: ./gradlew uberJar javadoc graphviz mkdir -p output/build/javadoc mv build/docs/javadoc/* output/build/javadoc + ./generate_samples.sh - name: Delete Previous master-branch-latest Tag uses: dev-drprasad/delete-tag-and-release@v0.2.1 @@ -85,6 +86,17 @@ jobs: commit_message: rebuild graphs, javadoc and binary distribution at # note the commit SHA is appended automatically + - name: Push samples to sample repo + uses: cpina/github-action-push-to-another-repository@main + env: + SSH_DEPLOY_KEY: ${{ secrets.PUSH_SAMPLE_DATA_SSH_KEY }} + with: + source-directory: 'samples' + destination-github-username: 'dehall' + destination-repository-name: 'synthea-sample-data' + target-directory: 'downloads/latest' + target-branch: main + - name: Slack Notification on Failure uses: 8398a7/action-slack@v3 if: failure() diff --git a/generate_samples.sh b/generate_samples.sh new file mode 100755 index 0000000000..3b41fdb4e2 --- /dev/null +++ b/generate_samples.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# This script generates 1000 sample patients in the most common output formats +# and zips them up by type in the ./samples/ subdirectory + +./run_synthea -p 1000 \ + --exporter.ccda.export=true \ + --exporter.fhir.export=true \ + --exporter.fhir_stu3.export=true \ + --exporter.fhir_dstu2.export=true \ + --exporter.csv.export=true \ + +mkdir samples + +for type in ccda fhir fhir_stu3 fhir_dstu2 csv +do + zip -jr samples/synthea_sample_data_${type}_latest.zip output/${type}/ +done \ No newline at end of file From db5e43bd53caa7b3a3db129d84974642a732445c Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Thu, 9 Nov 2023 13:50:35 -0500 Subject: [PATCH 52/78] use the right username --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index a3768d5b8e..4d78701df5 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -92,7 +92,7 @@ jobs: SSH_DEPLOY_KEY: ${{ secrets.PUSH_SAMPLE_DATA_SSH_KEY }} with: source-directory: 'samples' - destination-github-username: 'dehall' + destination-github-username: 'synthetichealth' destination-repository-name: 'synthea-sample-data' target-directory: 'downloads/latest' target-branch: main From b068d8c9ebd1589abda51f12562c46f79cdc9e31 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Fri, 10 Nov 2023 13:37:28 -0500 Subject: [PATCH 53/78] delete uncompressed sample data --- .github/workflows/deploy.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 4d78701df5..65f74abaef 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -27,10 +27,12 @@ jobs: - name: Create Artifacts run: | + ./generate_samples.sh + # delete uncompressed output, sample zips are in ./samples/ + rm -rf output/ ./gradlew uberJar javadoc graphviz mkdir -p output/build/javadoc mv build/docs/javadoc/* output/build/javadoc - ./generate_samples.sh - name: Delete Previous master-branch-latest Tag uses: dev-drprasad/delete-tag-and-release@v0.2.1 From de38f5fb7d5f2eb0d0d596999523d7b76fead994 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Tue, 14 Nov 2023 13:45:33 -0500 Subject: [PATCH 54/78] update RandomCodeGenerator to read from HAPI ValueSet instead of JSON model --- src/main/java/RunFlexporter.java | 10 +- .../synthea/export/flexporter/Actions.java | 18 ++- .../CustomFHIRPathResourceGeneratorR4.java | 12 +- .../export/flexporter/FhirPathUtils.java | 2 +- .../synthea/helpers/RandomCodeGenerator.java | 147 +++++++----------- .../helpers/RandomCodeGeneratorTest.java | 15 +- 6 files changed, 81 insertions(+), 123 deletions(-) diff --git a/src/main/java/RunFlexporter.java b/src/main/java/RunFlexporter.java index 4d8cd79e46..a7918e2dbb 100644 --- a/src/main/java/RunFlexporter.java +++ b/src/main/java/RunFlexporter.java @@ -199,16 +199,8 @@ static void loadIG(File igDirectory) throws IOException { } if (resource instanceof ValueSet) { - // TODO: fix RandomCodeGenerator to work with HAPI objects - // because this is silly - - ObjectMapper objectMapper = new ObjectMapper(); - - Map valueSet = objectMapper.readValue(fhirJson, - new TypeReference>() { - }); try { - RandomCodeGenerator.loadValueSet(null, valueSet); + RandomCodeGenerator.loadValueSet(null, (ValueSet)resource); } catch (Exception e) { System.err.println("WARNING: Unable to load ValueSet " + artifact.getAbsolutePath()); e.printStackTrace(); diff --git a/src/main/java/org/mitre/synthea/export/flexporter/Actions.java b/src/main/java/org/mitre/synthea/export/flexporter/Actions.java index bde9d50464..d9d308aee4 100644 --- a/src/main/java/org/mitre/synthea/export/flexporter/Actions.java +++ b/src/main/java/org/mitre/synthea/export/flexporter/Actions.java @@ -35,9 +35,15 @@ import org.mitre.synthea.export.flexporter.FieldWrapper.ReferenceFieldWrapper; import org.mitre.synthea.helpers.RandomCodeGenerator; import org.mitre.synthea.world.agents.Person; - -// For now -@SuppressWarnings("unchecked") +import org.mitre.synthea.world.concepts.HealthRecord.Code; + +/** + * The Actions class represents the set of all actions the Flexporter can perform. + * The entry point is the applyMapping function which invokes the appropriate method. + * Unlike the State class where each state type is a subclass, this uses a method + * to represent each action. At some point it may be refactored to be more like State. + */ +@SuppressWarnings("unchecked") // For now public abstract class Actions { /** @@ -767,8 +773,12 @@ private static Base findValue(Bundle bundle, String... args) { } private static Map randomCode(String valueSetUrl) { - Map codeAsMap = RandomCodeGenerator.getCodeAsMap(valueSetUrl, + Code code = RandomCodeGenerator.getCode(valueSetUrl, (int) (Math.random() * Integer.MAX_VALUE)); + Map codeAsMap = Map.of( + "system", code.system, + "code", code.code, + "display", code.display); return codeAsMap; } } diff --git a/src/main/java/org/mitre/synthea/export/flexporter/CustomFHIRPathResourceGeneratorR4.java b/src/main/java/org/mitre/synthea/export/flexporter/CustomFHIRPathResourceGeneratorR4.java index 3212796afc..71400e5174 100644 --- a/src/main/java/org/mitre/synthea/export/flexporter/CustomFHIRPathResourceGeneratorR4.java +++ b/src/main/java/org/mitre/synthea/export/flexporter/CustomFHIRPathResourceGeneratorR4.java @@ -38,7 +38,7 @@ * -- swapped constructors, pass in a FhirContext to avoid recreating it for each resource * -- add support for extensions on primitives * -- more advanced java generics - * (some functions now take in Class<? extends T> instead of just T) + * (some functions now take in {@code Class} instead of just T) * -- reformatted per Synthea style guidelines * *

Original: @@ -93,8 +93,8 @@ public CustomFHIRPathResourceGeneratorR4() { /** * Setter for the FHIRPath mapping Map instance. * - * @param mapping Map<String, Object> a mapping of FHIRPath to objects that will be used to - * create a Resource. + * @param mapping {@code Map} a mapping of FHIRPath to objects + * that will be used to create a Resource. */ public void setMapping(Map mapping) { this.pathMapping = mapping; @@ -121,7 +121,7 @@ public void setResource(T resource) { * Prepares the internal state prior to generating a FHIR Resource. Called once upon generation at * the start. * - * @param resourceClass Class<T> The class of the Resource that shall be created (an empty + * @param resourceClass {@code Class} The class of the Resource that shall be created (an empty * Resource will be created in this method). */ @SuppressWarnings("unchecked") @@ -154,7 +154,7 @@ public T generateResource(String resourceType) { * The generation method that yields a new instance of class `resourceClass` with every value set * in the FHIRPath mapping. * - * @param resourceClass Class<T> The class of the Resource that shall be created. + * @param resourceClass {@code Class} The class of the Resource that shall be created. * @return T a new FHIR Resource instance of class `resourceClass`. */ public T generateResource(Class resourceClass) { @@ -631,7 +631,7 @@ private void handleWhereFunctionParam(ExpressionNode param) { * Creates a list all FHIRPaths from the mapping ordered by paths with where equals, where * unequals and the rest. * - * @return List<String> a List of FHIRPaths ordered by the type. + * @return {@code List} a List of FHIRPaths ordered by the type. */ private List sortedPaths() { List whereEquals = new ArrayList(); diff --git a/src/main/java/org/mitre/synthea/export/flexporter/FhirPathUtils.java b/src/main/java/org/mitre/synthea/export/flexporter/FhirPathUtils.java index 4849ff42dc..3e128a6b86 100644 --- a/src/main/java/org/mitre/synthea/export/flexporter/FhirPathUtils.java +++ b/src/main/java/org/mitre/synthea/export/flexporter/FhirPathUtils.java @@ -166,7 +166,7 @@ static boolean isTruthy(Base result) { /** * Helper function to convert FHIRPath evaluation results into a boolean. - * FHIRPath.evaluate returns a List which is matching pieces of resources. + * FHIRPath.evaluate returns a {@code List} which is matching pieces of resources. * This will return false if the list is empty, or if everything in the list is falsy. */ static boolean isTruthy(List result) { diff --git a/src/main/java/org/mitre/synthea/helpers/RandomCodeGenerator.java b/src/main/java/org/mitre/synthea/helpers/RandomCodeGenerator.java index 17f4b93d1a..35b1f83e5e 100644 --- a/src/main/java/org/mitre/synthea/helpers/RandomCodeGenerator.java +++ b/src/main/java/org/mitre/synthea/helpers/RandomCodeGenerator.java @@ -1,16 +1,14 @@ package org.mitre.synthea.helpers; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.ObjectMapper; +import ca.uhn.fhir.parser.IParser; import java.io.IOException; import java.util.ArrayList; -import java.util.Collection; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Random; +import java.util.stream.Collectors; import javax.annotation.Nonnull; @@ -20,9 +18,14 @@ import okhttp3.ResponseBody; import org.apache.commons.lang3.StringUtils; import org.apache.commons.validator.routines.UrlValidator; +import org.hl7.fhir.r4.model.ValueSet; +import org.hl7.fhir.r4.model.ValueSet.ConceptReferenceComponent; +import org.hl7.fhir.r4.model.ValueSet.ConceptSetComponent; +import org.hl7.fhir.r4.model.ValueSet.ValueSetComposeComponent; +import org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionComponent; +import org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionContainsComponent; +import org.mitre.synthea.export.FhirR4; import org.mitre.synthea.world.concepts.HealthRecord.Code; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; /** * Generates random codes based upon ValueSet URIs, with the help of a FHIR @@ -36,8 +39,7 @@ public abstract class RandomCodeGenerator { public static String expandBaseUrl = Config.get("generate.terminology_service_url") + "/ValueSet/$expand?url="; - private static final Logger logger = LoggerFactory.getLogger(RandomCodeGenerator.class); - public static Map> codeListCache = new HashMap<>(); + public static Map> codeListCache = new HashMap<>(); public static List selectedCodes = new ArrayList<>(); private static UrlValidator urlValidator = new UrlValidator(UrlValidator.ALLOW_2_SLASHES); private static OkHttpClient client = new OkHttpClient(); @@ -53,12 +55,11 @@ public abstract class RandomCodeGenerator { */ public static Code getCode(String valueSetUri, long seed, Code code) { if (urlValidator.isValid(valueSetUri)) { - Map codeMap = getCodeAsMap(valueSetUri, seed); - if (codeMap == null) { + Code newCode = getCode(valueSetUri, seed); + if (newCode == null) { return code; } - validateCode(codeMap); - Code newCode = new Code(codeMap.get("system"), codeMap.get("code"), codeMap.get("display")); + validateCode(newCode); selectedCodes.add(newCode); return newCode; } @@ -66,23 +67,22 @@ public static Code getCode(String valueSetUri, long seed, Code code) { } /** - * Gets a random code from the expansion of a ValueSet, represented as a Map. + * Gets a random code from the expansion of a ValueSet. * * @param valueSetUri * the URI of the ValueSet * @param seed * a random seed to ensure reproducibility of this result - * @return the randomly selected code as a Map of Strings + * @return the randomly selected code */ - @SuppressWarnings("unchecked") - public static Map getCodeAsMap(String valueSetUri, long seed) { + public static Code getCode(String valueSetUri, long seed) { if (urlValidator.isValid(valueSetUri)) { expandValueSet(valueSetUri); - List codes = codeListCache.get(valueSetUri); + List codes = codeListCache.get(valueSetUri); int randomIndex = new Random(seed).nextInt(codes.size()); - Map codeMap = (Map) codes.get(randomIndex); - validateCode(codeMap); - return codeMap; + Code code = codes.get(randomIndex); + validateCode(code); + return code; } return null; } @@ -94,37 +94,12 @@ public static Map getCodeAsMap(String valueSetUri, long seed) { * @param valueSetUri URI of the ValueSet to check the code for * @return true if the code is in the given valueset */ - @SuppressWarnings("unchecked") // TODO: this does not belong here, but this class is where the code cache is public static boolean codeInValueSet(Code code, String valueSetUri) { if (urlValidator.isValid(valueSetUri)) { expandValueSet(valueSetUri); - - // TODO: there has to be a better way to do this - Map codeAsMap = new HashMap<>(); - codeAsMap.put("system", code.system); - codeAsMap.put("code", code.code); - codeAsMap.put("display", code.display); - - List cachedCodeList = codeListCache.get(valueSetUri); - - // this will only return true if everything is exactly identical - // ie, it will not match if display is different - if (cachedCodeList.contains(codeAsMap)) { - return true; - } - - // iterate through all the codes to see if it contains the system/code combo - // TODO: pick better data structures that support this - - for (Object cachedCodeObj : cachedCodeList) { - Map cachedCode = (Map)cachedCodeObj; - - if (cachedCode.get("system").equals(code.system) - && cachedCode.get("code").equals(code.code)) { - return true; - } - } + List cachedCodeList = codeListCache.get(valueSetUri); + return cachedCodeList.contains(code); } // TODO?? return false; @@ -137,25 +112,19 @@ private static synchronized void expandValueSet(String valueSetUri) { .url(expandBaseUrl + valueSetUri) .header("Content-Type", "application/json") .build(); - Map valueSet = null; try { Response response = client.newCall(request).execute(); - ObjectMapper objectMapper = new ObjectMapper(); ResponseBody body = response.body(); if (body != null) { - valueSet = objectMapper.readValue(body.byteStream(), - new TypeReference>() { - }); + IParser parser = FhirR4.getContext().newJsonParser(); + ValueSet valueSet = (ValueSet) parser.parseResource(body.charStream()); + loadValueSet(valueSetUri, valueSet); } else { throw new RuntimeException("Value Set Expansion contained no body"); } - } catch (JsonProcessingException e) { - throw new RuntimeException("JsonProcessingException while parsing valueSet response"); } catch (IOException e) { throw new RuntimeException("Issue when expanding the value set", e); } - - loadValueSet(valueSetUri, valueSet); } } @@ -164,47 +133,35 @@ private static synchronized void expandValueSet(String valueSetUri) { * @param valueSetUri URI to reference this value set * @param valueSet Parsed JSON representation of FHIR valueset */ - @SuppressWarnings("unchecked") - public static void loadValueSet(String valueSetUri, Map valueSet) { + public static void loadValueSet(String valueSetUri, ValueSet valueSet) { if (valueSetUri == null) { - valueSetUri = (String)valueSet.get("url"); + valueSetUri = valueSet.getUrl(); } if (valueSetUri != null && !codeListCache.containsKey(valueSetUri)) { - Map expansion = (Map) valueSet.get("expansion"); - if (expansion != null) { - validateExpansion(expansion); - codeListCache.put(valueSetUri, (List) expansion.get("contains")); + if (valueSet.hasExpansion()) { + ValueSetExpansionComponent expansion = valueSet.getExpansion(); - } else { - Map compose = (Map) valueSet.get("compose"); - - if (compose == null) { - throw new RuntimeException("ValueSet does not contain compose or expansion"); - } - - // TODO: why is this List instead of something more specific? - // we know the contents are Map - List codes = new ArrayList<>(); - - List> includeList = (List>) compose.get("include"); + validateExpansion(expansion); + List contains = expansion.getContains(); + List containsCodes = contains.stream() + .map(c -> new Code(c.getSystem(), c.getCode(), c.getDisplay())) + .collect(Collectors.toList()); + codeListCache.put(valueSetUri, containsCodes); - for (Map include : includeList) { - String system = (String)include.get("system"); + } else if (valueSet.hasCompose()) { + List codes = new ArrayList<>(); + ValueSetComposeComponent compose = valueSet.getCompose(); + List includeList = compose.getInclude(); - List> conceptList = - (List>) include.get("concept"); + for (ConceptSetComponent include : includeList) { + String system = include.getSystem(); - for (Map concept : conceptList) { - Map codeAsMap = new HashMap<>(); - codeAsMap.put("system", system); - codeAsMap.put("code", (String)concept.get("code")); - codeAsMap.put("display", (String)concept.get("display")); + List conceptList = include.getConcept(); - codes.add(codeAsMap); + for (ConceptReferenceComponent concept : conceptList) { + codes.add(new Code(system, concept.getCode(), concept.getDisplay())); } - - } if (codes.isEmpty()) { @@ -212,24 +169,24 @@ public static void loadValueSet(String valueSetUri, Map valueSet } codeListCache.put(valueSetUri, codes); - - + } else { + throw new RuntimeException("ValueSet does not contain compose or expansion"); } System.out.println("Loaded " + valueSetUri); } } - private static void validateExpansion(@Nonnull Map expansion) { - if (!expansion.containsKey("contains") - || ((Collection) expansion.get("contains")).isEmpty()) { + private static void validateExpansion(@Nonnull ValueSetExpansionComponent expansion) { + if (expansion.getContains() == null + || expansion.getContains().isEmpty()) { throw new RuntimeException("ValueSet expansion does not contain any codes"); - } else if (!expansion.containsKey("total")) { + } else if (expansion.getTotal() == 0) { throw new RuntimeException("No total element in ValueSet expand result"); } } - private static void validateCode(Map code) { - if (StringUtils.isAnyEmpty(code.get("system"), code.get("code"), code.get("display"))) { + private static void validateCode(Code code) { + if (StringUtils.isAnyEmpty(code.system, code.code, code.display)) { throw new RuntimeException( "ValueSet contains element does not contain system, code and display"); } diff --git a/src/test/java/org/mitre/synthea/helpers/RandomCodeGeneratorTest.java b/src/test/java/org/mitre/synthea/helpers/RandomCodeGeneratorTest.java index ec20eea6cb..ec7b635527 100644 --- a/src/test/java/org/mitre/synthea/helpers/RandomCodeGeneratorTest.java +++ b/src/test/java/org/mitre/synthea/helpers/RandomCodeGeneratorTest.java @@ -1,7 +1,10 @@ package org.mitre.synthea.helpers; +import static org.junit.Assert.assertThrows; import static org.mitre.synthea.TestHelper.SNOMED_URI; +import ca.uhn.fhir.parser.DataFormatException; + import java.io.IOException; import java.io.InputStream; import java.nio.charset.StandardCharsets; @@ -107,14 +110,10 @@ public void throwsWhenMissingCodeElements() throws IOException { public void throwsWhenInvalidResponse() throws IOException { prepareServer("noExpansion.ValueSet.json", true); - try { - RandomCodeGenerator.getCode(VALUE_SET_URI, SEED, this.code); - } catch (RuntimeException e) { - Assert.assertEquals("JsonProcessingException while parsing valueSet response", - e.getMessage()); - return; - } - Assert.fail("Should have thrown a JsonProcessingException exception"); + assertThrows( + DataFormatException.class, + () -> RandomCodeGenerator.getCode(VALUE_SET_URI, SEED, this.code) + ); } From 36ca5dafe2f702eaa0611fc44ad65c2e3acbdb3d Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Tue, 14 Nov 2023 16:38:35 -0500 Subject: [PATCH 55/78] reduce samples to 100 patients --- generate_samples.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/generate_samples.sh b/generate_samples.sh index 3b41fdb4e2..f774ace6af 100755 --- a/generate_samples.sh +++ b/generate_samples.sh @@ -1,8 +1,8 @@ #!/bin/bash -# This script generates 1000 sample patients in the most common output formats +# This script generates 100 sample patients in the most common output formats # and zips them up by type in the ./samples/ subdirectory -./run_synthea -p 1000 \ +./run_synthea -p 100 \ --exporter.ccda.export=true \ --exporter.fhir.export=true \ --exporter.fhir_stu3.export=true \ @@ -14,4 +14,4 @@ mkdir samples for type in ccda fhir fhir_stu3 fhir_dstu2 csv do zip -jr samples/synthea_sample_data_${type}_latest.zip output/${type}/ -done \ No newline at end of file +done From 43bd6e3da60b626c835c1fc69be1cd331b3bc3db Mon Sep 17 00:00:00 2001 From: Andy Gregorowicz Date: Fri, 18 Nov 2022 16:17:18 -0500 Subject: [PATCH 56/78] WIP: Starting update on UTI with telemedicine and ED paths --- .../resources/modules/lookup_tables/uti.csv | 11 + .../modules/urinary_tract_infections.json | 543 ++++-------------- .../resources/modules/uti/telemed_path.json | 288 ++++++++++ 3 files changed, 404 insertions(+), 438 deletions(-) create mode 100644 src/main/resources/modules/lookup_tables/uti.csv create mode 100644 src/main/resources/modules/uti/telemed_path.json diff --git a/src/main/resources/modules/lookup_tables/uti.csv b/src/main/resources/modules/lookup_tables/uti.csv new file mode 100644 index 0000000000..7e2d66b37a --- /dev/null +++ b/src/main/resources/modules/lookup_tables/uti.csv @@ -0,0 +1,11 @@ +age,gender,Cystitis,Pyelonephritis,Wait_for_UTI +15-24,F,0.0681,0.0016,0.9303 +25-44,F,0.0495,0.0011,0.9494 +45-64,F,0.0536,0.0011,0.9453 +65-74,F,0.0971,0.0012,0.9017 +75-140,F,0.1449,0.0026,0.8525 +15-24,M,0.0013,0.0001,0.9986 +25-44,M,0.0035,0.0001,0.9964 +45-64,M,0.0081,0.0003,0.9916 +65-74,M,0.0241,0.0007,0.9752 +75-140,M,0.0496,0.001,0.9494 \ No newline at end of file diff --git a/src/main/resources/modules/urinary_tract_infections.json b/src/main/resources/modules/urinary_tract_infections.json index 127edba8e2..157bdc5c1b 100644 --- a/src/main/resources/modules/urinary_tract_infections.json +++ b/src/main/resources/modules/urinary_tract_infections.json @@ -18,481 +18,148 @@ "states": { "Initial": { "type": "Initial", - "remarks": [ - "======================================================================", - " INCIDENCE ", - "======================================================================", - "https://www.kidney.org/sites/default/files/uti.pdf:", - " ''One in five women will have at least one UTI in her lifetime. ", - " Nearly 20 percent of women who have a UTI will have another, ", - " and 30 percent of those will have yet another. Of this last ", - " group, 80 percent will have recurrences.'' ", - "https://www.betterhealth.vic.gov.au/health/conditionsandtreatments/urinary-tract-infections-uti:", - " ''Around one in two women and one in 20 men will get a UTI in their lifetime'' " - ], - "complex_transition": [ - { - "condition": { - "condition_type": "Gender", - "gender": "M" - }, - "distributions": [ - { - "distribution": 0.95, - "transition": "Terminal", - "remarks": [ - "Most men will never get a UTI." - ] - }, - { - "distribution": 0.05, - "transition": "Wait_For_Old_Age" - } - ] - }, - { - "distributions": [ - { - "distribution": 0.5, - "transition": "Delay_Until_Right_Age", - "remarks": [ - "1 in 2 women gets a UTI." - ] - }, - { - "distribution": 0.5, - "transition": "Terminal" - } - ] - } - ] + "direct_transition": "Wait Unit 15", + "name": "Initial" + }, + "Terminal": { + "type": "Terminal", + "name": "Terminal" }, - "Wait_For_Old_Age": { + "Wait Unit 15": { "type": "Guard", "allow": { "condition_type": "Age", - "operator": ">", - "quantity": 55, - "unit": "years" - }, - "direct_transition": "Wait_For_Next_UTI" - }, - "Delay_Until_Right_Age": { - "type": "Delay", - "remarks": [ - "Women may start getting UTIs at different points in their life." - ], - "range": { - "low": 15, - "high": 55, - "unit": "years" - }, - "direct_transition": "Wait_For_Next_UTI" - }, - "Wait_For_Next_UTI": { - "type": "Delay", - "remarks": [ - "======================================================================", - " URINARY TRACT INFECTION ", - "======================================================================", - "This is most commonly a bacterial infection of the urethra or bladder ", - "(urethritis and cystitis, respectively). In rare cases this could also ", - "be an infection of the kidneys (pyelonephritis)." - ], - "range": { - "low": 1, - "high": 7, - "unit": "years" + "operator": ">=", + "quantity": 15, + "unit": "years", + "value": 0 }, - "direct_transition": "Urinary_Tract_Infection" + "direct_transition": "Urinary Tract Infection", + "name": "Wait Unit 15" }, - "Urinary_Tract_Infection": { + "Urinary Tract Infection": { "type": "Simple", - "distributed_transition": [ - { - "distribution": 0.6, - "transition": "Urethritis" - }, - { - "distribution": 0.39, - "transition": "Cystitis" - }, - { - "distribution": 0.01, - "transition": "Pyelonephritis" - } - ] - }, - "Urethritis": { - "type": "ConditionOnset", - "target_encounter": "UTI_Diagnosis", - "assign_to_attribute": "uti", - "codes": [ - { - "system": "SNOMED-CT", - "code": "301011002", - "display": "Escherichia coli urinary tract infection" - } - ], - "direct_transition": "UTI_Symptom1" + "name": "Urinary Tract Infection", + "lookup_table_transition": { + "type": "Table", + "transitions": [ + { + "transition": "Cystitis", + "default_probability": 0.1, + "lookup_table_name": "uti.csv" + }, + { + "transition": "Pyelonephritis", + "default_probability": 0.1, + "lookup_table_name": "uti.csv" + }, + { + "transition": "Wait_for_UTI", + "default_probability": 0.8, + "lookup_table_name": "uti.csv" + } + ], + "lookup_table_name_ModuleBuilder": "uti.csv", + "viewTable": false, + "lookuptable": "" + } }, "Cystitis": { "type": "ConditionOnset", - "target_encounter": "UTI_Diagnosis", - "assign_to_attribute": "uti", + "target_encounter": "text", "codes": [ { "system": "SNOMED-CT", - "code": "38822007", - "display": "Cystitis" + "code": 307426000, + "display": "Acute infective cystitis (disorder)", + "value_set": "" } ], - "direct_transition": "UTI_Symptom1" + "direct_transition": "Care Pathways", + "name": "Cystitis", + "assign_to_attribute": "uti" }, "Pyelonephritis": { "type": "ConditionOnset", - "target_encounter": "UTI_Diagnosis", - "assign_to_attribute": "uti", - "codes": [ - { - "system": "SNOMED-CT", - "code": "45816000", - "display": "Pyelonephritis" - } - ], - "direct_transition": "UTI_Symptom1" - }, - "UTI_Diagnosis": { - "type": "Encounter", - "encounter_class": "ambulatory", - "reason": "uti", - "telemedicine_possibility": "possible", + "target_encounter": "", "codes": [ { "system": "SNOMED-CT", - "code": "185345009", - "display": "Encounter for symptom" - } - ], - "direct_transition": "Prescribe_UTI_Antibiotic" - }, - "UTI_Symptom1": { - "type": "Symptom", - "symptom": "Dysuria", - "range": { - "low": 5, - "high": 25 - }, - "direct_transition": "UTI_Symptom2" - }, - "UTI_Symptom2": { - "type": "Symptom", - "symptom": "Urgent Desire to Urinate", - "range": { - "low": 5, - "high": 25 - }, - "direct_transition": "UTI_Symptom3" - }, - "UTI_Symptom3": { - "type": "Symptom", - "symptom": "Frequent Urination", - "range": { - "low": 5, - "high": 25 - }, - "direct_transition": "UTI_Symptom4" - }, - "UTI_Symptom4": { - "type": "Symptom", - "symptom": "Discolored Urine", - "range": { - "low": 0, - "high": 10 - }, - "direct_transition": "UTI_Symptom5" - }, - "UTI_Symptom5": { - "type": "Symptom", - "symptom": "Odor of Urine", - "range": { - "low": 0, - "high": 10 - }, - "direct_transition": "UTI_Symptom6" - }, - "UTI_Symptom6": { - "type": "Symptom", - "symptom": "Pelvic Pain", - "range": { - "low": 0, - "high": 15 - }, - "direct_transition": "UTI_Symptom7" - }, - "UTI_Symptom7": { - "type": "Symptom", - "symptom": "Fever", - "range": { - "low": 0, - "high": 10 - }, - "direct_transition": "Symptom_Period" - }, - "Symptom_Period": { - "type": "Delay", - "range": { - "low": 24, - "high": 48, - "unit": "days" - }, - "direct_transition": "UTI_Diagnosis" - }, - "Prescribe_UTI_Antibiotic": { - "type": "MedicationOrder", - "reason": "uti", - "remarks": [ - "This is an antibiotic commonly prescribed for UTIs." - ], - "codes": [ - { - "system": "RxNorm", - "code": "311989", - "display": "Nitrofurantoin 5 MG/ML Oral Suspension" - } - ], - "direct_transition": "Prescribe_OTC_Painkiller_For_UTIs" - }, - "Prescribe_OTC_Painkiller_For_UTIs": { - "type": "MedicationOrder", - "reason": "uti", - "remarks": [ - "This is an OTC pain medication specifically for the urinary tract." - ], - "codes": [ - { - "system": "RxNorm", - "code": "1094107", - "display": "Phenazopyridine hydrochloride 100 MG Oral Tablet" + "code": 45816000, + "display": "Pyelonephritis", + "value_set": "" } ], - "direct_transition": "UTI_CarePlan" + "direct_transition": "Care Pathways", + "name": "Pyelonephritis", + "assign_to_attribute": "uti" }, - "UTI_CarePlan": { - "type": "CarePlanStart", - "reason": "uti", - "codes": [ - { - "system": "SNOMED-CT", - "code": "773593000", - "display": "Urology care plan (record artifact)" - } - ], - "activities": [ - { - "system": "SNOMED-CT", - "code": "223472008", - "display": "Discussion about hygiene" - }, - { - "system": "SNOMED-CT", - "code": "171245007", - "display": "Urine screening" - } - ], - "direct_transition": "End_Diagnosis_Encounter" - }, - "End_Diagnosis_Encounter": { - "type": "EncounterEnd", - "direct_transition": "Take_Antibiotics" - }, - "Take_Antibiotics": { + "Care Pathways": { + "type": "Simple", + "name": "Care Pathways", + "type_of_care_transition": { + "ambulatory": "Ambulatory", + "emergency": "ED", + "telemedicine": "Telemedicine" + } + }, + "Wait_for_UTI": { "type": "Delay", - "exact": { - "quantity": 7, - "unit": "days" - }, - "direct_transition": "End_First_Round_Of_Antibiotics" - }, - "End_First_Round_Of_Antibiotics": { - "type": "MedicationEnd", - "medication_order": "Prescribe_UTI_Antibiotic", - "distributed_transition": [ - { - "distribution": 0.15, - "transition": "Followup_Encounter" - }, - { - "distribution": 0.85, - "transition": "End_Urinary_Tract_Infection" - } - ] - }, - "Followup_Encounter": { - "type": "Encounter", - "encounter_class": "ambulatory", - "reason": "uti", - "telemedicine_possibility": "possible", - "codes": [ - { - "system": "SNOMED-CT", - "code": "185345009", - "display": "Encounter for symptom" - } - ], - "direct_transition": "Prescribe_Second_Round_Of_Antibiotics" - }, - "Prescribe_Second_Round_Of_Antibiotics": { - "type": "MedicationOrder", - "reason": "uti", - "remarks": [ - "This is a stronger antibiotic." - ], - "codes": [ - { - "system": "RxNorm", - "code": "311995", - "display": "NITROFURANTOIN, MACROCRYSTALS 50 MG Oral Capsule" + "distribution": { + "kind": "UNIFORM", + "parameters": { + "high": 12, + "low": 0 } - ], - "direct_transition": "End_Followup" - }, - "End_Followup": { - "type": "EncounterEnd", - "direct_transition": "Take_More_Antibiotics" - }, - "Take_More_Antibiotics": { - "type": "Delay", - "exact": { - "quantity": 7, - "unit": "days" }, - "direct_transition": "End_Second_Round_Of_Antibiotics" + "unit": "months", + "direct_transition": "Urinary Tract Infection", + "name": "Wait_for_UTI" }, - "End_Second_Round_Of_Antibiotics": { - "type": "MedicationEnd", - "medication_order": "Prescribe_Second_Round_Of_Antibiotics", - "direct_transition": "End_Urinary_Tract_Infection" - }, - "End_Urinary_Tract_Infection": { - "type": "ConditionEnd", - "referenced_by_attribute": "uti", - "direct_transition": "UTI_Symptom1_Ends" - }, - "UTI_Symptom1_Ends": { - "type": "Symptom", - "symptom": "Dysuria", - "exact": { - "quantity": 0 - }, - "direct_transition": "UTI_Symptom2_Ends" - }, - "UTI_Symptom2_Ends": { - "type": "Symptom", - "symptom": "Urgent Desire to Urinate", - "exact": { - "quantity": 0 - }, - "direct_transition": "UTI_Symptom3_Ends" - }, - "UTI_Symptom3_Ends": { - "type": "Symptom", - "symptom": "Frequent Urination", - "exact": { - "quantity": 0 - }, - "direct_transition": "UTI_Symptom4_Ends" - }, - "UTI_Symptom4_Ends": { - "type": "Symptom", - "symptom": "Discolored Urine", - "exact": { - "quantity": 0 - }, - "direct_transition": "UTI_Symptom5_Ends" - }, - "UTI_Symptom5_Ends": { - "type": "Symptom", - "symptom": "Odor of Urine", - "exact": { - "quantity": 0 - }, - "direct_transition": "UTI_Symptom6_Ends" - }, - "UTI_Symptom6_Ends": { - "type": "Symptom", - "symptom": "Pelvic Pain", - "exact": { - "quantity": 0 - }, - "direct_transition": "UTI_Symptom7_Ends" + "Telemedicine": { + "type": "Simple", + "direct_transition": "UTI Telemed Sub", + "name": "Telemedicine" }, - "UTI_Symptom7_Ends": { - "type": "Symptom", - "symptom": "Fever", - "exact": { - "quantity": 0 - }, - "direct_transition": "End_OTC_Painkiller" + "Ambulatory": { + "type": "Simple", + "direct_transition": "UTI Ambulatory Sub", + "name": "Ambulatory" }, - "End_OTC_Painkiller": { - "type": "MedicationEnd", - "medication_order": "Prescribe_OTC_Painkiller_For_UTIs", - "direct_transition": "End_UTI_CarePlan" + "ED": { + "type": "Simple", + "direct_transition": "UTI ED Sub", + "name": "ED" }, - "End_UTI_CarePlan": { - "type": "CarePlanEnd", - "careplan": "UTI_CarePlan", - "direct_transition": "Get_Additional_UTIs" + "UTI Telemed Sub": { + "type": "CallSubmodule", + "submodule": "UTI Telemed Submodule", + "direct_transition": "Time Delay", + "name": "UTI Telemed Sub" }, - "Get_Additional_UTIs": { + "UTI Ambulatory Sub": { "type": "Simple", - "distributed_transition": [ - { - "distribution": 0.2, - "transition": "Wait_For_Next_UTI", - "remarks": [ - "Nearly 20% of women who have one UTI have another " - ] - }, - { - "distribution": 0.048, - "transition": "Recurrent_Urinary_Tract_Infections", - "remarks": [ - "About 4.8% get recurring UTIs: ", - "0.8 * 0.3 * 0.2 = 0.048 " - ] - }, - { - "distribution": 0.752, - "transition": "Terminal" - } - ] + "direct_transition": "Time Delay", + "name": "UTI Ambulatory Sub" }, - "Recurrent_Urinary_Tract_Infections": { - "type": "ConditionOnset", - "target_encounter": "UTI_Diagnosis", - "codes": [ - { - "system": "SNOMED-CT", - "code": "197927001", - "display": "Recurrent urinary tract infection" - } - ], - "direct_transition": "Wait_For_Recurring_UTI" + "UTI ED Sub": { + "type": "Simple", + "direct_transition": "Time Delay", + "name": "UTI ED Sub" }, - "Wait_For_Recurring_UTI": { + "Time Delay": { "type": "Delay", - "range": { - "low": 3, - "high": 6, - "unit": "weeks" + "distribution": { + "kind": "UNIFORM", + "parameters": { + "high": 48, + "low": 0 + } }, - "direct_transition": "Urinary_Tract_Infection" - }, - "Terminal": { - "type": "Terminal" + "unit": "hours", + "direct_transition": "Terminal", + "name": "Time Delay" } }, - "gmf_version": 1 + "gmf_version": 2 } \ No newline at end of file diff --git a/src/main/resources/modules/uti/telemed_path.json b/src/main/resources/modules/uti/telemed_path.json new file mode 100644 index 0000000000..6ebc8b9ee9 --- /dev/null +++ b/src/main/resources/modules/uti/telemed_path.json @@ -0,0 +1,288 @@ +{ + "name": "UTI Telemed Submodule", + "remarks": [ + "A blank module" + ], + "states": { + "Initial": { + "type": "Initial", + "name": "Initial", + "distributed_transition": [ + { + "transition": "UTI_Diagnosis_Encounter", + "distribution": 0.7 + }, + { + "transition": "UTI_Diagnosis_Encounter_Audio_Only", + "distribution": 0.3 + } + ] + }, + "Terminal": { + "type": "Terminal", + "name": "Terminal" + }, + "UTI_Diagnosis_Encounter_Audio_Only": { + "type": "Encounter", + "encounter_class": "ambulatory", + "reason": "", + "telemedicine_possibility": "always", + "codes": [ + { + "system": "SNOMED-CT", + "code": 185317003, + "display": "Telephone encounter (procedure)", + "value_set": "" + } + ], + "direct_transition": "Telemed_Procedure", + "name": "UTI_Diagnosis_Encounter_Audio_Only" + }, + "UTI_Diagnosis_Encounter": { + "type": "Encounter", + "encounter_class": "ambulatory", + "reason": "", + "telemedicine_possibility": "always", + "codes": [ + { + "system": "SNOMED-CT", + "code": 453131000124105, + "display": "Videotelephony encounter (procedure)", + "value_set": "" + } + ], + "direct_transition": "Telemed_Procedure", + "name": "UTI_Diagnosis_Encounter" + }, + "Telemed_Procedure": { + "type": "Procedure", + "codes": [ + { + "system": "SNOMED-CT", + "code": 448337001, + "display": "Telemedicine consultation with patient (procedure)", + "value_set": "" + } + ], + "distribution": { + "kind": "UNIFORM", + "parameters": { + "high": 60, + "low": 30 + } + }, + "unit": "minutes", + "direct_transition": "UTI_HPI_Submodule", + "name": "Telemed_Procedure" + }, + "UTI_HPI_Submodule": { + "type": "Simple", + "name": "UTI_HPI_Submodule", + "complex_transition": [ + { + "condition": { + "condition_type": "Gender", + "gender": "F" + }, + "distributions": [ + { + "transition": "GU_Pregnancy_Check_Submodule", + "distribution": 0.7 + }, + { + "transition": "Risk_Check", + "distribution": 0.3 + } + ] + }, + { + "distributions": [], + "transition": "Risk_Check" + } + ] + }, + "GU_Pregnancy_Check_Submodule": { + "type": "Simple", + "direct_transition": "Risk_Check", + "name": "GU_Pregnancy_Check_Submodule" + }, + "Risk_Check": { + "type": "Simple", + "name": "Risk_Check", + "complex_transition": [ + { + "condition": { + "condition_type": "Attribute", + "attribute": "uti", + "operator": "==", + "value": "Pyelonephritis" + }, + "distributions": [], + "transition": "Evaluation" + }, + { + "condition": { + "condition_type": "Gender", + "gender": "M" + }, + "distributions": [ + { + "transition": "Referral_to_Ambulatory", + "distribution": 0.9 + }, + { + "transition": "Evaluation", + "distribution": 0.1 + } + ] + }, + { + "condition": { + "condition_type": "And", + "conditions": [ + { + "condition_type": "Attribute", + "attribute": "pregnancy", + "operator": "==", + "value": true + }, + { + "condition_type": "Attribute", + "attribute": "GU_Pregnancy_Check", + "operator": "is not nil" + } + ] + }, + "distributions": [ + { + "transition": "Referral_to_Ambulatory", + "distribution": 0.8 + }, + { + "transition": "Evaluation", + "distribution": 0.2 + } + ] + }, + { + "distributions": [], + "transition": "Evaluation" + } + ] + }, + "Referral_to_Ambulatory": { + "type": "Procedure", + "codes": [ + { + "system": "SNOMED-CT", + "code": 183444007, + "display": "Referral for further care (procedure)", + "value_set": "" + } + ], + "distribution": { + "kind": "EXACT", + "parameters": { + "value": 15 + } + }, + "unit": "minutes", + "direct_transition": "End_UTI_Diagnosis", + "name": "Referral_to_Ambulatory", + "assign_to_attribute": "UTI_Care_Referral" + }, + "Evaluation": { + "type": "Procedure", + "codes": [ + { + "system": "SNOMED-CT", + "code": 386053000, + "display": "Evaluation procedure (procedure)", + "value_set": "" + } + ], + "distribution": { + "kind": "UNIFORM", + "parameters": { + "high": 30, + "low": 15 + } + }, + "unit": "minutes", + "name": "Evaluation", + "distributed_transition": [ + { + "transition": "Referral_to_Labs", + "distribution": 0.1 + }, + { + "transition": "Antibiotics", + "distribution": 0.9 + } + ] + }, + "Referral_to_Labs": { + "type": "Procedure", + "codes": [ + { + "system": "SNOMED-CT", + "code": 266753000, + "display": "Referral for laboratory tests (procedure)", + "value_set": "" + } + ], + "distribution": { + "kind": "EXACT", + "parameters": { + "value": 15 + } + }, + "unit": "minutes", + "direct_transition": "End_UTI_Diagnosis", + "name": "Referral_to_Labs", + "assign_to_attribute": "UTI_Labs" + }, + "End_UTI_Diagnosis": { + "type": "EncounterEnd", + "direct_transition": "Terminal", + "name": "End_UTI_Diagnosis" + }, + "UTI_Abx_Submodule": { + "type": "Simple", + "name": "UTI_Abx_Submodule", + "distributed_transition": [ + { + "transition": "End_UTI_Diagnosis", + "distribution": 0.95 + }, + { + "transition": "Referral_to_Labs", + "distribution": 0.05 + } + ] + }, + "Antibiotics": { + "type": "Procedure", + "codes": [ + { + "system": "SNOMED-CT", + "code": 281789004, + "display": "Antibiotic therapy (procedure)", + "value_set": "" + } + ], + "distribution": { + "kind": "UNIFORM", + "parameters": { + "high": 60, + "low": 30 + } + }, + "unit": "minutes", + "direct_transition": "UTI_Abx_Submodule", + "name": "Antibiotics", + "assign_to_attribute": "UTI_Tx" + } + }, + "gmf_version": 2 +} \ No newline at end of file From 8d6f5f18b19626daa2d5b4dc1432fd5b14e98ed3 Mon Sep 17 00:00:00 2001 From: Andy Gregorowicz Date: Mon, 19 Dec 2022 16:44:12 -0500 Subject: [PATCH 57/78] More UTI update implementation --- .../modules/uti/ambulatory_eval.json | 93 +++++++ .../modules/uti/amublatory_path.json | 238 ++++++++++++++++++ src/main/resources/modules/uti/ed_path.json | 58 +++++ .../modules/uti/gu_pregnancy_check.json | 155 ++++++++++++ .../resources/modules/uti/telemed_path.json | 99 ++++---- 5 files changed, 595 insertions(+), 48 deletions(-) create mode 100644 src/main/resources/modules/uti/ambulatory_eval.json create mode 100644 src/main/resources/modules/uti/amublatory_path.json create mode 100644 src/main/resources/modules/uti/ed_path.json create mode 100644 src/main/resources/modules/uti/gu_pregnancy_check.json diff --git a/src/main/resources/modules/uti/ambulatory_eval.json b/src/main/resources/modules/uti/ambulatory_eval.json new file mode 100644 index 0000000000..cd26a75512 --- /dev/null +++ b/src/main/resources/modules/uti/ambulatory_eval.json @@ -0,0 +1,93 @@ +{ + "name": "UTI_Ambulatory_Eval", + "remarks": [ + "A blank module" + ], + "states": { + "Initial": { + "type": "Initial", + "name": "Initial", + "direct_transition": "Eval Procedure" + }, + "Terminal": { + "type": "Terminal", + "name": "Terminal" + }, + "Eval Procedure": { + "type": "Procedure", + "codes": [ + { + "system": "SNOMED-CT", + "code": 386053000, + "display": "Evaluation procedure (procedure)", + "value_set": "" + } + ], + "distribution": { + "kind": "EXACT", + "parameters": { + "value": 15 + } + }, + "unit": "minutes", + "name": "Eval Procedure", + "complex_transition": [ + { + "condition": { + "condition_type": "Gender", + "gender": "F" + }, + "distributions": [ + { + "transition": "UTI_Labs", + "distribution": 0.2 + }, + { + "transition": "GU_Pregnancy_Check", + "distribution": 0.8 + } + ] + } + ] + }, + "GU_Pregnancy_Check": { + "type": "CallSubmodule", + "submodule": "GU_Pregnancy_Check", + "direct_transition": "UTI_Labs", + "name": "GU_Pregnancy_Check" + }, + "UTI_Labs": { + "type": "CallSubmodule", + "submodule": "UTI_Labs", + "direct_transition": "Abx Therapy", + "name": "UTI_Labs" + }, + "Abx Therapy": { + "type": "Procedure", + "codes": [ + { + "system": "SNOMED-CT", + "code": 281789004, + "display": "Antibiotic therapy (procedure)", + "value_set": "" + } + ], + "distribution": { + "kind": "EXACT", + "parameters": { + "value": 10 + } + }, + "unit": "minutes", + "direct_transition": "UTI_Abx", + "name": "Abx Therapy" + }, + "UTI_Abx": { + "type": "CallSubmodule", + "submodule": "UTI_Abx", + "direct_transition": "Terminal", + "name": "UTI_Abx" + } + }, + "gmf_version": 2 +} \ No newline at end of file diff --git a/src/main/resources/modules/uti/amublatory_path.json b/src/main/resources/modules/uti/amublatory_path.json new file mode 100644 index 0000000000..f4f56c8798 --- /dev/null +++ b/src/main/resources/modules/uti/amublatory_path.json @@ -0,0 +1,238 @@ +{ + "name": "UTI_Ambulatory", + "remarks": [ + "A blank module" + ], + "states": { + "Initial": { + "type": "Initial", + "name": "Initial", + "direct_transition": "UTI Diagnosis" + }, + "Terminal": { + "type": "Terminal", + "name": "Terminal" + }, + "Evaluation": { + "type": "Procedure", + "codes": [ + { + "system": "SNOMED-CT", + "code": 183444007, + "display": "Referral for further care (procedure)", + "value_set": "" + } + ], + "distribution": { + "kind": "UNIFORM", + "parameters": { + "high": 30, + "low": 15 + } + }, + "unit": "minutes", + "name": "Evaluation", + "direct_transition": "End Ambulatory Encounter", + "assign_to_attribute": "UTI_Care_Referral" + }, + "Exam": { + "type": "Procedure", + "codes": [ + { + "system": "SNOMED-CT", + "code": 67879005, + "display": "History and physical examination, limited (procedure)", + "value_set": "" + } + ], + "distribution": { + "kind": "EXACT", + "parameters": { + "value": 15 + } + }, + "unit": "minutes", + "name": "Exam", + "direct_transition": "Risk Check" + }, + "UTI_Ambulatory_Eval": { + "type": "CallSubmodule", + "submodule": "UTI_Ambulatory_Eval", + "name": "UTI_Ambulatory_Eval", + "direct_transition": "End Ambulatory Encounter" + }, + "Risk Check": { + "type": "Simple", + "complex_transition": [ + { + "condition": { + "condition_type": "And", + "conditions": [ + { + "condition_type": "Attribute", + "attribute": "pregnancy", + "operator": "==", + "value": true + }, + { + "condition_type": "Attribute", + "attribute": "uti", + "operator": "==", + "value": "Pyelonephritis" + } + ] + }, + "distributions": [], + "transition": "Evaluation" + }, + { + "distributions": [ + { + "distribution": 0.1, + "transition": "Evaluation" + }, + { + "transition": "UTI_Ambulatory_Eval", + "distribution": 0.9 + } + ] + } + ], + "name": "Risk Check" + }, + "End Ambulatory Encounter": { + "type": "EncounterEnd", + "name": "End Ambulatory Encounter", + "conditional_transition": [ + { + "transition": "Delay 24 to 48 hours", + "condition": { + "condition_type": "Attribute", + "attribute": "UTI_Lab_SendOut", + "operator": "is not nil" + } + }, + { + "transition": "Delay 0 to 48 hours", + "condition": { + "condition_type": "Attribute", + "attribute": "UTI_Care_Referral", + "operator": "is not nil" + } + }, + { + "transition": "Terminal" + } + ] + }, + "Delay 24 to 48 hours": { + "type": "Delay", + "distribution": { + "kind": "UNIFORM", + "parameters": { + "high": 48, + "low": 24 + } + }, + "unit": "hours", + "direct_transition": "Telephone Encounter", + "name": "Delay 24 to 48 hours" + }, + "Delay 0 to 48 hours": { + "type": "Delay", + "distribution": { + "kind": "UNIFORM", + "parameters": { + "high": 48, + "low": 0 + } + }, + "unit": "hours", + "direct_transition": "Emergency Follow-up", + "name": "Delay 0 to 48 hours" + }, + "Telephone Encounter": { + "type": "Encounter", + "encounter_class": "virtual", + "reason": "", + "telemedicine_possibility": "always", + "codes": [ + { + "system": "SNOMED-CT", + "code": 185347001, + "display": "Encounter for problem (procedure)", + "value_set": "" + } + ], + "direct_transition": "UTI_Lab_FollowUp", + "name": "Telephone Encounter" + }, + "UTI_Lab_FollowUp": { + "type": "CallSubmodule", + "submodule": "UTI_Lab_FollowUp", + "direct_transition": "End Telephone Encounter", + "name": "UTI_Lab_FollowUp" + }, + "End Telephone Encounter": { + "type": "EncounterEnd", + "direct_transition": "Terminal", + "name": "End Telephone Encounter" + }, + "Emergency Follow-up": { + "type": "Encounter", + "encounter_class": "emergency", + "telemedicine_possibility": "none", + "codes": [ + { + "system": "SNOMED-CT", + "code": 185347001, + "display": "Encounter for problem (procedure)", + "value_set": "" + } + ], + "direct_transition": "Set UTI_ED", + "name": "Emergency Follow-up" + }, + "UTI_ED_Eval": { + "type": "CallSubmodule", + "submodule": "UTI_ED_Eval", + "direct_transition": "End ED Follow-up", + "name": "UTI_ED_Eval" + }, + "End ED Follow-up": { + "type": "EncounterEnd", + "direct_transition": "Terminal", + "name": "End ED Follow-up" + }, + "Set UTI_ED": { + "type": "SetAttribute", + "attribute": "UTI_ED", + "direct_transition": "UTI_ED_Eval", + "name": "Set UTI_ED", + "value": true + }, + "UTI Diagnosis": { + "type": "Encounter", + "encounter_class": "ambulatory", + "reason": "Select Condition/Enter Attribute", + "telemedicine_possibility": "none", + "codes": [ + { + "system": "SNOMED-CT", + "code": 185345009, + "display": "Encounter for symptom", + "value_set": "" + } + ], + "name": "UTI Diagnosis", + "direct_transition": "UTI_HPI" + }, + "UTI_HPI": { + "type": "CallSubmodule", + "submodule": "UTI_HPI", + "direct_transition": "Exam", + "name": "UTI_HPI" + } + }, + "gmf_version": 2 +} \ No newline at end of file diff --git a/src/main/resources/modules/uti/ed_path.json b/src/main/resources/modules/uti/ed_path.json new file mode 100644 index 0000000000..f566f84f53 --- /dev/null +++ b/src/main/resources/modules/uti/ed_path.json @@ -0,0 +1,58 @@ +{ + "name": "UTI_ED", + "remarks": [ + "A blank module" + ], + "states": { + "Initial": { + "type": "Initial", + "direct_transition": "UTI Diagnosis", + "name": "Initial" + }, + "Terminal": { + "type": "Terminal", + "name": "Terminal" + }, + "UTI Diagnosis": { + "type": "Encounter", + "encounter_class": "emergency", + "telemedicine_possibility": "none", + "codes": [ + { + "system": "SNOMED-CT", + "code": 185345009, + "display": "Encounter for symptom", + "value_set": "" + } + ], + "direct_transition": "Set_UTI_ED", + "name": "UTI Diagnosis", + "reason": "uti" + }, + "Set_UTI_ED": { + "type": "SetAttribute", + "attribute": "UTI_ED", + "name": "Set_UTI_ED", + "value": true, + "direct_transition": "UTI_HPI" + }, + "UTI_ED_Eval": { + "type": "CallSubmodule", + "submodule": "UTI_ED_Eval", + "name": "UTI_ED_Eval", + "direct_transition": "End_ED_Follow_up" + }, + "End_ED_Follow_up": { + "type": "EncounterEnd", + "name": "End_ED_Follow_up", + "direct_transition": "Terminal" + }, + "UTI_HPI": { + "type": "CallSubmodule", + "submodule": "UTI_HPI", + "name": "UTI_HPI", + "direct_transition": "UTI_ED_Eval" + } + }, + "gmf_version": 2 +} \ No newline at end of file diff --git a/src/main/resources/modules/uti/gu_pregnancy_check.json b/src/main/resources/modules/uti/gu_pregnancy_check.json new file mode 100644 index 0000000000..6de70ca573 --- /dev/null +++ b/src/main/resources/modules/uti/gu_pregnancy_check.json @@ -0,0 +1,155 @@ +{ + "name": "GU_Pregnancy_Check", + "remarks": [ + "A blank module" + ], + "states": { + "Initial": { + "type": "Initial", + "name": "Initial", + "complex_transition": [ + { + "condition": { + "condition_type": "Attribute", + "attribute": "UTI_Telemed", + "operator": "is not nil" + }, + "distributions": [], + "transition": "Discuss Pregnancy" + }, + { + "condition": { + "condition_type": "Attribute", + "attribute": "UTI_ED", + "operator": "is not nil" + }, + "distributions": [ + { + "transition": "Pregnancy Test", + "distribution": 0.76 + }, + { + "transition": "Discuss Pregnancy", + "distribution": 0.24 + } + ] + }, + { + "condition": { + "condition_type": "Attribute", + "attribute": "UTI_Ambulatory", + "operator": "is not nil" + }, + "distributions": [ + { + "transition": "Pregnancy Test", + "distribution": 0.4 + }, + { + "transition": "Discuss Pregnancy", + "distribution": 0.6 + } + ] + } + ] + }, + "Terminal": { + "type": "Terminal", + "name": "Terminal" + }, + "Pregnancy Test": { + "type": "Procedure", + "codes": [ + { + "system": "SNOMED-CT", + "code": 252160004, + "display": "Standard pregnancy test (procedure)", + "value_set": "" + } + ], + "distribution": { + "kind": "EXACT", + "parameters": { + "value": 15 + } + }, + "unit": "minutes", + "name": "Pregnancy Test", + "conditional_transition": [ + { + "transition": "Positive Result", + "condition": { + "condition_type": "Attribute", + "attribute": "pregnant", + "operator": "==", + "value": true + } + }, + { + "transition": "Negative Result" + } + ] + }, + "Discuss Pregnancy": { + "type": "Procedure", + "codes": [ + { + "system": "SNOMED-CT", + "code": 440546007, + "display": "Discussion about pregnancy (procedure)", + "value_set": "" + } + ], + "distribution": { + "kind": "EXACT", + "parameters": { + "value": 10 + } + }, + "unit": "minutes", + "direct_transition": "Terminal", + "name": "Discuss Pregnancy" + }, + "Negative Result": { + "type": "Observation", + "category": "procedure", + "unit": "", + "codes": [ + { + "system": "LOINC", + "code": "2106-3", + "display": "Choriogonadotropin (pregnancy test) [Presence] in Urine", + "value_set": "" + } + ], + "direct_transition": "Terminal", + "name": "Negative Result", + "value_code": { + "system": "LOINC", + "code": 260385009, + "display": "Negative" + } + }, + "Positive Result": { + "type": "Observation", + "category": "procedure", + "unit": "", + "codes": [ + { + "system": "LOINC", + "code": "2106-3", + "display": "Choriogonadotropin (pregnancy test) [Presence] in Urine", + "value_set": "" + } + ], + "name": "Positive Result", + "value_code": { + "system": "LOINC", + "code": 10828004, + "display": "Positive" + }, + "direct_transition": "Terminal" + } + }, + "gmf_version": 2 +} \ No newline at end of file diff --git a/src/main/resources/modules/uti/telemed_path.json b/src/main/resources/modules/uti/telemed_path.json index 6ebc8b9ee9..6cd6e6a973 100644 --- a/src/main/resources/modules/uti/telemed_path.json +++ b/src/main/resources/modules/uti/telemed_path.json @@ -1,5 +1,5 @@ { - "name": "UTI Telemed Submodule", + "name": "UTI_Telemed", "remarks": [ "A blank module" ], @@ -72,40 +72,9 @@ } }, "unit": "minutes", - "direct_transition": "UTI_HPI_Submodule", + "direct_transition": "UTI_HPI", "name": "Telemed_Procedure" }, - "UTI_HPI_Submodule": { - "type": "Simple", - "name": "UTI_HPI_Submodule", - "complex_transition": [ - { - "condition": { - "condition_type": "Gender", - "gender": "F" - }, - "distributions": [ - { - "transition": "GU_Pregnancy_Check_Submodule", - "distribution": 0.7 - }, - { - "transition": "Risk_Check", - "distribution": 0.3 - } - ] - }, - { - "distributions": [], - "transition": "Risk_Check" - } - ] - }, - "GU_Pregnancy_Check_Submodule": { - "type": "Simple", - "direct_transition": "Risk_Check", - "name": "GU_Pregnancy_Check_Submodule" - }, "Risk_Check": { "type": "Simple", "name": "Risk_Check", @@ -247,20 +216,6 @@ "direct_transition": "Terminal", "name": "End_UTI_Diagnosis" }, - "UTI_Abx_Submodule": { - "type": "Simple", - "name": "UTI_Abx_Submodule", - "distributed_transition": [ - { - "transition": "End_UTI_Diagnosis", - "distribution": 0.95 - }, - { - "transition": "Referral_to_Labs", - "distribution": 0.05 - } - ] - }, "Antibiotics": { "type": "Procedure", "codes": [ @@ -279,9 +234,57 @@ } }, "unit": "minutes", - "direct_transition": "UTI_Abx_Submodule", + "direct_transition": "UTI_Abx", "name": "Antibiotics", "assign_to_attribute": "UTI_Tx" + }, + "UTI_HPI": { + "type": "CallSubmodule", + "submodule": "UTI_HPI", + "complex_transition": [ + { + "condition": { + "condition_type": "Gender", + "gender": "F" + }, + "distributions": [ + { + "transition": "GU_Pregnancy_Check", + "distribution": 0.7 + }, + { + "transition": "Risk_Check", + "distribution": 0.3 + } + ] + }, + { + "distributions": [], + "transition": "Risk_Check" + } + ], + "name": "UTI_HPI" + }, + "GU_Pregnancy_Check": { + "type": "CallSubmodule", + "submodule": "GU_Pregnancy_Check", + "direct_transition": "Risk_Check", + "name": "GU_Pregnancy_Check" + }, + "UTI_Abx": { + "type": "CallSubmodule", + "submodule": "UTI_Abx", + "distributed_transition": [ + { + "transition": "End_UTI_Diagnosis", + "distribution": 0.95 + }, + { + "transition": "Referral_to_Labs", + "distribution": 0.05 + } + ], + "name": "UTI_Abx" } }, "gmf_version": 2 From 2b31cd0082bc259895a7c771a580b0ab3e507bd4 Mon Sep 17 00:00:00 2001 From: Andy Gregorowicz Date: Thu, 22 Dec 2022 16:25:26 -0500 Subject: [PATCH 58/78] WIP: more UTI update implementation --- src/main/resources/modules/uti/ed_eval.json | 154 ++++++++++++++++ src/main/resources/modules/uti/hpi.json | 189 ++++++++++++++++++++ 2 files changed, 343 insertions(+) create mode 100644 src/main/resources/modules/uti/ed_eval.json create mode 100644 src/main/resources/modules/uti/hpi.json diff --git a/src/main/resources/modules/uti/ed_eval.json b/src/main/resources/modules/uti/ed_eval.json new file mode 100644 index 0000000000..99c394a7aa --- /dev/null +++ b/src/main/resources/modules/uti/ed_eval.json @@ -0,0 +1,154 @@ +{ + "name": "UTI_ED_Eval", + "remarks": [ + "A blank module" + ], + "states": { + "Initial": { + "type": "Initial", + "direct_transition": "UTI_ED_Bundle", + "name": "Initial" + }, + "Terminal": { + "type": "Terminal", + "name": "Terminal" + }, + "UTI_ED_Bundle": { + "type": "CallSubmodule", + "submodule": "UTI_ ED_Bundle", + "name": "UTI_ED_Bundle", + "complex_transition": [ + { + "condition": { + "condition_type": "And", + "conditions": [ + { + "condition_type": "Attribute", + "attribute": "pregnant", + "operator": "==", + "value": true + }, + { + "condition_type": "Active Condition", + "codes": [ + { + "system": "SNOMED-CT", + "code": 45816000, + "display": "Pyelonephritis" + } + ] + } + ] + }, + "distributions": [], + "transition": "Hospital admission" + }, + { + "condition": { + "condition_type": "Attribute", + "attribute": "UTI_Positive_BldCx", + "operator": "is not nil" + }, + "distributions": [], + "transition": "Hospital admission" + }, + { + "condition": { + "condition_type": "Observation", + "codes": [ + { + "system": "LOINC", + "code": "75636-1", + "display": "Emergency severity index 3" + } + ], + "operator": "==", + "value": 0 + }, + "distributions": [ + { + "transition": "Hospital admission", + "distribution": 0.15 + }, + { + "transition": "Antibiotic therapy", + "distribution": 0.85 + } + ] + }, + { + "distributions": [], + "transition": "Antibiotic therapy" + } + ] + }, + "Antibiotic therapy": { + "type": "Procedure", + "codes": [ + { + "system": "SNOMED-CT", + "code": 281789004, + "display": "Antibiotic therapy (procedure)", + "value_set": "" + } + ], + "distribution": { + "kind": "EXACT", + "parameters": { + "value": 10 + } + }, + "unit": "minutes", + "direct_transition": "UTI_Abx", + "name": "Antibiotic therapy", + "assign_to_attribute": "UTI_Tx" + }, + "UTI_Abx": { + "type": "CallSubmodule", + "submodule": "UTI_Abx", + "direct_transition": "Patient discharge", + "name": "UTI_Abx" + }, + "Patient discharge": { + "type": "Procedure", + "codes": [ + { + "system": "SNOMED-CT", + "code": 58000006, + "display": "Patient discharge (procedure)", + "value_set": "" + } + ], + "distribution": { + "kind": "EXACT", + "parameters": { + "value": 10 + } + }, + "unit": "minutes", + "direct_transition": "Terminal", + "name": "Patient discharge" + }, + "Hospital admission": { + "type": "Procedure", + "codes": [ + { + "system": "SNOMED-CT", + "code": 32485007, + "display": "Hospital admission (procedure)", + "value_set": "" + } + ], + "distribution": { + "kind": "EXACT", + "parameters": { + "value": 10 + } + }, + "unit": "minutes", + "direct_transition": "Terminal", + "name": "Hospital admission" + } + }, + "gmf_version": 2 +} \ No newline at end of file diff --git a/src/main/resources/modules/uti/hpi.json b/src/main/resources/modules/uti/hpi.json new file mode 100644 index 0000000000..54232bdf7a --- /dev/null +++ b/src/main/resources/modules/uti/hpi.json @@ -0,0 +1,189 @@ +{ + "name": "UTI_HPI", + "remarks": [ + "UTI History of Present Illness" + ], + "states": { + "Initial": { + "type": "Initial", + "direct_transition": "History Taking", + "name": "Initial" + }, + "Terminal": { + "type": "Terminal", + "name": "Terminal" + }, + "History Taking": { + "type": "Procedure", + "codes": [ + { + "system": "SNOMED-CT", + "code": 84100007, + "display": "History taking (procedure)", + "value_set": "" + } + ], + "distribution": { + "kind": "UNIFORM", + "parameters": { + "high": 15, + "low": 5 + } + }, + "unit": "minutes", + "direct_transition": "Dysuria", + "name": "History Taking" + }, + "Dysuria": { + "type": "Symptom", + "symptom": "Dysuria", + "cause": "", + "probability": 1, + "distribution": { + "kind": "EXACT", + "parameters": { + "value": 0.5 + } + }, + "direct_transition": "Increased frequency of urination", + "name": "Dysuria" + }, + "Increased frequency of urination": { + "type": "Symptom", + "symptom": "Increased frequency of urination", + "cause": "", + "probability": 1, + "distribution": { + "kind": "EXACT", + "parameters": { + "value": 1 + } + }, + "direct_transition": "Urgent desire to urinate", + "name": "Increased frequency of urination" + }, + "Urgent desire to urinate": { + "type": "Symptom", + "symptom": "Urgent desire to urinate", + "cause": "", + "probability": 1, + "distribution": { + "kind": "EXACT", + "parameters": { + "value": 1 + } + }, + "direct_transition": "Suprapubic pain", + "name": "Urgent desire to urinate" + }, + "Suprapubic pain": { + "type": "Symptom", + "symptom": "Suprapubic pain", + "cause": "", + "probability": 1, + "distribution": { + "kind": "EXACT", + "parameters": { + "value": 1 + } + }, + "name": "Suprapubic pain", + "conditional_transition": [ + { + "transition": "Renal angle tenderness", + "condition": { + "condition_type": "Active Condition", + "codes": [ + { + "system": "SNOMED-CT", + "code": 45816000, + "display": "Pyelonephritis" + } + ] + } + }, + { + "transition": "Discussion about signs and symptoms" + } + ] + }, + "Discussion about signs and symptoms": { + "type": "Procedure", + "codes": [ + { + "system": "SNOMED-CT", + "code": 223470000, + "display": "Discussion about signs and symptoms (procedure)", + "value_set": "" + } + ], + "distribution": { + "kind": "UNIFORM", + "parameters": { + "high": 15, + "low": 5 + } + }, + "unit": "minutes", + "direct_transition": "Terminal", + "name": "Discussion about signs and symptoms" + }, + "Renal angle tenderness": { + "type": "Symptom", + "symptom": "Renal angle tenderness", + "cause": "", + "probability": 1, + "distribution": { + "kind": "EXACT", + "parameters": { + "value": 1 + } + }, + "direct_transition": "Flank pain", + "name": "Renal angle tenderness" + }, + "Flank pain": { + "type": "Symptom", + "symptom": "Flank pain", + "cause": "", + "probability": 1, + "distribution": { + "kind": "EXACT", + "parameters": { + "value": 1 + } + }, + "direct_transition": "Fever", + "name": "Flank pain" + }, + "Fever": { + "type": "Symptom", + "symptom": "", + "cause": "", + "probability": 1, + "distribution": { + "kind": "EXACT", + "parameters": { + "value": 1 + } + }, + "direct_transition": "Tendency to nausea and vomiting", + "name": "Fever" + }, + "Tendency to nausea and vomiting": { + "type": "Symptom", + "symptom": "Tendency to nausea and vomiting", + "cause": "", + "probability": 1, + "distribution": { + "kind": "EXACT", + "parameters": { + "value": 1 + } + }, + "direct_transition": "Discussion about signs and symptoms", + "name": "Tendency to nausea and vomiting" + } + }, + "gmf_version": 2 +} \ No newline at end of file From 8556891991e94cbb74a7e992b69302311db62323 Mon Sep 17 00:00:00 2001 From: Andy Gregorowicz Date: Fri, 20 Jan 2023 18:50:01 -0500 Subject: [PATCH 59/78] WIP: Adding labs to UTI module --- src/main/resources/modules/uti/ed_eval.json | 2 +- src/main/resources/modules/uti/labs.json | 775 ++++++++++++++++++++ 2 files changed, 776 insertions(+), 1 deletion(-) create mode 100644 src/main/resources/modules/uti/labs.json diff --git a/src/main/resources/modules/uti/ed_eval.json b/src/main/resources/modules/uti/ed_eval.json index 99c394a7aa..30225937c2 100644 --- a/src/main/resources/modules/uti/ed_eval.json +++ b/src/main/resources/modules/uti/ed_eval.json @@ -15,7 +15,7 @@ }, "UTI_ED_Bundle": { "type": "CallSubmodule", - "submodule": "UTI_ ED_Bundle", + "submodule": "UTI_ED_Bundle", "name": "UTI_ED_Bundle", "complex_transition": [ { diff --git a/src/main/resources/modules/uti/labs.json b/src/main/resources/modules/uti/labs.json new file mode 100644 index 0000000000..e16dd5ba65 --- /dev/null +++ b/src/main/resources/modules/uti/labs.json @@ -0,0 +1,775 @@ +{ + "name": "uti_labs", + "remarks": [ + "A blank module" + ], + "states": { + "Initial": { + "type": "Initial", + "direct_transition": "Collection", + "name": "Initial" + }, + "Terminal": { + "type": "Terminal", + "name": "Terminal" + }, + "Collection": { + "type": "Procedure", + "codes": [ + { + "system": "SNOMED-CT", + "code": 57617002, + "display": "Urine specimen collection (procedure)", + "value_set": "" + } + ], + "distribution": { + "kind": "EXACT", + "parameters": { + "value": 10 + } + }, + "unit": "minutes", + "name": "Collection", + "conditional_transition": [ + { + "transition": "Dipstick", + "condition": { + "condition_type": "Attribute", + "attribute": "UTI_ambulatory", + "operator": "is not nil" + } + }, + { + "transition": "Urinalysis Micro" + } + ] + }, + "Dipstick": { + "type": "Procedure", + "codes": [ + { + "system": "SNOMED-CT", + "code": 167226008, + "display": "Urine dipstick test (procedure)", + "value_set": "" + } + ], + "distribution": { + "kind": "EXACT", + "parameters": { + "value": 10 + } + }, + "unit": "minutes", + "direct_transition": "Record_Urinalysis", + "name": "Dipstick" + }, + "Record_Urinalysis": { + "type": "DiagnosticReport", + "codes": [ + { + "system": "LOINC", + "code": "24357-6", + "display": "Urinalysis macro (dipstick) panel - Urine", + "value_set": "" + } + ], + "observations": [ + { + "category": "laboratory", + "codes": [ + { + "system": "LOINC", + "code": "5792-7", + "display": "Glucose [Mass/volume] in Urine by Test strip" + } + ], + "unit": "mg/dL", + "range": { + "low": 0, + "high": 15 + } + }, + { + "category": "laboratory", + "unit": "{nominal}", + "codes": [ + { + "system": "LOINC", + "code": "2514-8", + "display": "Ketones [Presence] in Urine by Test strip" + } + ], + "value_code": { + "system": "SNOMED-CT", + "code": 167287002, + "display": "Urine ketone test negative (finding)" + } + }, + { + "category": "laboratory", + "unit": "{nominal}", + "codes": [ + { + "system": "LOINC", + "code": "5811-5", + "display": "Specific gravity of Urine by Test strip" + } + ], + "range": { + "low": 1.005, + "high": 1.03 + } + }, + { + "category": "laboratory", + "unit": "pH", + "codes": [ + { + "system": "LOINC", + "code": "5803-2", + "display": "pH of Urine by Test strip" + } + ], + "range": { + "low": 5, + "high": 7 + } + }, + { + "category": "laboratory", + "unit": "mg/dL", + "codes": [ + { + "system": "LOINC", + "code": "5804-0", + "display": "Protein [Mass/volume] in Urine by Test strip" + } + ], + "range": { + "low": 0, + "high": 14 + } + }, + { + "category": "laboratory", + "unit": "{nominal}", + "codes": [ + { + "system": "LOINC", + "code": "5802-4", + "display": "Nitrite [Presence] in Urine by Test strip" + } + ], + "value_code": { + "system": "SNOMED-CT", + "code": 314137006, + "display": "Urine nitrite positive (finding)" + } + }, + { + "category": "laboratory", + "unit": "{nominal}", + "codes": [ + { + "system": "LOINC", + "code": "5794-3", + "display": "Hemoglobin [Presence] in Urine by Test strip" + } + ], + "value_code": { + "system": "SNOMED-CT", + "code": 167300001, + "display": "Urine blood test = + (finding)" + } + }, + { + "category": "laboratory", + "unit": "{nominal}", + "codes": [ + { + "system": "LOINC", + "code": "5799-2", + "display": "Leukocyte esterase [Presence] in Urine by Test strip" + } + ], + "value_code": { + "system": "SNOMED-CT", + "code": 394712000, + "display": "Urine leukocyte test = + (finding)" + } + } + ], + "name": "Record_Urinalysis", + "complex_transition": [ + { + "condition": { + "condition_type": "Active Condition", + "codes": [ + { + "system": "SNOMED-CT", + "code": 45816000, + "display": "Pyelonephritis" + } + ] + }, + "distributions": [ + { + "transition": "Urine Culture", + "distribution": 0.95 + }, + { + "transition": "Terminal", + "distribution": 0.05 + } + ] + }, + { + "condition": { + "condition_type": "Active Condition", + "codes": [ + { + "system": "SNOMED-CT", + "code": 307426000, + "display": "Acute infective cystitis (disorder)" + } + ] + }, + "distributions": [ + { + "transition": "Urine Culture", + "distribution": 0.55 + }, + { + "transition": "Terminal", + "distribution": 0.44999999999999996 + } + ] + }, + { + "distributions": [], + "transition": "Terminal" + } + ] + }, + "Urinalysis Micro": { + "type": "Procedure", + "codes": [ + { + "system": "SNOMED-CT", + "code": 441550005, + "display": "Urinalysis with reflex to microscopy and culture (procedure)", + "value_set": "" + } + ], + "distribution": { + "kind": "EXACT", + "parameters": { + "value": 10 + } + }, + "unit": "minutes", + "direct_transition": "Record_Urinalysis_Micro", + "name": "Urinalysis Micro" + }, + "Record_Urinalysis_Micro": { + "type": "DiagnosticReport", + "codes": [ + { + "system": "LOINC", + "code": "24357-6", + "display": "Urinalysis macro (dipstick) panel - Urine", + "value_set": "" + } + ], + "observations": [ + { + "category": "laboratory", + "codes": [ + { + "system": "LOINC", + "code": "5792-7", + "display": "Glucose [Mass/volume] in Urine by Test strip" + } + ], + "unit": "mg/dL", + "range": { + "low": 0, + "high": 15 + } + }, + { + "category": "laboratory", + "unit": "{nominal}", + "codes": [ + { + "system": "LOINC", + "code": "2514-8", + "display": "Ketones [Presence] in Urine by Test strip" + } + ], + "value_code": { + "system": "SNOMED-CT", + "code": 167287002, + "display": "Urine ketone test negative (finding)" + } + }, + { + "category": "laboratory", + "unit": "{nominal}", + "codes": [ + { + "system": "LOINC", + "code": "5811-5", + "display": "Specific gravity of Urine by Test strip" + } + ], + "range": { + "low": 1.005, + "high": 1.03 + } + }, + { + "category": "laboratory", + "unit": "pH", + "codes": [ + { + "system": "LOINC", + "code": "5803-2", + "display": "pH of Urine by Test strip" + } + ], + "range": { + "low": 5, + "high": 7 + } + }, + { + "category": "laboratory", + "unit": "mg/dL", + "codes": [ + { + "system": "LOINC", + "code": "5804-0", + "display": "Protein [Mass/volume] in Urine by Test strip" + } + ], + "range": { + "low": 0, + "high": 14 + } + }, + { + "category": "laboratory", + "unit": "{nominal}", + "codes": [ + { + "system": "LOINC", + "code": "5802-4", + "display": "Nitrite [Presence] in Urine by Test strip" + } + ], + "value_code": { + "system": "SNOMED-CT", + "code": 314137006, + "display": "Urine nitrite positive (finding)" + } + }, + { + "category": "laboratory", + "unit": "{nominal}", + "codes": [ + { + "system": "LOINC", + "code": "5794-3", + "display": "Hemoglobin [Presence] in Urine by Test strip" + } + ], + "value_code": { + "system": "SNOMED-CT", + "code": 167300001, + "display": "Urine blood test = + (finding)" + } + }, + { + "category": "laboratory", + "unit": "{nominal}", + "codes": [ + { + "system": "LOINC", + "code": "5799-2", + "display": "Leukocyte esterase [Presence] in Urine by Test strip" + } + ], + "value_code": { + "system": "SNOMED-CT", + "code": 394712000, + "display": "Urine leukocyte test = + (finding)" + } + }, + { + "category": "laboratory", + "unit": "/[HPF]", + "codes": [ + { + "system": "LOINC", + "code": "5821-4", + "display": "WBCs" + } + ], + "range": { + "low": 11, + "high": 50 + } + }, + { + "category": "laboratory", + "unit": "/[HPF]", + "codes": [ + { + "system": "LOINC", + "code": "13945-1", + "display": "RBCs" + } + ], + "range": { + "low": 1, + "high": 3 + } + }, + { + "category": "laboratory", + "unit": "/[HPF]", + "codes": [ + { + "system": "LOINC", + "code": "5787-7", + "display": "Epithelial Cells" + } + ], + "range": { + "low": 0, + "high": 4 + } + }, + { + "category": "laboratory", + "unit": "{nominal}", + "codes": [ + { + "system": "LOINC", + "code": "24124-0", + "display": "Casts" + } + ], + "value_code": { + "system": "SNOMED-CT", + "code": 167336003, + "display": "Urine microscopy: no casts (finding)" + } + }, + { + "category": "laboratory", + "unit": "{nominal}", + "codes": [ + { + "system": "LOINC", + "code": "8247-9", + "display": "Mucus Threads" + } + ], + "value_code": { + "system": "SNOMED-CT", + "code": 276409005, + "display": "Mucus in urine (finding)" + } + }, + { + "category": "laboratory", + "unit": "{nominal}", + "codes": [ + { + "system": "LOINC", + "code": "5769-5", + "display": "Bacteria" + } + ], + "value_code": { + "system": "SNOMED-CT", + "code": 365691004, + "display": "Finding of presence of bacteria (finding)" + } + } + ], + "name": "Record_Urinalysis_Micro", + "direct_transition": "Urine Culture Result" + }, + "Urine Culture": { + "type": "Procedure", + "codes": [ + { + "system": "SNOMED-CT", + "code": 117010004, + "display": "Urine culture (procedure)", + "value_set": "" + } + ], + "distribution": { + "kind": "EXACT", + "parameters": { + "value": 10 + } + }, + "unit": "minutes", + "direct_transition": "Urine Culture Result", + "name": "Urine Culture" + }, + "Urine Culture Result": { + "type": "Simple", + "name": "Urine Culture Result", + "complex_transition": [ + { + "condition": { + "condition_type": "And", + "conditions": [ + { + "condition_type": "Attribute", + "attribute": "UTI_Ambulatory", + "operator": "is not nil" + }, + { + "condition_type": "Attribute", + "attribute": "UTI_Tx", + "operator": "is not nil" + } + ] + }, + "distributions": [ + { + "transition": "No Growth", + "distribution": 1 + } + ] + }, + { + "distributions": [ + { + "transition": "E Coli", + "distribution": 0.76 + }, + { + "transition": "Klebsiella", + "distribution": 0.09 + }, + { + "transition": "Enterococcus", + "distribution": 0.05 + }, + { + "transition": "Proteus", + "distribution": 0.04 + }, + { + "transition": "Pseudomonas", + "distribution": 0.02 + }, + { + "transition": "Klebsiella oxytoca", + "distribution": 0.01 + }, + { + "transition": "Citrobacter", + "distribution": 0.01 + }, + { + "transition": "Staphylococcus", + "distribution": 0.01 + } + ] + } + ] + }, + "E Coli": { + "type": "Observation", + "category": "laboratory", + "unit": "", + "codes": [ + { + "system": "LOINC", + "code": "630-4", + "display": "Bacteria identified in Urine by Culture", + "value_set": "" + } + ], + "direct_transition": "Terminal", + "name": "E Coli", + "value_code": { + "system": "SNOMED-CT", + "code": "1234", + "display": "Greater than 100,000 colony forming units per mL Escherichia coli" + } + }, + "Klebsiella": { + "type": "Observation", + "category": "laboratory", + "unit": "", + "codes": [ + { + "system": "LOINC", + "code": "630-4", + "display": "Bacteria identified in Urine by Culture", + "value_set": "" + } + ], + "direct_transition": "Terminal", + "name": "Klebsiella", + "value_code": { + "system": "SNOMED-CT", + "code": "1234", + "display": "Greater than 100,000 colony forming units per mL Klebsiella pneumoniae" + } + }, + "Enterococcus": { + "type": "Observation", + "category": "laboratory", + "unit": "", + "codes": [ + { + "system": "LOINC", + "code": "630-4", + "display": "Bacteria identified in Urine by Culture", + "value_set": "" + } + ], + "direct_transition": "Terminal", + "name": "Enterococcus", + "value_code": { + "system": "SNOMED-CT", + "code": "1234", + "display": "Greater than 100,000 colony forming units per mL Enterococcus faecalis" + } + }, + "Proteus": { + "type": "Observation", + "category": "laboratory", + "unit": "", + "codes": [ + { + "system": "LOINC", + "code": "630-4", + "display": "Bacteria identified in Urine by Culture", + "value_set": "" + } + ], + "direct_transition": "Terminal", + "name": "Proteus", + "value_code": { + "system": "SNOMED-CT", + "code": "1234", + "display": "Greater than 100,000 colony forming units per mL Proteus mirabilis" + } + }, + "Pseudomonas": { + "type": "Observation", + "category": "laboratory", + "unit": "", + "codes": [ + { + "system": "LOINC", + "code": "630-4", + "display": "Bacteria identified in Urine by Culture", + "value_set": "" + } + ], + "direct_transition": "Terminal", + "name": "Pseudomonas", + "value_code": { + "system": "SNOMED-CT", + "code": "1234", + "display": "Greater than 100,000 colony forming units per mL Pseudomonas aeruginosa" + } + }, + "Klebsiella oxytoca": { + "type": "Observation", + "category": "laboratory", + "unit": "", + "codes": [ + { + "system": "LOINC", + "code": "630-4", + "display": "Bacteria identified in Urine by Culture", + "value_set": "" + } + ], + "direct_transition": "Terminal", + "name": "Klebsiella oxytoca", + "value_code": { + "system": "SNOMED-CT", + "code": "1234", + "display": "Greater than 100,000 colony forming units per mL Klebsiella oxytoca" + } + }, + "Citrobacter": { + "type": "Observation", + "category": "laboratory", + "unit": "", + "codes": [ + { + "system": "LOINC", + "code": "630-4", + "display": "Bacteria identified in Urine by Culture", + "value_set": "" + } + ], + "direct_transition": "Terminal", + "name": "Citrobacter", + "value_code": { + "system": "SNOMED-CT", + "code": "1234", + "display": "Greater than 100,000 colony forming units per mL Citrobacter freundii complex" + } + }, + "Staphylococcus": { + "type": "Observation", + "category": "laboratory", + "unit": "", + "codes": [ + { + "system": "LOINC", + "code": "630-4", + "display": "Bacteria identified in Urine by Culture", + "value_set": "" + } + ], + "direct_transition": "Terminal", + "name": "Staphylococcus", + "value_code": { + "system": "SNOMED-CT", + "code": "1234", + "display": "Greater than 100,000 colony forming units per mL Staphylococcus aureus" + } + }, + "No Growth": { + "type": "Observation", + "category": "laboratory", + "unit": "", + "codes": [ + { + "system": "LOINC", + "code": "630-4", + "display": "Bacteria identified in Urine by Culture", + "value_set": "" + } + ], + "direct_transition": "Terminal", + "name": "No Growth", + "value_code": { + "system": "SNOMED-CT", + "code": 264868006, + "display": "No growth (qualifier value)" + } + } + }, + "gmf_version": 2 +} \ No newline at end of file From 0593f6d150d57bbf5586f530f8875fff862fc9ae Mon Sep 17 00:00:00 2001 From: Andy Gregorowicz Date: Wed, 25 Jan 2023 10:04:30 -0500 Subject: [PATCH 60/78] WIP: UTI lab follow up added --- .../resources/modules/uti/lab_follow_up.json | 171 ++++++++++++++++++ 1 file changed, 171 insertions(+) create mode 100644 src/main/resources/modules/uti/lab_follow_up.json diff --git a/src/main/resources/modules/uti/lab_follow_up.json b/src/main/resources/modules/uti/lab_follow_up.json new file mode 100644 index 0000000000..877f90a161 --- /dev/null +++ b/src/main/resources/modules/uti/lab_follow_up.json @@ -0,0 +1,171 @@ +{ + "name": "UTI_Lab_Follow_Up", + "remarks": [ + "A blank module" + ], + "states": { + "Initial": { + "type": "Initial", + "direct_transition": "Inform Patient", + "name": "Initial" + }, + "Terminal": { + "type": "Terminal", + "name": "Terminal" + }, + "Inform Patient": { + "type": "Procedure", + "codes": [ + { + "system": "SNOMED-CT", + "code": 165355002, + "display": "Patient informed - test result (situation)", + "value_set": "" + } + ], + "distribution": { + "kind": "EXACT", + "parameters": { + "value": 5 + } + }, + "unit": "minutes", + "direct_transition": "Lab Finding Education", + "name": "Inform Patient" + }, + "Lab Finding Education": { + "type": "Procedure", + "codes": [ + { + "system": "SNOMED-CT", + "code": 410299006, + "display": "Lab findings education, guidance, and counseling (procedure)", + "value_set": "" + } + ], + "distribution": { + "kind": "EXACT", + "parameters": { + "value": 5 + } + }, + "unit": "minutes", + "direct_transition": "Discussion", + "name": "Lab Finding Education" + }, + "Discussion": { + "type": "Procedure", + "codes": [ + { + "system": "SNOMED-CT", + "code": 223484005, + "display": "Discussion about treatment (procedure)", + "value_set": "" + } + ], + "distribution": { + "kind": "EXACT", + "parameters": { + "value": 5 + } + }, + "unit": "minutes", + "name": "Discussion", + "conditional_transition": [ + { + "transition": "Evaluate Abx Response", + "condition": { + "condition_type": "Attribute", + "attribute": "UTI_Tx", + "operator": "is not nil" + } + }, + { + "transition": "Prescribe Abx" + } + ] + }, + "Prescribe Abx": { + "type": "Procedure", + "codes": [ + { + "system": "SNOMED-CT", + "code": 33633005, + "display": "Prescription of drug (procedure)", + "value_set": "" + } + ], + "distribution": { + "kind": "EXACT", + "parameters": { + "value": 5 + } + }, + "unit": "minutes", + "direct_transition": "UTI Abx Tx Sub", + "name": "Prescribe Abx" + }, + "UTI Abx Tx Sub": { + "type": "CallSubmodule", + "submodule": "UTI_Abx_Tx", + "direct_transition": "Terminal", + "name": "UTI Abx Tx Sub" + }, + "Evaluate Abx Response": { + "type": "Procedure", + "codes": [ + { + "system": "SNOMED-CT", + "code": 225953001, + "display": "Evaluating response to treatment (procedure)", + "value_set": "" + } + ], + "distribution": { + "kind": "EXACT", + "parameters": { + "value": 5 + } + }, + "unit": "minutes", + "name": "Evaluate Abx Response", + "distributed_transition": [ + { + "transition": "Stop UTI Abx", + "distribution": 0.14 + }, + { + "transition": "Terminal", + "distribution": 0.8599999999999999 + } + ] + }, + "Stop UTI Abx": { + "type": "MedicationEnd", + "direct_transition": "Change Treatment", + "name": "Stop UTI Abx", + "referenced_by_attribute": "UTI_Tx" + }, + "Change Treatment": { + "type": "Procedure", + "codes": [ + { + "system": "SNOMED-CT", + "code": 445528004, + "display": "Treatment changed (situation)", + "value_set": "" + } + ], + "distribution": { + "kind": "EXACT", + "parameters": { + "value": 5 + } + }, + "unit": "minutes", + "direct_transition": "UTI Abx Tx Sub", + "name": "Change Treatment" + } + }, + "gmf_version": 2 +} \ No newline at end of file From 4b3fa86a4d7d4608c022dc59128f50d9b4209ecc Mon Sep 17 00:00:00 2001 From: Andy Gregorowicz Date: Wed, 25 Jan 2023 10:40:05 -0500 Subject: [PATCH 61/78] WIP: Updating UTI lab bacteria to be set via attribute --- src/main/resources/modules/uti/labs.json | 170 ++++++----------------- 1 file changed, 41 insertions(+), 129 deletions(-) diff --git a/src/main/resources/modules/uti/labs.json b/src/main/resources/modules/uti/labs.json index e16dd5ba65..70c32711c3 100644 --- a/src/main/resources/modules/uti/labs.json +++ b/src/main/resources/modules/uti/labs.json @@ -591,146 +591,62 @@ ] }, "E Coli": { - "type": "Observation", - "category": "laboratory", - "unit": "", - "codes": [ - { - "system": "LOINC", - "code": "630-4", - "display": "Bacteria identified in Urine by Culture", - "value_set": "" - } - ], - "direct_transition": "Terminal", + "type": "SetAttribute", + "attribute": "UTI_Bacteria", + "direct_transition": "Observe Bacteria", "name": "E Coli", - "value_code": { - "system": "SNOMED-CT", - "code": "1234", - "display": "Greater than 100,000 colony forming units per mL Escherichia coli" - } + "value": "Greater than 100,000 colony forming units per mL Escherichia coli" }, "Klebsiella": { - "type": "Observation", - "category": "laboratory", - "unit": "", - "codes": [ - { - "system": "LOINC", - "code": "630-4", - "display": "Bacteria identified in Urine by Culture", - "value_set": "" - } - ], - "direct_transition": "Terminal", + "type": "SetAttribute", + "attribute": "UTI_Bacteria", + "direct_transition": "Observe Bacteria", "name": "Klebsiella", - "value_code": { - "system": "SNOMED-CT", - "code": "1234", - "display": "Greater than 100,000 colony forming units per mL Klebsiella pneumoniae" - } + "value": "Greater than 100,000 colony forming units per mL Klebsiella pneumoniae" }, "Enterococcus": { - "type": "Observation", - "category": "laboratory", - "unit": "", - "codes": [ - { - "system": "LOINC", - "code": "630-4", - "display": "Bacteria identified in Urine by Culture", - "value_set": "" - } - ], - "direct_transition": "Terminal", + "type": "SetAttribute", + "attribute": "UTI_Bacteria", + "direct_transition": "Observe Bacteria", "name": "Enterococcus", - "value_code": { - "system": "SNOMED-CT", - "code": "1234", - "display": "Greater than 100,000 colony forming units per mL Enterococcus faecalis" - } + "value": "Greater than 100,000 colony forming units per mL Enterococcus faecalis" }, "Proteus": { - "type": "Observation", - "category": "laboratory", - "unit": "", - "codes": [ - { - "system": "LOINC", - "code": "630-4", - "display": "Bacteria identified in Urine by Culture", - "value_set": "" - } - ], - "direct_transition": "Terminal", + "type": "SetAttribute", + "attribute": "UTI_Bacteria", + "direct_transition": "Observe Bacteria", "name": "Proteus", - "value_code": { - "system": "SNOMED-CT", - "code": "1234", - "display": "Greater than 100,000 colony forming units per mL Proteus mirabilis" - } + "value": "Greater than 100,000 colony forming units per mL Proteus mirabilis" }, "Pseudomonas": { - "type": "Observation", - "category": "laboratory", - "unit": "", - "codes": [ - { - "system": "LOINC", - "code": "630-4", - "display": "Bacteria identified in Urine by Culture", - "value_set": "" - } - ], - "direct_transition": "Terminal", + "type": "SetAttribute", + "attribute": "UTI_Bacteria", + "direct_transition": "Observe Bacteria", "name": "Pseudomonas", - "value_code": { - "system": "SNOMED-CT", - "code": "1234", - "display": "Greater than 100,000 colony forming units per mL Pseudomonas aeruginosa" - } + "value": "Greater than 100,000 colony forming units per mL Pseudomonas aeruginosa" }, "Klebsiella oxytoca": { - "type": "Observation", - "category": "laboratory", - "unit": "", - "codes": [ - { - "system": "LOINC", - "code": "630-4", - "display": "Bacteria identified in Urine by Culture", - "value_set": "" - } - ], - "direct_transition": "Terminal", + "type": "SetAttribute", + "attribute": "UTI_Bacteria", + "direct_transition": "Observe Bacteria", "name": "Klebsiella oxytoca", - "value_code": { - "system": "SNOMED-CT", - "code": "1234", - "display": "Greater than 100,000 colony forming units per mL Klebsiella oxytoca" - } + "value": "Greater than 100,000 colony forming units per mL Klebsiella oxytoca" }, "Citrobacter": { - "type": "Observation", - "category": "laboratory", - "unit": "", - "codes": [ - { - "system": "LOINC", - "code": "630-4", - "display": "Bacteria identified in Urine by Culture", - "value_set": "" - } - ], - "direct_transition": "Terminal", + "type": "SetAttribute", + "attribute": "UTI_Bacteria", + "direct_transition": "Observe Bacteria", "name": "Citrobacter", - "value_code": { - "system": "SNOMED-CT", - "code": "1234", - "display": "Greater than 100,000 colony forming units per mL Citrobacter freundii complex" - } + "value": "Greater than 100,000 colony forming units per mL Citrobacter freundii complex" }, "Staphylococcus": { + "type": "SetAttribute", + "attribute": "UTI_Bacteria", + "direct_transition": "Observe Bacteria", + "name": "Staphylococcus", + "value": "Greater than 100,000 colony forming units per mL Staphylococcus aureus" + }, + "No Growth": { "type": "Observation", "category": "laboratory", "unit": "", @@ -743,14 +659,14 @@ } ], "direct_transition": "Terminal", - "name": "Staphylococcus", + "name": "No Growth", "value_code": { "system": "SNOMED-CT", - "code": "1234", - "display": "Greater than 100,000 colony forming units per mL Staphylococcus aureus" + "code": 264868006, + "display": "No growth (qualifier value)" } }, - "No Growth": { + "Observe Bacteria": { "type": "Observation", "category": "laboratory", "unit": "", @@ -763,12 +679,8 @@ } ], "direct_transition": "Terminal", - "name": "No Growth", - "value_code": { - "system": "SNOMED-CT", - "code": 264868006, - "display": "No growth (qualifier value)" - } + "name": "Observe Bacteria", + "attribute": "UTI_Bacteria" } }, "gmf_version": 2 From 1670ceb3242abbaf4f5a597373229bd367f6f732 Mon Sep 17 00:00:00 2001 From: Andy Gregorowicz Date: Thu, 9 Feb 2023 13:34:39 -0500 Subject: [PATCH 62/78] WIP: Finished UTI ED Bundle submodule --- src/main/resources/modules/uti/ed_bundle.json | 2316 +++++++++++++++++ src/main/resources/modules/uti/labs.json | 2052 ++++++++++++--- 2 files changed, 3963 insertions(+), 405 deletions(-) create mode 100644 src/main/resources/modules/uti/ed_bundle.json diff --git a/src/main/resources/modules/uti/ed_bundle.json b/src/main/resources/modules/uti/ed_bundle.json new file mode 100644 index 0000000000..8062225791 --- /dev/null +++ b/src/main/resources/modules/uti/ed_bundle.json @@ -0,0 +1,2316 @@ +{ + "name": "ED_UTI_Bundle", + "remarks": [ + "A blank module" + ], + "states": { + "Initial": { + "type": "Initial", + "direct_transition": "Triage", + "name": "Initial" + }, + "Terminal": { + "type": "Terminal", + "name": "Terminal" + }, + "Triage": { + "type": "Procedure", + "codes": [ + { + "system": "SNOMED-CT", + "code": 386478007, + "display": "Triage emergency center (procedure)", + "value_set": "" + } + ], + "distribution": { + "kind": "EXACT", + "parameters": { + "value": 15 + } + }, + "unit": "minutes", + "direct_transition": "Vitals", + "name": "Triage" + }, + "Vitals": { + "type": "Procedure", + "codes": [ + { + "system": "SNOMED-CT", + "code": 61746007, + "display": "Taking patient vital signs (procedure)", + "value_set": "" + } + ], + "distribution": { + "kind": "EXACT", + "parameters": { + "value": 5 + } + }, + "unit": "minutes", + "name": "Vitals", + "conditional_transition": [ + { + "transition": "Pyelo", + "condition": { + "condition_type": "Active Condition", + "codes": [ + { + "system": "SNOMED-CT", + "code": 45816000, + "display": "Pyelonephritis" + } + ] + } + }, + { + "transition": "Cystitis", + "condition": { + "condition_type": "Active Condition", + "codes": [ + { + "system": "SNOMED-CT", + "code": 307426000, + "display": "Acute infective cystitis (disorder)" + } + ] + } + } + ] + }, + "Cystitis": { + "type": "Simple", + "name": "Cystitis", + "distributed_transition": [ + { + "transition": "ESI-3", + "distribution": 0.2 + }, + { + "transition": "ESI-4", + "distribution": 0.7 + }, + { + "transition": "ESI-5", + "distribution": 0.1 + } + ] + }, + "Pyelo": { + "type": "Simple", + "name": "Pyelo", + "complex_transition": [ + { + "condition": { + "condition_type": "Or", + "conditions": [ + { + "condition_type": "Attribute", + "attribute": "ckd", + "operator": ">=", + "value": 1 + }, + { + "condition_type": "Attribute", + "attribute": "diabetes", + "operator": "==", + "value": true + } + ] + }, + "distributions": [ + { + "transition": "ESI-1", + "distribution": 0.007 + }, + { + "transition": "ESI-2", + "distribution": 0.062 + }, + { + "transition": "ESI-3", + "distribution": 0.931 + } + ] + }, + { + "distributions": [ + { + "transition": "ESI-1", + "distribution": 0.006 + }, + { + "transition": "ESI-2", + "distribution": 0.054 + }, + { + "transition": "ESI-3", + "distribution": 0.8 + }, + { + "transition": "ESI-4", + "distribution": 0.1 + } + ] + } + ] + }, + "ESI-1": { + "type": "Observation", + "category": "exam", + "unit": "", + "codes": [ + { + "system": "LOINC", + "code": "75636-1", + "display": "Emergency severity index", + "value_set": "" + } + ], + "direct_transition": "ESI_State 1", + "name": "ESI-1", + "value_code": { + "system": "LOINC", + "code": "LA21567-5", + "display": "Requires immediate life-saving intervention" + } + }, + "ESI-2": { + "type": "Observation", + "category": "exam", + "unit": "", + "codes": [ + { + "system": "LOINC", + "code": "75636-1", + "display": "Emergency severity index", + "value_set": "" + } + ], + "name": "ESI-2", + "value_code": { + "system": "LOINC", + "code": "LA21752-3", + "display": "High risk or confused/lethargic/disoriented or severe pain/distress" + }, + "direct_transition": "ESI_State 2" + }, + "ESI-3": { + "type": "Observation", + "category": "exam", + "unit": "", + "codes": [ + { + "system": "LOINC", + "code": "75636-1", + "display": "Emergency severity index", + "value_set": "" + } + ], + "name": "ESI-3", + "value_code": { + "system": "LOINC", + "code": "LA21753-1", + "display": "Needs 2 or more resources" + }, + "direct_transition": "ESI_State 3" + }, + "ESI-4": { + "type": "Observation", + "category": "exam", + "unit": "", + "codes": [ + { + "system": "LOINC", + "code": "75636-1", + "display": "Emergency severity index", + "value_set": "" + } + ], + "name": "ESI-4", + "value_code": { + "system": "LOINC", + "code": "LA21754-9", + "display": "Needs 1 resource" + }, + "direct_transition": "ESI_State 4" + }, + "ESI-5": { + "type": "Observation", + "category": "exam", + "unit": "", + "codes": [ + { + "system": "LOINC", + "code": "75636-1", + "display": "Emergency severity index", + "value_set": "" + } + ], + "name": "ESI-5", + "value_code": { + "system": "LOINC", + "code": "LA21755-6", + "display": "Needs no resources" + }, + "direct_transition": "ESI State 5" + }, + "Record_BP_4_5": { + "type": "MultiObservation", + "category": "vital-signs", + "codes": [ + { + "system": "LOINC", + "code": "85354-9", + "display": "Blood Pressure", + "value_set": "" + } + ], + "observations": [ + { + "category": "vital-signs", + "codes": [ + { + "system": "LOINC", + "code": "8480-6", + "display": "Systolic Blood Pressure" + } + ], + "unit": "mm[Hg]", + "range": { + "low": 110, + "high": 160 + } + }, + { + "category": "vital-signs", + "codes": [ + { + "system": "LOINC", + "code": "8462-4", + "display": "Diastolic Blood Pressure" + } + ], + "unit": "mm[Hg]", + "range": { + "low": 60, + "high": 100 + } + } + ], + "name": "Record_BP_4_5", + "direct_transition": "Record_Heart_Rate_4_5" + }, + "Record_BP_3": { + "type": "MultiObservation", + "category": "vital-signs", + "codes": [ + { + "system": "LOINC", + "code": "85354-9", + "display": "Blood Pressure", + "value_set": "" + } + ], + "observations": [ + { + "category": "vital-signs", + "codes": [ + { + "system": "LOINC", + "code": "8480-6", + "display": "Systolic Blood Pressure" + } + ], + "unit": "mm[Hg]", + "range": { + "low": 110, + "high": 180 + } + }, + { + "category": "vital-signs", + "codes": [ + { + "system": "LOINC", + "code": "8462-4", + "display": "Diastolic Blood Pressure" + } + ], + "unit": "mm[Hg]", + "range": { + "low": 60, + "high": 110 + } + } + ], + "name": "Record_BP_3", + "direct_transition": "Record_Heart_Rate_3" + }, + "Record_Heart_Rate_4_5": { + "type": "Observation", + "category": "vital-signs", + "unit": "/min", + "codes": [ + { + "system": "LOINC", + "code": "8867-4", + "display": "Heart rate", + "value_set": "" + } + ], + "name": "Record_Heart_Rate_4_5", + "direct_transition": "Record_Respiratory_Rate_4_5", + "range": { + "low": 60, + "high": 99 + } + }, + "Record_Respiratory_Rate_4_5": { + "type": "Observation", + "category": "vital-signs", + "unit": "/min", + "codes": [ + { + "system": "LOINC", + "code": "9279-1", + "display": "Respiratory rate", + "value_set": "" + } + ], + "name": "Record_Respiratory_Rate_4_5", + "direct_transition": "O2_4_5", + "range": { + "low": 12, + "high": 20 + } + }, + "O2_4_5": { + "type": "Observation", + "category": "vital-signs", + "unit": "%", + "codes": [ + { + "system": "LOINC", + "code": "2708-6", + "display": "Oxygen saturation in Arterial blood", + "value_set": "" + } + ], + "distribution": { + "kind": "UNIFORM", + "round": false, + "parameters": { + "high": 100, + "low": 99 + } + }, + "direct_transition": "Take_Temperature_4_5", + "name": "O2_4_5" + }, + "Record_Heart_Rate_3": { + "type": "Observation", + "category": "vital-signs", + "unit": "/min", + "codes": [ + { + "system": "LOINC", + "code": "8867-4", + "display": "Heart rate", + "value_set": "" + } + ], + "name": "Record_Heart_Rate_3", + "range": { + "low": 60, + "high": 99 + }, + "direct_transition": "Record_Respiratory_Rate_3" + }, + "Record_Respiratory_Rate_3": { + "type": "Observation", + "category": "vital-signs", + "unit": "/min", + "codes": [ + { + "system": "LOINC", + "code": "9279-1", + "display": "Respiratory rate", + "value_set": "" + } + ], + "name": "Record_Respiratory_Rate_3", + "range": { + "low": 12, + "high": 20 + }, + "direct_transition": "O2_3" + }, + "O2_3": { + "type": "Observation", + "category": "vital-signs", + "unit": "%", + "codes": [ + { + "system": "LOINC", + "code": "2708-6", + "display": "Oxygen saturation in Arterial blood", + "value_set": "" + } + ], + "distribution": { + "kind": "UNIFORM", + "round": false, + "parameters": { + "high": 100, + "low": 97 + } + }, + "name": "O2_3", + "direct_transition": "Take_Temperature_3" + }, + "History and Physical Exam": { + "type": "Procedure", + "codes": [ + { + "system": "SNOMED-CT", + "code": 14736009, + "display": "History and physical examination with evaluation and management of patient (procedure)", + "value_set": "" + } + ], + "distribution": { + "kind": "UNIFORM", + "parameters": { + "high": 60, + "low": 30 + } + }, + "unit": "minutes", + "direct_transition": "Check CBC", + "name": "History and Physical Exam" + }, + "Record_BP_2": { + "type": "MultiObservation", + "category": "vital-signs", + "codes": [ + { + "system": "LOINC", + "code": "85354-9", + "display": "Blood Pressure", + "value_set": "" + } + ], + "observations": [ + { + "category": "vital-signs", + "codes": [ + { + "system": "LOINC", + "code": "8480-6", + "display": "Systolic Blood Pressure" + } + ], + "unit": "mm[Hg]", + "range": { + "low": 90, + "high": 110 + } + }, + { + "category": "vital-signs", + "codes": [ + { + "system": "LOINC", + "code": "8462-4", + "display": "Diastolic Blood Pressure" + } + ], + "unit": "mm[Hg]", + "range": { + "low": 40, + "high": 60 + } + } + ], + "name": "Record_BP_2", + "direct_transition": "Record_Heart_Rate_2" + }, + "Record_Heart_Rate_2": { + "type": "Observation", + "category": "vital-signs", + "unit": "/min", + "codes": [ + { + "system": "LOINC", + "code": "8867-4", + "display": "Heart rate", + "value_set": "" + } + ], + "name": "Record_Heart_Rate_2", + "range": { + "low": 80, + "high": 130 + }, + "direct_transition": "Record_Respiratory_Rate_2" + }, + "Record_Respiratory_Rate_2": { + "type": "Observation", + "category": "vital-signs", + "unit": "/min", + "codes": [ + { + "system": "LOINC", + "code": "9279-1", + "display": "Respiratory rate", + "value_set": "" + } + ], + "name": "Record_Respiratory_Rate_2", + "range": { + "low": 21, + "high": 25 + }, + "direct_transition": "O2_2" + }, + "O2_2": { + "type": "Observation", + "category": "vital-signs", + "unit": "%", + "codes": [ + { + "system": "LOINC", + "code": "2708-6", + "display": "Oxygen saturation in Arterial blood", + "value_set": "" + } + ], + "distribution": { + "kind": "UNIFORM", + "round": false, + "parameters": { + "high": 94, + "low": 89 + } + }, + "name": "O2_2", + "direct_transition": "Take_Temperature_2" + }, + "Record_BP_1": { + "type": "MultiObservation", + "category": "vital-signs", + "codes": [ + { + "system": "LOINC", + "code": "85354-9", + "display": "Blood Pressure", + "value_set": "" + } + ], + "observations": [ + { + "category": "vital-signs", + "codes": [ + { + "system": "LOINC", + "code": "8480-6", + "display": "Systolic Blood Pressure" + } + ], + "unit": "mm[Hg]", + "range": { + "low": 60, + "high": 85 + } + }, + { + "category": "vital-signs", + "codes": [ + { + "system": "LOINC", + "code": "8462-4", + "display": "Diastolic Blood Pressure" + } + ], + "unit": "mm[Hg]", + "range": { + "low": 20, + "high": 40 + } + } + ], + "name": "Record_BP_1", + "direct_transition": "Record_Heart_Rate_1" + }, + "Record_Heart_Rate_1": { + "type": "Observation", + "category": "vital-signs", + "unit": "/min", + "codes": [ + { + "system": "LOINC", + "code": "8867-4", + "display": "Heart rate", + "value_set": "" + } + ], + "name": "Record_Heart_Rate_1", + "range": { + "low": 80, + "high": 130 + }, + "direct_transition": "Record_Respiratory_Rate_1" + }, + "Record_Respiratory_Rate_1": { + "type": "Observation", + "category": "vital-signs", + "unit": "/min", + "codes": [ + { + "system": "LOINC", + "code": "9279-1", + "display": "Respiratory rate", + "value_set": "" + } + ], + "name": "Record_Respiratory_Rate_1", + "range": { + "low": 25, + "high": 30 + }, + "direct_transition": "O2_1" + }, + "O2_1": { + "type": "Observation", + "category": "vital-signs", + "unit": "%", + "codes": [ + { + "system": "LOINC", + "code": "2708-6", + "display": "Oxygen saturation in Arterial blood", + "value_set": "" + } + ], + "distribution": { + "kind": "UNIFORM", + "round": false, + "parameters": { + "high": 88, + "low": 70 + } + }, + "name": "O2_1", + "direct_transition": "Take_Temperature_1" + }, + "Check CBC": { + "type": "Simple", + "name": "Check CBC", + "conditional_transition": [ + { + "transition": "CBC", + "condition": { + "condition_type": "Attribute", + "attribute": "esi", + "operator": "<=", + "value": 3 + } + }, + { + "transition": "Electrolyte Check" + } + ] + }, + "Electrolyte Check": { + "type": "Simple", + "name": "Electrolyte Check", + "conditional_transition": [ + { + "transition": "Provider Choice", + "condition": { + "condition_type": "Attribute", + "attribute": "esi", + "operator": "<=", + "value": 3 + } + }, + { + "transition": "Blood Culture Check" + } + ] + }, + "CBC": { + "type": "Procedure", + "codes": [ + { + "system": "SNOMED-CT", + "code": 26604007, + "display": "Complete blood count (procedure)", + "value_set": "" + } + ], + "distribution": { + "kind": "EXACT", + "parameters": { + "value": 10 + } + }, + "unit": "minutes", + "name": "CBC", + "complex_transition": [ + { + "condition": { + "condition_type": "Attribute", + "attribute": "esi", + "operator": "==", + "value": 1 + }, + "distributions": [ + { + "transition": "Record_CBC_Panel", + "distribution": 0.1 + }, + { + "transition": "Record_Abnormal CBC_Panel", + "distribution": 0.9 + } + ] + }, + { + "condition": { + "condition_type": "Attribute", + "attribute": "esi", + "operator": "==", + "value": 2 + }, + "distributions": [ + { + "transition": "Record_CBC_Panel", + "distribution": 0.3 + }, + { + "transition": "Record_Abnormal CBC_Panel", + "distribution": 0.7 + } + ] + }, + { + "condition": { + "condition_type": "Attribute", + "attribute": "esi", + "operator": "==", + "value": 3 + }, + "distributions": [ + { + "transition": "Record_CBC_Panel", + "distribution": 0.7 + }, + { + "transition": "Record_Abnormal CBC_Panel", + "distribution": 0.3 + } + ] + }, + { + "distributions": [ + { + "transition": "Record_CBC_Panel", + "distribution": 1 + } + ] + } + ] + }, + "Take_Temperature_4_5": { + "type": "Observation", + "category": "vital-signs", + "range": { + "low": 36.4, + "high": 38.6 + }, + "remarks": [ + "37.2 - 39.4 Celsius == 99 - 103 Fahrenheit" + ], + "unit": "Cel", + "codes": [ + { + "system": "LOINC", + "code": "8310-5", + "display": "Body temperature", + "value_set": "" + }, + { + "system": "LOINC", + "code": "8331-1", + "display": "Oral temperature", + "value_set": "" + } + ], + "name": "Take_Temperature_4_5", + "direct_transition": "History and Physical Exam" + }, + "Take_Temperature_3": { + "type": "Observation", + "category": "vital-signs", + "range": { + "low": 36.4, + "high": 38.6 + }, + "remarks": [ + "37.2 - 39.4 Celsius == 99 - 103 Fahrenheit" + ], + "unit": "Cel", + "codes": [ + { + "system": "LOINC", + "code": "8310-5", + "display": "Body temperature", + "value_set": "" + }, + { + "system": "LOINC", + "code": "8331-1", + "display": "Oral temperature", + "value_set": "" + } + ], + "name": "Take_Temperature_3", + "direct_transition": "History and Physical Exam" + }, + "Take_Temperature_1": { + "type": "Observation", + "category": "vital-signs", + "range": { + "low": 35, + "high": 39.4 + }, + "remarks": [ + "37.2 - 39.4 Celsius == 99 - 103 Fahrenheit" + ], + "unit": "Cel", + "codes": [ + { + "system": "LOINC", + "code": "8310-5", + "display": "Body temperature", + "value_set": "" + }, + { + "system": "LOINC", + "code": "8331-1", + "display": "Oral temperature", + "value_set": "" + } + ], + "name": "Take_Temperature_1", + "direct_transition": "History and Physical Exam" + }, + "Take_Temperature_2": { + "type": "Observation", + "category": "vital-signs", + "range": { + "low": 36.4, + "high": 38.6 + }, + "remarks": [ + "37.2 - 39.4 Celsius == 99 - 103 Fahrenheit" + ], + "unit": "Cel", + "codes": [ + { + "system": "LOINC", + "code": "8310-5", + "display": "Body temperature", + "value_set": "" + }, + { + "system": "LOINC", + "code": "8331-1", + "display": "Oral temperature", + "value_set": "" + } + ], + "name": "Take_Temperature_2", + "direct_transition": "History and Physical Exam" + }, + "ESI State 5": { + "type": "SetAttribute", + "attribute": "esi", + "direct_transition": "Record_BP_4_5", + "name": "ESI State 5", + "value": 5 + }, + "ESI_State 4": { + "type": "SetAttribute", + "attribute": "esi", + "name": "ESI_State 4", + "value": 4, + "direct_transition": "Record_BP_4_5" + }, + "ESI_State 3": { + "type": "SetAttribute", + "attribute": "esi", + "name": "ESI_State 3", + "value": 3, + "direct_transition": "Record_BP_3" + }, + "ESI_State 2": { + "type": "SetAttribute", + "attribute": "esi", + "name": "ESI_State 2", + "value": 2, + "direct_transition": "Record_BP_2" + }, + "ESI_State 1": { + "type": "SetAttribute", + "attribute": "esi", + "name": "ESI_State 1", + "value": 1, + "direct_transition": "Record_BP_1" + }, + "Record_CBC_Panel": { + "type": "DiagnosticReport", + "number_of_observations": 4, + "codes": [ + { + "system": "LOINC", + "code": "58410-2", + "display": "Complete blood count (hemogram) panel - Blood by Automated count", + "value_set": "" + } + ], + "observations": [ + { + "category": "laboratory", + "codes": [ + { + "system": "LOINC", + "code": "6690-2", + "display": "Leukocytes [#/volume] in Blood by Automated count" + } + ], + "unit": "10*3/uL", + "range": { + "low": 3.5, + "high": 10.5 + } + }, + { + "category": "laboratory", + "codes": [ + { + "system": "LOINC", + "code": "789-8", + "display": "Erythrocytes [#/volume] in Blood by Automated count" + } + ], + "unit": "10*6/uL", + "range": { + "low": 3.9, + "high": 5.5 + } + }, + { + "category": "laboratory", + "codes": [ + { + "system": "LOINC", + "code": "718-7", + "display": "Hemoglobin [Mass/volume] in Blood" + } + ], + "unit": "g/dL", + "range": { + "low": 12, + "high": 17.5 + } + }, + { + "category": "laboratory", + "codes": [ + { + "system": "LOINC", + "code": "4544-3", + "display": "Hematocrit [Volume Fraction] of Blood by Automated count" + } + ], + "unit": "%", + "range": { + "low": 35, + "high": 50 + } + }, + { + "category": "laboratory", + "unit": "fL", + "codes": [ + { + "system": "LOINC", + "code": "787-2", + "display": "MCV [Entitic volume] by Automated count" + } + ], + "range": { + "low": 80, + "high": 95 + } + }, + { + "category": "laboratory", + "unit": "pg", + "codes": [ + { + "system": "LOINC", + "code": "785-6", + "display": "MCH [Entitic mass] by Automated count" + } + ], + "range": { + "low": 27, + "high": 33 + } + }, + { + "category": "laboratory", + "unit": "g/dL", + "codes": [ + { + "system": "LOINC", + "code": "786-4", + "display": "MCHC [Mass/volume] by Automated count" + } + ], + "range": { + "low": 33, + "high": 36 + } + }, + { + "category": "laboratory", + "unit": "fL", + "codes": [ + { + "system": "LOINC", + "code": "21000-5", + "display": "Erythrocyte distribution width [Entitic volume] by Automated count" + } + ], + "range": { + "low": 39, + "high": 46 + } + }, + { + "category": "laboratory", + "unit": "10*3/uL", + "codes": [ + { + "system": "LOINC", + "code": "777-3", + "display": "Platelets [#/volume] in Blood by Automated count" + } + ], + "range": { + "low": 150, + "high": 450 + } + }, + { + "category": "laboratory", + "unit": "fL", + "codes": [ + { + "system": "LOINC", + "code": "32207-3", + "display": "Platelet distribution width [Entitic volume] in Blood by Automated count" + } + ], + "range": { + "low": 150, + "high": 520 + } + }, + { + "category": "laboratory", + "unit": "fL", + "codes": [ + { + "system": "LOINC", + "code": "32623-1", + "display": "Platelet mean volume [Entitic volume] in Blood by Automated count" + } + ], + "range": { + "low": 9.4, + "high": 12.3 + } + } + ], + "name": "Record_CBC_Panel", + "direct_transition": "Electrolyte Check" + }, + "Record_Abnormal CBC_Panel": { + "type": "DiagnosticReport", + "number_of_observations": 4, + "codes": [ + { + "system": "LOINC", + "code": "58410-2", + "display": "Complete blood count (hemogram) panel - Blood by Automated count", + "value_set": "" + } + ], + "observations": [ + { + "category": "laboratory", + "codes": [ + { + "system": "LOINC", + "code": "6690-2", + "display": "Leukocytes [#/volume] in Blood by Automated count" + } + ], + "unit": "10*3/uL", + "range": { + "low": 12, + "high": 22 + } + }, + { + "category": "laboratory", + "codes": [ + { + "system": "LOINC", + "code": "789-8", + "display": "Erythrocytes [#/volume] in Blood by Automated count" + } + ], + "unit": "10*6/uL", + "range": { + "low": 3.9, + "high": 5.5 + } + }, + { + "category": "laboratory", + "codes": [ + { + "system": "LOINC", + "code": "718-7", + "display": "Hemoglobin [Mass/volume] in Blood" + } + ], + "unit": "g/dL", + "range": { + "low": 12, + "high": 17.5 + } + }, + { + "category": "laboratory", + "codes": [ + { + "system": "LOINC", + "code": "4544-3", + "display": "Hematocrit [Volume Fraction] of Blood by Automated count" + } + ], + "unit": "%", + "range": { + "low": 35, + "high": 50 + } + }, + { + "category": "laboratory", + "unit": "fL", + "codes": [ + { + "system": "LOINC", + "code": "787-2", + "display": "MCV [Entitic volume] by Automated count" + } + ], + "range": { + "low": 80, + "high": 95 + } + }, + { + "category": "laboratory", + "unit": "pg", + "codes": [ + { + "system": "LOINC", + "code": "785-6", + "display": "MCH [Entitic mass] by Automated count" + } + ], + "range": { + "low": 27, + "high": 33 + } + }, + { + "category": "laboratory", + "unit": "g/dL", + "codes": [ + { + "system": "LOINC", + "code": "786-4", + "display": "MCHC [Mass/volume] by Automated count" + } + ], + "range": { + "low": 33, + "high": 36 + } + }, + { + "category": "laboratory", + "unit": "fL", + "codes": [ + { + "system": "LOINC", + "code": "21000-5", + "display": "Erythrocyte distribution width [Entitic volume] by Automated count" + } + ], + "range": { + "low": 39, + "high": 46 + } + }, + { + "category": "laboratory", + "unit": "10*3/uL", + "codes": [ + { + "system": "LOINC", + "code": "777-3", + "display": "Platelets [#/volume] in Blood by Automated count" + } + ], + "range": { + "low": 150, + "high": 450 + } + }, + { + "category": "laboratory", + "unit": "fL", + "codes": [ + { + "system": "LOINC", + "code": "32207-3", + "display": "Platelet distribution width [Entitic volume] in Blood by Automated count" + } + ], + "range": { + "low": 150, + "high": 520 + } + }, + { + "category": "laboratory", + "unit": "fL", + "codes": [ + { + "system": "LOINC", + "code": "32623-1", + "display": "Platelet mean volume [Entitic volume] in Blood by Automated count" + } + ], + "range": { + "low": 9.4, + "high": 12.3 + } + } + ], + "name": "Record_Abnormal CBC_Panel", + "direct_transition": "Electrolyte Check" + }, + "Blood Culture Check": { + "type": "Simple", + "name": "Blood Culture Check", + "conditional_transition": [ + { + "transition": "Blood Culture", + "condition": { + "condition_type": "Attribute", + "attribute": "esi", + "operator": "<=", + "value": 2 + } + }, + { + "transition": "Urinalysis" + } + ] + }, + "Urinalysis": { + "type": "Procedure", + "codes": [ + { + "system": "SNOMED-CT", + "code": 441550005, + "display": "Urinalysis with reflex to microscopy and culture (procedure)", + "value_set": "" + } + ], + "distribution": { + "kind": "EXACT", + "parameters": { + "value": 10 + } + }, + "unit": "minutes", + "direct_transition": "Labs Submodule", + "name": "Urinalysis" + }, + "Labs Submodule": { + "type": "CallSubmodule", + "submodule": "uti_labs", + "direct_transition": "Terminal", + "name": "Labs Submodule" + }, + "Provider Choice": { + "type": "Simple", + "name": "Provider Choice", + "complex_transition": [ + { + "condition": { + "condition_type": "Attribute", + "attribute": "esi", + "operator": "<=", + "value": 2 + }, + "distributions": [], + "transition": "CMP" + }, + { + "condition": { + "condition_type": "Attribute", + "attribute": "esi", + "operator": "==", + "value": 3 + }, + "distributions": [ + { + "transition": "CMP", + "distribution": 0.3 + }, + { + "transition": "BMP", + "distribution": 0.7 + } + ] + } + ] + }, + "CMP": { + "type": "Procedure", + "codes": [ + { + "system": "SNOMED-CT", + "code": 371361000119107, + "display": "Comprehensive metabolic panel (procedure)", + "value_set": "" + } + ], + "distribution": { + "kind": "EXACT", + "parameters": { + "value": 10 + } + }, + "unit": "minutes", + "name": "CMP", + "complex_transition": [ + { + "condition": { + "condition_type": "Attribute", + "attribute": "ckd", + "operator": ">=", + "value": 1 + }, + "distributions": [], + "transition": "Comprehensive_Metabolic_Panel_with_Kidney_Damage" + }, + { + "condition": { + "condition_type": "Attribute", + "attribute": "esi", + "operator": "<=", + "value": 2 + }, + "distributions": [ + { + "transition": "Comprehensive_Metabolic_Panel_with_Kidney_Damage", + "distribution": 0.6 + }, + { + "transition": "Comprehensive_Metabolic_Panel", + "distribution": 0.4 + } + ] + }, + { + "condition": { + "condition_type": "Attribute", + "attribute": "esi", + "operator": "==", + "value": 3 + }, + "distributions": [ + { + "transition": "Comprehensive_Metabolic_Panel_with_Kidney_Damage", + "distribution": 0.05 + }, + { + "transition": "Comprehensive_Metabolic_Panel", + "distribution": 0.95 + } + ] + } + ] + }, + "BMP": { + "type": "Procedure", + "codes": [ + { + "system": "SNOMED-CT", + "code": 866146005, + "display": "Serum metabolic panel (procedure)", + "value_set": "" + } + ], + "distribution": { + "kind": "EXACT", + "parameters": { + "value": 10 + } + }, + "unit": "minutes", + "name": "BMP", + "complex_transition": [ + { + "condition": { + "condition_type": "Attribute", + "attribute": "ckd", + "operator": ">=", + "value": 1 + }, + "distributions": [], + "transition": "Basic_Metabolic_Panel_with_Kidney Damage" + }, + { + "condition": { + "condition_type": "Attribute", + "attribute": "esi", + "operator": "<=", + "value": 2 + }, + "distributions": [], + "transition": "Basic_Metabolic_Panel_with_Normal_Kidney" + }, + { + "condition": { + "condition_type": "Attribute", + "attribute": "esi", + "operator": "==", + "value": 3 + }, + "distributions": [ + { + "transition": "Basic_Metabolic_Panel_with_Kidney Damage", + "distribution": 0.05 + }, + { + "transition": "Basic_Metabolic_Panel_with_Normal_Kidney", + "distribution": 0.95 + } + ] + } + ] + }, + "Comprehensive_Metabolic_Panel": { + "type": "DiagnosticReport", + "codes": [ + { + "system": "LOINC", + "code": "24323-8", + "display": "Comprehensive metabolic 2000 panel - Serum or Plasma", + "value_set": "" + } + ], + "observations": [ + { + "category": "laboratory", + "vital_sign": "Glucose", + "codes": [ + { + "system": "LOINC", + "code": "2345-7", + "display": "Glucose [Mass/volume] in Serum or Plasma" + } + ], + "unit": "mg/dL" + }, + { + "category": "laboratory", + "vital_sign": "Urea Nitrogen", + "codes": [ + { + "system": "LOINC", + "code": "3094-0", + "display": "Urea nitrogen [Mass/volume] in Serum or Plasma" + } + ], + "unit": "mg/dL" + }, + { + "category": "laboratory", + "codes": [ + { + "system": "LOINC", + "code": "2160-0", + "display": "Creatinine [Mass/volume] in Serum or Plasma" + } + ], + "unit": "mg/dL", + "range": { + "low": 1.5, + "high": 3 + } + }, + { + "category": "laboratory", + "vital_sign": "Calcium", + "codes": [ + { + "system": "LOINC", + "code": "17861-6", + "display": "Calcium [Mass/volume] in Serum or Plasma" + } + ], + "unit": "mg/dL" + }, + { + "category": "laboratory", + "vital_sign": "Sodium", + "codes": [ + { + "system": "LOINC", + "code": "2951-2", + "display": "Sodium [Moles/volume] in Serum or Plasma" + } + ], + "unit": "mmol/L" + }, + { + "category": "laboratory", + "vital_sign": "Potassium", + "codes": [ + { + "system": "LOINC", + "code": "2823-3", + "display": "Potassium [Moles/volume] in Serum or Plasma" + } + ], + "unit": "mmol/L" + }, + { + "category": "laboratory", + "vital_sign": "Chloride", + "codes": [ + { + "system": "LOINC", + "code": "2075-0", + "display": "Chloride [Moles/volume] in Serum or Plasma" + } + ], + "unit": "mmol/L" + }, + { + "category": "laboratory", + "vital_sign": "Carbon Dioxide", + "codes": [ + { + "system": "LOINC", + "code": "2028-9", + "display": "Carbon dioxide, total [Moles/volume] in Serum or Plasma" + } + ], + "unit": "mmol/L" + }, + { + "category": "laboratory", + "unit": "mL/min", + "codes": [ + { + "system": "LOINC", + "code": "33914-3", + "display": "Glomerular filtration rate/1.73 sq M.predicted" + } + ], + "range": { + "low": 5, + "high": 14 + } + }, + { + "category": "laboratory", + "unit": "g/dL", + "codes": [ + { + "system": "LOINC", + "code": "2885-2", + "display": "Protein [Mass/volume] in Serum or Plasma" + } + ], + "range": { + "low": 6, + "high": 8.5 + } + }, + { + "category": "laboratory", + "unit": "g/dL", + "codes": [ + { + "system": "LOINC", + "code": "1751-7", + "display": "Albumin [Mass/volume] in Serum or Plasma" + } + ], + "range": { + "low": 4, + "high": 5 + } + }, + { + "category": "laboratory", + "unit": "mg/dL", + "codes": [ + { + "system": "LOINC", + "code": "1975-2", + "display": "Bilirubin.total [Mass/volume] in Serum or Plasma" + } + ], + "range": { + "low": 6, + "high": 15 + } + }, + { + "category": "laboratory", + "unit": "U/L", + "codes": [ + { + "system": "LOINC", + "code": "6768-6", + "display": "Alkaline phosphatase [Enzymatic activity/volume] in Serum or Plasma" + } + ], + "range": { + "low": 39, + "high": 117 + } + }, + { + "category": "laboratory", + "unit": "U/L", + "codes": [ + { + "system": "LOINC", + "code": "1742-6", + "display": "Alanine aminotransferase [Enzymatic activity/volume] in Serum or Plasma" + } + ], + "range": { + "low": 0, + "high": 44 + } + }, + { + "category": "laboratory", + "unit": "U/L", + "codes": [ + { + "system": "LOINC", + "code": "1920-8", + "display": "Aspartate aminotransferase [Enzymatic activity/volume] in Serum or Plasma" + } + ], + "range": { + "low": 0, + "high": 40 + } + } + ], + "name": "Comprehensive_Metabolic_Panel", + "direct_transition": "Blood Culture Check" + }, + "Comprehensive_Metabolic_Panel_with_Kidney_Damage": { + "type": "DiagnosticReport", + "codes": [ + { + "system": "LOINC", + "code": "24323-8", + "display": "Comprehensive metabolic 2000 panel - Serum or Plasma", + "value_set": "" + } + ], + "observations": [ + { + "category": "laboratory", + "vital_sign": "Glucose", + "codes": [ + { + "system": "LOINC", + "code": "2345-7", + "display": "Glucose [Mass/volume] in Serum or Plasma" + } + ], + "unit": "mg/dL" + }, + { + "category": "laboratory", + "vital_sign": "Urea Nitrogen", + "codes": [ + { + "system": "LOINC", + "code": "3094-0", + "display": "Urea nitrogen [Mass/volume] in Serum or Plasma" + } + ], + "unit": "mg/dL" + }, + { + "category": "laboratory", + "codes": [ + { + "system": "LOINC", + "code": "2160-0", + "display": "Creatinine [Mass/volume] in Serum or Plasma" + } + ], + "unit": "mg/dL", + "range": { + "low": 2.5, + "high": 3 + } + }, + { + "category": "laboratory", + "vital_sign": "Calcium", + "codes": [ + { + "system": "LOINC", + "code": "17861-6", + "display": "Calcium [Mass/volume] in Serum or Plasma" + } + ], + "unit": "mg/dL" + }, + { + "category": "laboratory", + "vital_sign": "Sodium", + "codes": [ + { + "system": "LOINC", + "code": "2951-2", + "display": "Sodium [Moles/volume] in Serum or Plasma" + } + ], + "unit": "mmol/L" + }, + { + "category": "laboratory", + "vital_sign": "Potassium", + "codes": [ + { + "system": "LOINC", + "code": "2823-3", + "display": "Potassium [Moles/volume] in Serum or Plasma" + } + ], + "unit": "mmol/L" + }, + { + "category": "laboratory", + "vital_sign": "Chloride", + "codes": [ + { + "system": "LOINC", + "code": "2075-0", + "display": "Chloride [Moles/volume] in Serum or Plasma" + } + ], + "unit": "mmol/L" + }, + { + "category": "laboratory", + "vital_sign": "Carbon Dioxide", + "codes": [ + { + "system": "LOINC", + "code": "2028-9", + "display": "Carbon dioxide, total [Moles/volume] in Serum or Plasma" + } + ], + "unit": "mmol/L" + }, + { + "category": "laboratory", + "unit": "mL/min", + "codes": [ + { + "system": "LOINC", + "code": "33914-3", + "display": "Glomerular filtration rate/1.73 sq M.predicted" + } + ], + "range": { + "low": 5, + "high": 14 + } + }, + { + "category": "laboratory", + "unit": "g/dL", + "codes": [ + { + "system": "LOINC", + "code": "2885-2", + "display": "Protein [Mass/volume] in Serum or Plasma" + } + ], + "range": { + "low": 6, + "high": 8.5 + } + }, + { + "category": "laboratory", + "unit": "g/dL", + "codes": [ + { + "system": "LOINC", + "code": "1751-7", + "display": "Albumin [Mass/volume] in Serum or Plasma" + } + ], + "range": { + "low": 4, + "high": 5 + } + }, + { + "category": "laboratory", + "unit": "mg/dL", + "codes": [ + { + "system": "LOINC", + "code": "1975-2", + "display": "Bilirubin.total [Mass/volume] in Serum or Plasma" + } + ], + "range": { + "low": 6, + "high": 15 + } + }, + { + "category": "laboratory", + "unit": "U/L", + "codes": [ + { + "system": "LOINC", + "code": "6768-6", + "display": "Alkaline phosphatase [Enzymatic activity/volume] in Serum or Plasma" + } + ], + "range": { + "low": 39, + "high": 117 + } + }, + { + "category": "laboratory", + "unit": "U/L", + "codes": [ + { + "system": "LOINC", + "code": "1742-6", + "display": "Alanine aminotransferase [Enzymatic activity/volume] in Serum or Plasma" + } + ], + "range": { + "low": 0, + "high": 44 + } + }, + { + "category": "laboratory", + "unit": "U/L", + "codes": [ + { + "system": "LOINC", + "code": "1920-8", + "display": "Aspartate aminotransferase [Enzymatic activity/volume] in Serum or Plasma" + } + ], + "range": { + "low": 0, + "high": 40 + } + } + ], + "name": "Comprehensive_Metabolic_Panel_with_Kidney_Damage", + "direct_transition": "Blood Culture Check" + }, + "Basic_Metabolic_Panel_with_Normal_Kidney": { + "type": "DiagnosticReport", + "codes": [ + { + "system": "LOINC", + "code": "24321-2", + "display": "Basic metabolic 2000 panel - Serum or Plasma", + "value_set": "" + } + ], + "observations": [ + { + "category": "laboratory", + "vital_sign": "Glucose", + "codes": [ + { + "system": "LOINC", + "code": "2345-7", + "display": "Glucose [Mass/volume] in Serum or Plasma" + } + ], + "unit": "mg/dL" + }, + { + "category": "laboratory", + "vital_sign": "Urea Nitrogen", + "codes": [ + { + "system": "LOINC", + "code": "3094-0", + "display": "Urea nitrogen [Mass/volume] in Serum or Plasma" + } + ], + "unit": "mg/dL" + }, + { + "category": "laboratory", + "codes": [ + { + "system": "LOINC", + "code": "2160-0", + "display": "Creatinine [Mass/volume] in Serum or Plasma" + } + ], + "unit": "mg/dL", + "range": { + "low": 2.5, + "high": 3 + } + }, + { + "category": "laboratory", + "vital_sign": "Calcium", + "codes": [ + { + "system": "LOINC", + "code": "17861-6", + "display": "Calcium [Mass/volume] in Serum or Plasma" + } + ], + "unit": "mg/dL" + }, + { + "category": "laboratory", + "vital_sign": "Sodium", + "codes": [ + { + "system": "LOINC", + "code": "2951-2", + "display": "Sodium [Moles/volume] in Serum or Plasma" + } + ], + "unit": "mmol/L" + }, + { + "category": "laboratory", + "vital_sign": "Potassium", + "codes": [ + { + "system": "LOINC", + "code": "2823-3", + "display": "Potassium [Moles/volume] in Serum or Plasma" + } + ], + "unit": "mmol/L" + }, + { + "category": "laboratory", + "vital_sign": "Chloride", + "codes": [ + { + "system": "LOINC", + "code": "2075-0", + "display": "Chloride [Moles/volume] in Serum or Plasma" + } + ], + "unit": "mmol/L" + }, + { + "category": "laboratory", + "vital_sign": "Carbon Dioxide", + "codes": [ + { + "system": "LOINC", + "code": "2028-9", + "display": "Carbon dioxide, total [Moles/volume] in Serum or Plasma" + } + ], + "unit": "mmol/L" + }, + { + "category": "laboratory", + "unit": "mL/min", + "codes": [ + { + "system": "LOINC", + "code": "33914-3", + "display": "Glomerular filtration rate/1.73 sq M.predicted" + } + ], + "range": { + "low": 5, + "high": 14 + } + } + ], + "direct_transition": "Blood Culture Check", + "name": "Basic_Metabolic_Panel_with_Normal_Kidney" + }, + "Basic_Metabolic_Panel_with_Kidney Damage": { + "type": "DiagnosticReport", + "codes": [ + { + "system": "LOINC", + "code": "24321-2", + "display": "Basic metabolic 2000 panel - Serum or Plasma", + "value_set": "" + } + ], + "observations": [ + { + "category": "laboratory", + "vital_sign": "Glucose", + "codes": [ + { + "system": "LOINC", + "code": "2345-7", + "display": "Glucose [Mass/volume] in Serum or Plasma" + } + ], + "unit": "mg/dL" + }, + { + "category": "laboratory", + "vital_sign": "Urea Nitrogen", + "codes": [ + { + "system": "LOINC", + "code": "3094-0", + "display": "Urea nitrogen [Mass/volume] in Serum or Plasma" + } + ], + "unit": "mg/dL" + }, + { + "category": "laboratory", + "codes": [ + { + "system": "LOINC", + "code": "2160-0", + "display": "Creatinine [Mass/volume] in Serum or Plasma" + } + ], + "unit": "mg/dL", + "range": { + "low": 2.5, + "high": 3 + } + }, + { + "category": "laboratory", + "vital_sign": "Calcium", + "codes": [ + { + "system": "LOINC", + "code": "17861-6", + "display": "Calcium [Mass/volume] in Serum or Plasma" + } + ], + "unit": "mg/dL" + }, + { + "category": "laboratory", + "vital_sign": "Sodium", + "codes": [ + { + "system": "LOINC", + "code": "2951-2", + "display": "Sodium [Moles/volume] in Serum or Plasma" + } + ], + "unit": "mmol/L" + }, + { + "category": "laboratory", + "vital_sign": "Potassium", + "codes": [ + { + "system": "LOINC", + "code": "2823-3", + "display": "Potassium [Moles/volume] in Serum or Plasma" + } + ], + "unit": "mmol/L" + }, + { + "category": "laboratory", + "vital_sign": "Chloride", + "codes": [ + { + "system": "LOINC", + "code": "2075-0", + "display": "Chloride [Moles/volume] in Serum or Plasma" + } + ], + "unit": "mmol/L" + }, + { + "category": "laboratory", + "vital_sign": "Carbon Dioxide", + "codes": [ + { + "system": "LOINC", + "code": "2028-9", + "display": "Carbon dioxide, total [Moles/volume] in Serum or Plasma" + } + ], + "unit": "mmol/L" + }, + { + "category": "laboratory", + "unit": "mL/min", + "codes": [ + { + "system": "LOINC", + "code": "33914-3", + "display": "Glomerular filtration rate/1.73 sq M.predicted" + } + ], + "range": { + "low": 5, + "high": 14 + } + } + ], + "name": "Basic_Metabolic_Panel_with_Kidney Damage", + "direct_transition": "Blood Culture Check" + }, + "Blood Culture": { + "type": "Procedure", + "codes": [ + { + "system": "SNOMED-CT", + "code": 30088009, + "display": "Blood culture (procedure)", + "value_set": "" + } + ], + "distribution": { + "kind": "UNIFORM", + "parameters": { + "high": 60, + "low": 30 + } + }, + "unit": "minutes", + "name": "Blood Culture", + "distributed_transition": [ + { + "transition": "Positive_Blood_Culture", + "distribution": 0.5 + }, + { + "transition": "Negative Blood Culture", + "distribution": 0.5 + } + ] + }, + "Negative Blood Culture": { + "type": "Observation", + "category": "laboratory", + "unit": "", + "codes": [ + { + "system": "LOINC", + "code": "600-7", + "display": "Bacteria identified in Blood by Culture", + "value_set": "" + } + ], + "direct_transition": "Urinalysis", + "name": "Negative Blood Culture", + "value_code": { + "system": "SNOMED-CT", + "code": 708118007, + "display": "Microbiologic culture finding negative (finding)" + } + }, + "Positive_Blood_Culture": { + "type": "Observation", + "category": "laboratory", + "unit": "", + "codes": [ + { + "system": "LOINC", + "code": "600-7", + "display": "Bacteria identified in Blood by Culture", + "value_set": "" + } + ], + "name": "Positive_Blood_Culture", + "value_code": { + "system": "SNOMED-CT", + "code": 8730001000004107, + "display": "Blood culture positive for microorganism (finding)" + }, + "direct_transition": "Set BldCx" + }, + "Set BldCx": { + "type": "SetAttribute", + "attribute": "UTI_Positive_BldCx", + "direct_transition": "Urinalysis", + "name": "Set BldCx", + "value": true + } + }, + "gmf_version": 2 +} \ No newline at end of file diff --git a/src/main/resources/modules/uti/labs.json b/src/main/resources/modules/uti/labs.json index 70c32711c3..7b998ece11 100644 --- a/src/main/resources/modules/uti/labs.json +++ b/src/main/resources/modules/uti/labs.json @@ -1,25 +1,1351 @@ { - "name": "uti_labs", + "name": "ED_UTI_Bundle", "remarks": [ "A blank module" ], "states": { "Initial": { "type": "Initial", - "direct_transition": "Collection", + "direct_transition": "Triage", "name": "Initial" }, "Terminal": { "type": "Terminal", "name": "Terminal" }, - "Collection": { + "Triage": { "type": "Procedure", "codes": [ { "system": "SNOMED-CT", - "code": 57617002, - "display": "Urine specimen collection (procedure)", + "code": 386478007, + "display": "Triage emergency center (procedure)", + "value_set": "" + } + ], + "distribution": { + "kind": "EXACT", + "parameters": { + "value": 15 + } + }, + "unit": "minutes", + "direct_transition": "Vitals", + "name": "Triage" + }, + "Vitals": { + "type": "Procedure", + "codes": [ + { + "system": "SNOMED-CT", + "code": 61746007, + "display": "Taking patient vital signs (procedure)", + "value_set": "" + } + ], + "distribution": { + "kind": "EXACT", + "parameters": { + "value": 5 + } + }, + "unit": "minutes", + "name": "Vitals", + "conditional_transition": [ + { + "transition": "Pyelo", + "condition": { + "condition_type": "Active Condition", + "codes": [ + { + "system": "SNOMED-CT", + "code": 45816000, + "display": "Pyelonephritis" + } + ] + } + }, + { + "transition": "Cystitis", + "condition": { + "condition_type": "Active Condition", + "codes": [ + { + "system": "SNOMED-CT", + "code": 307426000, + "display": "Acute infective cystitis (disorder)" + } + ] + } + } + ] + }, + "Cystitis": { + "type": "Simple", + "name": "Cystitis", + "distributed_transition": [ + { + "transition": "ESI-3", + "distribution": 0.2 + }, + { + "transition": "ESI-4", + "distribution": 0.7 + }, + { + "transition": "ESI-5", + "distribution": 0.1 + } + ] + }, + "Pyelo": { + "type": "Simple", + "name": "Pyelo", + "complex_transition": [ + { + "condition": { + "condition_type": "Or", + "conditions": [ + { + "condition_type": "Attribute", + "attribute": "ckd", + "operator": ">=", + "value": 1 + }, + { + "condition_type": "Attribute", + "attribute": "diabetes", + "operator": "==", + "value": true + } + ] + }, + "distributions": [ + { + "transition": "ESI-1", + "distribution": 0.007 + }, + { + "transition": "ESI-2", + "distribution": 0.062 + }, + { + "transition": "ESI-3", + "distribution": 0.931 + } + ] + }, + { + "distributions": [ + { + "transition": "ESI-1", + "distribution": 0.006 + }, + { + "transition": "ESI-2", + "distribution": 0.054 + }, + { + "transition": "ESI-3", + "distribution": 0.8 + }, + { + "transition": "ESI-4", + "distribution": 0.1 + } + ] + } + ] + }, + "ESI-1": { + "type": "Observation", + "category": "exam", + "unit": "", + "codes": [ + { + "system": "LOINC", + "code": "75636-1", + "display": "Emergency severity index", + "value_set": "" + } + ], + "direct_transition": "ESI_State 1", + "name": "ESI-1", + "value_code": { + "system": "LOINC", + "code": "LA21567-5", + "display": "Requires immediate life-saving intervention" + } + }, + "ESI-2": { + "type": "Observation", + "category": "exam", + "unit": "", + "codes": [ + { + "system": "LOINC", + "code": "75636-1", + "display": "Emergency severity index", + "value_set": "" + } + ], + "name": "ESI-2", + "value_code": { + "system": "LOINC", + "code": "LA21752-3", + "display": "High risk or confused/lethargic/disoriented or severe pain/distress" + }, + "direct_transition": "ESI_State 2" + }, + "ESI-3": { + "type": "Observation", + "category": "exam", + "unit": "", + "codes": [ + { + "system": "LOINC", + "code": "75636-1", + "display": "Emergency severity index", + "value_set": "" + } + ], + "name": "ESI-3", + "value_code": { + "system": "LOINC", + "code": "LA21753-1", + "display": "Needs 2 or more resources" + }, + "direct_transition": "ESI_State 3" + }, + "ESI-4": { + "type": "Observation", + "category": "exam", + "unit": "", + "codes": [ + { + "system": "LOINC", + "code": "75636-1", + "display": "Emergency severity index", + "value_set": "" + } + ], + "name": "ESI-4", + "value_code": { + "system": "LOINC", + "code": "LA21754-9", + "display": "Needs 1 resource" + }, + "direct_transition": "ESI_State 4" + }, + "ESI-5": { + "type": "Observation", + "category": "exam", + "unit": "", + "codes": [ + { + "system": "LOINC", + "code": "75636-1", + "display": "Emergency severity index", + "value_set": "" + } + ], + "name": "ESI-5", + "value_code": { + "system": "LOINC", + "code": "LA21755-6", + "display": "Needs no resources" + }, + "direct_transition": "ESI State 5" + }, + "Record_BP_4_5": { + "type": "MultiObservation", + "category": "vital-signs", + "codes": [ + { + "system": "LOINC", + "code": "85354-9", + "display": "Blood Pressure", + "value_set": "" + } + ], + "observations": [ + { + "category": "vital-signs", + "codes": [ + { + "system": "LOINC", + "code": "8480-6", + "display": "Systolic Blood Pressure" + } + ], + "unit": "mm[Hg]", + "range": { + "low": 110, + "high": 160 + } + }, + { + "category": "vital-signs", + "codes": [ + { + "system": "LOINC", + "code": "8462-4", + "display": "Diastolic Blood Pressure" + } + ], + "unit": "mm[Hg]", + "range": { + "low": 60, + "high": 100 + } + } + ], + "name": "Record_BP_4_5", + "direct_transition": "Record_Heart_Rate_4_5" + }, + "Record_BP_3": { + "type": "MultiObservation", + "category": "vital-signs", + "codes": [ + { + "system": "LOINC", + "code": "85354-9", + "display": "Blood Pressure", + "value_set": "" + } + ], + "observations": [ + { + "category": "vital-signs", + "codes": [ + { + "system": "LOINC", + "code": "8480-6", + "display": "Systolic Blood Pressure" + } + ], + "unit": "mm[Hg]", + "range": { + "low": 110, + "high": 180 + } + }, + { + "category": "vital-signs", + "codes": [ + { + "system": "LOINC", + "code": "8462-4", + "display": "Diastolic Blood Pressure" + } + ], + "unit": "mm[Hg]", + "range": { + "low": 60, + "high": 110 + } + } + ], + "name": "Record_BP_3", + "direct_transition": "Record_Heart_Rate_3" + }, + "Record_Heart_Rate_4_5": { + "type": "Observation", + "category": "vital-signs", + "unit": "/min", + "codes": [ + { + "system": "LOINC", + "code": "8867-4", + "display": "Heart rate", + "value_set": "" + } + ], + "name": "Record_Heart_Rate_4_5", + "direct_transition": "Record_Respiratory_Rate_4_5", + "range": { + "low": 60, + "high": 99 + } + }, + "Record_Respiratory_Rate_4_5": { + "type": "Observation", + "category": "vital-signs", + "unit": "/min", + "codes": [ + { + "system": "LOINC", + "code": "9279-1", + "display": "Respiratory rate", + "value_set": "" + } + ], + "name": "Record_Respiratory_Rate_4_5", + "direct_transition": "O2_4_5", + "range": { + "low": 12, + "high": 20 + } + }, + "O2_4_5": { + "type": "Observation", + "category": "vital-signs", + "unit": "%", + "codes": [ + { + "system": "LOINC", + "code": "2708-6", + "display": "Oxygen saturation in Arterial blood", + "value_set": "" + } + ], + "distribution": { + "kind": "UNIFORM", + "round": false, + "parameters": { + "high": 100, + "low": 99 + } + }, + "direct_transition": "Take_Temperature_4_5", + "name": "O2_4_5" + }, + "Record_Heart_Rate_3": { + "type": "Observation", + "category": "vital-signs", + "unit": "/min", + "codes": [ + { + "system": "LOINC", + "code": "8867-4", + "display": "Heart rate", + "value_set": "" + } + ], + "name": "Record_Heart_Rate_3", + "range": { + "low": 60, + "high": 99 + }, + "direct_transition": "Record_Respiratory_Rate_3" + }, + "Record_Respiratory_Rate_3": { + "type": "Observation", + "category": "vital-signs", + "unit": "/min", + "codes": [ + { + "system": "LOINC", + "code": "9279-1", + "display": "Respiratory rate", + "value_set": "" + } + ], + "name": "Record_Respiratory_Rate_3", + "range": { + "low": 12, + "high": 20 + }, + "direct_transition": "O2_3" + }, + "O2_3": { + "type": "Observation", + "category": "vital-signs", + "unit": "%", + "codes": [ + { + "system": "LOINC", + "code": "2708-6", + "display": "Oxygen saturation in Arterial blood", + "value_set": "" + } + ], + "distribution": { + "kind": "UNIFORM", + "round": false, + "parameters": { + "high": 100, + "low": 97 + } + }, + "name": "O2_3", + "direct_transition": "Take_Temperature_3" + }, + "History and Physical Exam": { + "type": "Procedure", + "codes": [ + { + "system": "SNOMED-CT", + "code": 14736009, + "display": "History and physical examination with evaluation and management of patient (procedure)", + "value_set": "" + } + ], + "distribution": { + "kind": "UNIFORM", + "parameters": { + "high": 60, + "low": 30 + } + }, + "unit": "minutes", + "direct_transition": "Check CBC", + "name": "History and Physical Exam" + }, + "Record_BP_2": { + "type": "MultiObservation", + "category": "vital-signs", + "codes": [ + { + "system": "LOINC", + "code": "85354-9", + "display": "Blood Pressure", + "value_set": "" + } + ], + "observations": [ + { + "category": "vital-signs", + "codes": [ + { + "system": "LOINC", + "code": "8480-6", + "display": "Systolic Blood Pressure" + } + ], + "unit": "mm[Hg]", + "range": { + "low": 90, + "high": 110 + } + }, + { + "category": "vital-signs", + "codes": [ + { + "system": "LOINC", + "code": "8462-4", + "display": "Diastolic Blood Pressure" + } + ], + "unit": "mm[Hg]", + "range": { + "low": 40, + "high": 60 + } + } + ], + "name": "Record_BP_2", + "direct_transition": "Record_Heart_Rate_2" + }, + "Record_Heart_Rate_2": { + "type": "Observation", + "category": "vital-signs", + "unit": "/min", + "codes": [ + { + "system": "LOINC", + "code": "8867-4", + "display": "Heart rate", + "value_set": "" + } + ], + "name": "Record_Heart_Rate_2", + "range": { + "low": 80, + "high": 130 + }, + "direct_transition": "Record_Respiratory_Rate_2" + }, + "Record_Respiratory_Rate_2": { + "type": "Observation", + "category": "vital-signs", + "unit": "/min", + "codes": [ + { + "system": "LOINC", + "code": "9279-1", + "display": "Respiratory rate", + "value_set": "" + } + ], + "name": "Record_Respiratory_Rate_2", + "range": { + "low": 21, + "high": 25 + }, + "direct_transition": "O2_2" + }, + "O2_2": { + "type": "Observation", + "category": "vital-signs", + "unit": "%", + "codes": [ + { + "system": "LOINC", + "code": "2708-6", + "display": "Oxygen saturation in Arterial blood", + "value_set": "" + } + ], + "distribution": { + "kind": "UNIFORM", + "round": false, + "parameters": { + "high": 94, + "low": 89 + } + }, + "name": "O2_2", + "direct_transition": "Take_Temperature_2" + }, + "Record_BP_1": { + "type": "MultiObservation", + "category": "vital-signs", + "codes": [ + { + "system": "LOINC", + "code": "85354-9", + "display": "Blood Pressure", + "value_set": "" + } + ], + "observations": [ + { + "category": "vital-signs", + "codes": [ + { + "system": "LOINC", + "code": "8480-6", + "display": "Systolic Blood Pressure" + } + ], + "unit": "mm[Hg]", + "range": { + "low": 60, + "high": 85 + } + }, + { + "category": "vital-signs", + "codes": [ + { + "system": "LOINC", + "code": "8462-4", + "display": "Diastolic Blood Pressure" + } + ], + "unit": "mm[Hg]", + "range": { + "low": 20, + "high": 40 + } + } + ], + "name": "Record_BP_1", + "direct_transition": "Record_Heart_Rate_1" + }, + "Record_Heart_Rate_1": { + "type": "Observation", + "category": "vital-signs", + "unit": "/min", + "codes": [ + { + "system": "LOINC", + "code": "8867-4", + "display": "Heart rate", + "value_set": "" + } + ], + "name": "Record_Heart_Rate_1", + "range": { + "low": 80, + "high": 130 + }, + "direct_transition": "Record_Respiratory_Rate_1" + }, + "Record_Respiratory_Rate_1": { + "type": "Observation", + "category": "vital-signs", + "unit": "/min", + "codes": [ + { + "system": "LOINC", + "code": "9279-1", + "display": "Respiratory rate", + "value_set": "" + } + ], + "name": "Record_Respiratory_Rate_1", + "range": { + "low": 25, + "high": 30 + }, + "direct_transition": "O2_1" + }, + "O2_1": { + "type": "Observation", + "category": "vital-signs", + "unit": "%", + "codes": [ + { + "system": "LOINC", + "code": "2708-6", + "display": "Oxygen saturation in Arterial blood", + "value_set": "" + } + ], + "distribution": { + "kind": "UNIFORM", + "round": false, + "parameters": { + "high": 88, + "low": 70 + } + }, + "name": "O2_1", + "direct_transition": "Take_Temperature_1" + }, + "Check CBC": { + "type": "Simple", + "name": "Check CBC", + "conditional_transition": [ + { + "transition": "CBC", + "condition": { + "condition_type": "Attribute", + "attribute": "esi", + "operator": "<=", + "value": 3 + } + }, + { + "transition": "Electrolyte Check" + } + ] + }, + "Electrolyte Check": { + "type": "Simple", + "name": "Electrolyte Check", + "conditional_transition": [ + { + "transition": "Provider Choice", + "condition": { + "condition_type": "Attribute", + "attribute": "esi", + "operator": "<=", + "value": 3 + } + }, + { + "transition": "Blood Culture Check" + } + ] + }, + "CBC": { + "type": "Procedure", + "codes": [ + { + "system": "SNOMED-CT", + "code": 26604007, + "display": "Complete blood count (procedure)", + "value_set": "" + } + ], + "distribution": { + "kind": "EXACT", + "parameters": { + "value": 10 + } + }, + "unit": "minutes", + "name": "CBC", + "complex_transition": [ + { + "condition": { + "condition_type": "Attribute", + "attribute": "esi", + "operator": "==", + "value": 1 + }, + "distributions": [ + { + "transition": "Record_CBC_Panel", + "distribution": 0.1 + }, + { + "transition": "Record_Abnormal CBC_Panel", + "distribution": 0.9 + } + ] + }, + { + "condition": { + "condition_type": "Attribute", + "attribute": "esi", + "operator": "==", + "value": 2 + }, + "distributions": [ + { + "transition": "Record_CBC_Panel", + "distribution": 0.3 + }, + { + "transition": "Record_Abnormal CBC_Panel", + "distribution": 0.7 + } + ] + }, + { + "condition": { + "condition_type": "Attribute", + "attribute": "esi", + "operator": "==", + "value": 3 + }, + "distributions": [ + { + "transition": "Record_CBC_Panel", + "distribution": 0.7 + }, + { + "transition": "Record_Abnormal CBC_Panel", + "distribution": 0.3 + } + ] + }, + { + "distributions": [ + { + "transition": "Record_CBC_Panel", + "distribution": 1 + } + ] + } + ] + }, + "Take_Temperature_4_5": { + "type": "Observation", + "category": "vital-signs", + "range": { + "low": 36.4, + "high": 38.6 + }, + "remarks": [ + "37.2 - 39.4 Celsius == 99 - 103 Fahrenheit" + ], + "unit": "Cel", + "codes": [ + { + "system": "LOINC", + "code": "8310-5", + "display": "Body temperature", + "value_set": "" + }, + { + "system": "LOINC", + "code": "8331-1", + "display": "Oral temperature", + "value_set": "" + } + ], + "name": "Take_Temperature_4_5", + "direct_transition": "History and Physical Exam" + }, + "Take_Temperature_3": { + "type": "Observation", + "category": "vital-signs", + "range": { + "low": 36.4, + "high": 38.6 + }, + "remarks": [ + "37.2 - 39.4 Celsius == 99 - 103 Fahrenheit" + ], + "unit": "Cel", + "codes": [ + { + "system": "LOINC", + "code": "8310-5", + "display": "Body temperature", + "value_set": "" + }, + { + "system": "LOINC", + "code": "8331-1", + "display": "Oral temperature", + "value_set": "" + } + ], + "name": "Take_Temperature_3", + "direct_transition": "History and Physical Exam" + }, + "Take_Temperature_1": { + "type": "Observation", + "category": "vital-signs", + "range": { + "low": 35, + "high": 39.4 + }, + "remarks": [ + "37.2 - 39.4 Celsius == 99 - 103 Fahrenheit" + ], + "unit": "Cel", + "codes": [ + { + "system": "LOINC", + "code": "8310-5", + "display": "Body temperature", + "value_set": "" + }, + { + "system": "LOINC", + "code": "8331-1", + "display": "Oral temperature", + "value_set": "" + } + ], + "name": "Take_Temperature_1", + "direct_transition": "History and Physical Exam" + }, + "Take_Temperature_2": { + "type": "Observation", + "category": "vital-signs", + "range": { + "low": 36.4, + "high": 38.6 + }, + "remarks": [ + "37.2 - 39.4 Celsius == 99 - 103 Fahrenheit" + ], + "unit": "Cel", + "codes": [ + { + "system": "LOINC", + "code": "8310-5", + "display": "Body temperature", + "value_set": "" + }, + { + "system": "LOINC", + "code": "8331-1", + "display": "Oral temperature", + "value_set": "" + } + ], + "name": "Take_Temperature_2", + "direct_transition": "History and Physical Exam" + }, + "ESI State 5": { + "type": "SetAttribute", + "attribute": "esi", + "direct_transition": "Record_BP_4_5", + "name": "ESI State 5", + "value": 5 + }, + "ESI_State 4": { + "type": "SetAttribute", + "attribute": "esi", + "name": "ESI_State 4", + "value": 4, + "direct_transition": "Record_BP_4_5" + }, + "ESI_State 3": { + "type": "SetAttribute", + "attribute": "esi", + "name": "ESI_State 3", + "value": 3, + "direct_transition": "Record_BP_3" + }, + "ESI_State 2": { + "type": "SetAttribute", + "attribute": "esi", + "name": "ESI_State 2", + "value": 2, + "direct_transition": "Record_BP_2" + }, + "ESI_State 1": { + "type": "SetAttribute", + "attribute": "esi", + "name": "ESI_State 1", + "value": 1, + "direct_transition": "Record_BP_1" + }, + "Record_CBC_Panel": { + "type": "DiagnosticReport", + "number_of_observations": 4, + "codes": [ + { + "system": "LOINC", + "code": "58410-2", + "display": "Complete blood count (hemogram) panel - Blood by Automated count", + "value_set": "" + } + ], + "observations": [ + { + "category": "laboratory", + "codes": [ + { + "system": "LOINC", + "code": "6690-2", + "display": "Leukocytes [#/volume] in Blood by Automated count" + } + ], + "unit": "10*3/uL", + "range": { + "low": 3.5, + "high": 10.5 + } + }, + { + "category": "laboratory", + "codes": [ + { + "system": "LOINC", + "code": "789-8", + "display": "Erythrocytes [#/volume] in Blood by Automated count" + } + ], + "unit": "10*6/uL", + "range": { + "low": 3.9, + "high": 5.5 + } + }, + { + "category": "laboratory", + "codes": [ + { + "system": "LOINC", + "code": "718-7", + "display": "Hemoglobin [Mass/volume] in Blood" + } + ], + "unit": "g/dL", + "range": { + "low": 12, + "high": 17.5 + } + }, + { + "category": "laboratory", + "codes": [ + { + "system": "LOINC", + "code": "4544-3", + "display": "Hematocrit [Volume Fraction] of Blood by Automated count" + } + ], + "unit": "%", + "range": { + "low": 35, + "high": 50 + } + }, + { + "category": "laboratory", + "unit": "fL", + "codes": [ + { + "system": "LOINC", + "code": "787-2", + "display": "MCV [Entitic volume] by Automated count" + } + ], + "range": { + "low": 80, + "high": 95 + } + }, + { + "category": "laboratory", + "unit": "pg", + "codes": [ + { + "system": "LOINC", + "code": "785-6", + "display": "MCH [Entitic mass] by Automated count" + } + ], + "range": { + "low": 27, + "high": 33 + } + }, + { + "category": "laboratory", + "unit": "g/dL", + "codes": [ + { + "system": "LOINC", + "code": "786-4", + "display": "MCHC [Mass/volume] by Automated count" + } + ], + "range": { + "low": 33, + "high": 36 + } + }, + { + "category": "laboratory", + "unit": "fL", + "codes": [ + { + "system": "LOINC", + "code": "21000-5", + "display": "Erythrocyte distribution width [Entitic volume] by Automated count" + } + ], + "range": { + "low": 39, + "high": 46 + } + }, + { + "category": "laboratory", + "unit": "10*3/uL", + "codes": [ + { + "system": "LOINC", + "code": "777-3", + "display": "Platelets [#/volume] in Blood by Automated count" + } + ], + "range": { + "low": 150, + "high": 450 + } + }, + { + "category": "laboratory", + "unit": "fL", + "codes": [ + { + "system": "LOINC", + "code": "32207-3", + "display": "Platelet distribution width [Entitic volume] in Blood by Automated count" + } + ], + "range": { + "low": 150, + "high": 520 + } + }, + { + "category": "laboratory", + "unit": "fL", + "codes": [ + { + "system": "LOINC", + "code": "32623-1", + "display": "Platelet mean volume [Entitic volume] in Blood by Automated count" + } + ], + "range": { + "low": 9.4, + "high": 12.3 + } + } + ], + "name": "Record_CBC_Panel", + "direct_transition": "Electrolyte Check" + }, + "Record_Abnormal CBC_Panel": { + "type": "DiagnosticReport", + "number_of_observations": 4, + "codes": [ + { + "system": "LOINC", + "code": "58410-2", + "display": "Complete blood count (hemogram) panel - Blood by Automated count", + "value_set": "" + } + ], + "observations": [ + { + "category": "laboratory", + "codes": [ + { + "system": "LOINC", + "code": "6690-2", + "display": "Leukocytes [#/volume] in Blood by Automated count" + } + ], + "unit": "10*3/uL", + "range": { + "low": 12, + "high": 22 + } + }, + { + "category": "laboratory", + "codes": [ + { + "system": "LOINC", + "code": "789-8", + "display": "Erythrocytes [#/volume] in Blood by Automated count" + } + ], + "unit": "10*6/uL", + "range": { + "low": 3.9, + "high": 5.5 + } + }, + { + "category": "laboratory", + "codes": [ + { + "system": "LOINC", + "code": "718-7", + "display": "Hemoglobin [Mass/volume] in Blood" + } + ], + "unit": "g/dL", + "range": { + "low": 12, + "high": 17.5 + } + }, + { + "category": "laboratory", + "codes": [ + { + "system": "LOINC", + "code": "4544-3", + "display": "Hematocrit [Volume Fraction] of Blood by Automated count" + } + ], + "unit": "%", + "range": { + "low": 35, + "high": 50 + } + }, + { + "category": "laboratory", + "unit": "fL", + "codes": [ + { + "system": "LOINC", + "code": "787-2", + "display": "MCV [Entitic volume] by Automated count" + } + ], + "range": { + "low": 80, + "high": 95 + } + }, + { + "category": "laboratory", + "unit": "pg", + "codes": [ + { + "system": "LOINC", + "code": "785-6", + "display": "MCH [Entitic mass] by Automated count" + } + ], + "range": { + "low": 27, + "high": 33 + } + }, + { + "category": "laboratory", + "unit": "g/dL", + "codes": [ + { + "system": "LOINC", + "code": "786-4", + "display": "MCHC [Mass/volume] by Automated count" + } + ], + "range": { + "low": 33, + "high": 36 + } + }, + { + "category": "laboratory", + "unit": "fL", + "codes": [ + { + "system": "LOINC", + "code": "21000-5", + "display": "Erythrocyte distribution width [Entitic volume] by Automated count" + } + ], + "range": { + "low": 39, + "high": 46 + } + }, + { + "category": "laboratory", + "unit": "10*3/uL", + "codes": [ + { + "system": "LOINC", + "code": "777-3", + "display": "Platelets [#/volume] in Blood by Automated count" + } + ], + "range": { + "low": 150, + "high": 450 + } + }, + { + "category": "laboratory", + "unit": "fL", + "codes": [ + { + "system": "LOINC", + "code": "32207-3", + "display": "Platelet distribution width [Entitic volume] in Blood by Automated count" + } + ], + "range": { + "low": 150, + "high": 520 + } + }, + { + "category": "laboratory", + "unit": "fL", + "codes": [ + { + "system": "LOINC", + "code": "32623-1", + "display": "Platelet mean volume [Entitic volume] in Blood by Automated count" + } + ], + "range": { + "low": 9.4, + "high": 12.3 + } + } + ], + "name": "Record_Abnormal CBC_Panel", + "direct_transition": "Electrolyte Check" + }, + "Blood Culture Check": { + "type": "Simple", + "direct_transition": "Urinalysis", + "name": "Blood Culture Check" + }, + "Urinalysis": { + "type": "Procedure", + "codes": [ + { + "system": "SNOMED-CT", + "code": 441550005, + "display": "Urinalysis with reflex to microscopy and culture (procedure)", "value_set": "" } ], @@ -30,28 +1356,123 @@ } }, "unit": "minutes", - "name": "Collection", - "conditional_transition": [ + "direct_transition": "Labs Submodule", + "name": "Urinalysis" + }, + "Labs Submodule": { + "type": "CallSubmodule", + "submodule": "uti_labs", + "direct_transition": "Terminal", + "name": "Labs Submodule" + }, + "Provider Choice": { + "type": "Simple", + "name": "Provider Choice", + "complex_transition": [ { - "transition": "Dipstick", "condition": { "condition_type": "Attribute", - "attribute": "UTI_ambulatory", - "operator": "is not nil" - } + "attribute": "esi", + "operator": "<=", + "value": 2 + }, + "distributions": [], + "transition": "CMP" + }, + { + "condition": { + "condition_type": "Attribute", + "attribute": "esi", + "operator": "==", + "value": 3 + }, + "distributions": [ + { + "transition": "CMP", + "distribution": 0.3 + }, + { + "transition": "BMP", + "distribution": 0.7 + } + ] + } + ] + }, + "CMP": { + "type": "Procedure", + "codes": [ + { + "system": "SNOMED-CT", + "code": 371361000119107, + "display": "Comprehensive metabolic panel (procedure)", + "value_set": "" + } + ], + "distribution": { + "kind": "EXACT", + "parameters": { + "value": 10 + } + }, + "unit": "minutes", + "name": "CMP", + "complex_transition": [ + { + "condition": { + "condition_type": "Attribute", + "attribute": "ckd", + "operator": ">=", + "value": 1 + }, + "distributions": [], + "transition": "Comprehensive_Metabolic_Panel_with_Kidney_Damage" + }, + { + "condition": { + "condition_type": "Attribute", + "attribute": "esi", + "operator": "<=", + "value": 2 + }, + "distributions": [ + { + "transition": "Comprehensive_Metabolic_Panel_with_Kidney_Damage", + "distribution": 0.6 + }, + { + "transition": "Comprehensive_Metabolic_Panel", + "distribution": 0.4 + } + ] }, { - "transition": "Urinalysis Micro" + "condition": { + "condition_type": "Attribute", + "attribute": "esi", + "operator": "==", + "value": 3 + }, + "distributions": [ + { + "transition": "Comprehensive_Metabolic_Panel_with_Kidney_Damage", + "distribution": 0.05 + }, + { + "transition": "Comprehensive_Metabolic_Panel", + "distribution": 0.95 + } + ] } ] }, - "Dipstick": { + "BMP": { "type": "Procedure", "codes": [ { "system": "SNOMED-CT", - "code": 167226008, - "display": "Urine dipstick test (procedure)", + "code": 866146005, + "display": "Serum metabolic panel (procedure)", "value_set": "" } ], @@ -62,625 +1483,446 @@ } }, "unit": "minutes", - "direct_transition": "Record_Urinalysis", - "name": "Dipstick" + "direct_transition": "Blood Culture Check", + "name": "BMP" }, - "Record_Urinalysis": { + "Comprehensive_Metabolic_Panel": { "type": "DiagnosticReport", "codes": [ { "system": "LOINC", - "code": "24357-6", - "display": "Urinalysis macro (dipstick) panel - Urine", + "code": "24323-8", + "display": "Comprehensive metabolic 2000 panel - Serum or Plasma", "value_set": "" } ], "observations": [ + { + "category": "laboratory", + "vital_sign": "Glucose", + "codes": [ + { + "system": "LOINC", + "code": "2345-7", + "display": "Glucose [Mass/volume] in Serum or Plasma" + } + ], + "unit": "mg/dL" + }, + { + "category": "laboratory", + "vital_sign": "Urea Nitrogen", + "codes": [ + { + "system": "LOINC", + "code": "3094-0", + "display": "Urea nitrogen [Mass/volume] in Serum or Plasma" + } + ], + "unit": "mg/dL" + }, { "category": "laboratory", "codes": [ { "system": "LOINC", - "code": "5792-7", - "display": "Glucose [Mass/volume] in Urine by Test strip" + "code": "2160-0", + "display": "Creatinine [Mass/volume] in Serum or Plasma" } ], "unit": "mg/dL", "range": { - "low": 0, - "high": 15 + "low": 1.5, + "high": 3 } }, { "category": "laboratory", - "unit": "{nominal}", + "vital_sign": "Calcium", "codes": [ { "system": "LOINC", - "code": "2514-8", - "display": "Ketones [Presence] in Urine by Test strip" + "code": "17861-6", + "display": "Calcium [Mass/volume] in Serum or Plasma" } ], - "value_code": { - "system": "SNOMED-CT", - "code": 167287002, - "display": "Urine ketone test negative (finding)" - } + "unit": "mg/dL" }, { "category": "laboratory", - "unit": "{nominal}", + "vital_sign": "Sodium", "codes": [ { "system": "LOINC", - "code": "5811-5", - "display": "Specific gravity of Urine by Test strip" + "code": "2951-2", + "display": "Sodium [Moles/volume] in Serum or Plasma" } ], - "range": { - "low": 1.005, - "high": 1.03 - } + "unit": "mmol/L" }, { "category": "laboratory", - "unit": "pH", + "vital_sign": "Potassium", "codes": [ { "system": "LOINC", - "code": "5803-2", - "display": "pH of Urine by Test strip" + "code": "2823-3", + "display": "Potassium [Moles/volume] in Serum or Plasma" } ], - "range": { - "low": 5, - "high": 7 - } + "unit": "mmol/L" }, { "category": "laboratory", - "unit": "mg/dL", + "vital_sign": "Chloride", + "codes": [ + { + "system": "LOINC", + "code": "2075-0", + "display": "Chloride [Moles/volume] in Serum or Plasma" + } + ], + "unit": "mmol/L" + }, + { + "category": "laboratory", + "vital_sign": "Carbon Dioxide", + "codes": [ + { + "system": "LOINC", + "code": "2028-9", + "display": "Carbon dioxide, total [Moles/volume] in Serum or Plasma" + } + ], + "unit": "mmol/L" + }, + { + "category": "laboratory", + "unit": "mL/min", "codes": [ { "system": "LOINC", - "code": "5804-0", - "display": "Protein [Mass/volume] in Urine by Test strip" + "code": "33914-3", + "display": "Glomerular filtration rate/1.73 sq M.predicted" } ], "range": { - "low": 0, + "low": 5, "high": 14 } }, { "category": "laboratory", - "unit": "{nominal}", + "unit": "g/dL", "codes": [ { "system": "LOINC", - "code": "5802-4", - "display": "Nitrite [Presence] in Urine by Test strip" + "code": "2885-2", + "display": "Protein [Mass/volume] in Serum or Plasma" } ], - "value_code": { - "system": "SNOMED-CT", - "code": 314137006, - "display": "Urine nitrite positive (finding)" + "range": { + "low": 6, + "high": 8.5 } }, { "category": "laboratory", - "unit": "{nominal}", + "unit": "g/dL", "codes": [ { "system": "LOINC", - "code": "5794-3", - "display": "Hemoglobin [Presence] in Urine by Test strip" + "code": "1751-7", + "display": "Albumin [Mass/volume] in Serum or Plasma" } ], - "value_code": { - "system": "SNOMED-CT", - "code": 167300001, - "display": "Urine blood test = + (finding)" + "range": { + "low": 4, + "high": 5 } }, { "category": "laboratory", - "unit": "{nominal}", + "unit": "mg/dL", "codes": [ { "system": "LOINC", - "code": "5799-2", - "display": "Leukocyte esterase [Presence] in Urine by Test strip" + "code": "1975-2", + "display": "Bilirubin.total [Mass/volume] in Serum or Plasma" } ], - "value_code": { - "system": "SNOMED-CT", - "code": 394712000, - "display": "Urine leukocyte test = + (finding)" + "range": { + "low": 6, + "high": 15 } - } - ], - "name": "Record_Urinalysis", - "complex_transition": [ + }, { - "condition": { - "condition_type": "Active Condition", - "codes": [ - { - "system": "SNOMED-CT", - "code": 45816000, - "display": "Pyelonephritis" - } - ] - }, - "distributions": [ - { - "transition": "Urine Culture", - "distribution": 0.95 - }, + "category": "laboratory", + "unit": "U/L", + "codes": [ { - "transition": "Terminal", - "distribution": 0.05 + "system": "LOINC", + "code": "6768-6", + "display": "Alkaline phosphatase [Enzymatic activity/volume] in Serum or Plasma" } - ] + ], + "range": { + "low": 39, + "high": 117 + } }, { - "condition": { - "condition_type": "Active Condition", - "codes": [ - { - "system": "SNOMED-CT", - "code": 307426000, - "display": "Acute infective cystitis (disorder)" - } - ] - }, - "distributions": [ - { - "transition": "Urine Culture", - "distribution": 0.55 - }, + "category": "laboratory", + "unit": "U/L", + "codes": [ { - "transition": "Terminal", - "distribution": 0.44999999999999996 + "system": "LOINC", + "code": "1742-6", + "display": "Alanine aminotransferase [Enzymatic activity/volume] in Serum or Plasma" } - ] + ], + "range": { + "low": 0, + "high": 44 + } }, { - "distributions": [], - "transition": "Terminal" - } - ] - }, - "Urinalysis Micro": { - "type": "Procedure", - "codes": [ - { - "system": "SNOMED-CT", - "code": 441550005, - "display": "Urinalysis with reflex to microscopy and culture (procedure)", - "value_set": "" + "category": "laboratory", + "unit": "U/L", + "codes": [ + { + "system": "LOINC", + "code": "1920-8", + "display": "Aspartate aminotransferase [Enzymatic activity/volume] in Serum or Plasma" + } + ], + "range": { + "low": 0, + "high": 40 + } } ], - "distribution": { - "kind": "EXACT", - "parameters": { - "value": 10 - } - }, - "unit": "minutes", - "direct_transition": "Record_Urinalysis_Micro", - "name": "Urinalysis Micro" + "name": "Comprehensive_Metabolic_Panel", + "direct_transition": "Blood Culture Check" }, - "Record_Urinalysis_Micro": { + "Comprehensive_Metabolic_Panel_with_Kidney_Damage": { "type": "DiagnosticReport", "codes": [ { "system": "LOINC", - "code": "24357-6", - "display": "Urinalysis macro (dipstick) panel - Urine", + "code": "24323-8", + "display": "Comprehensive metabolic 2000 panel - Serum or Plasma", "value_set": "" } ], "observations": [ { "category": "laboratory", + "vital_sign": "Glucose", "codes": [ { "system": "LOINC", - "code": "5792-7", - "display": "Glucose [Mass/volume] in Urine by Test strip" + "code": "2345-7", + "display": "Glucose [Mass/volume] in Serum or Plasma" } ], - "unit": "mg/dL", - "range": { - "low": 0, - "high": 15 - } + "unit": "mg/dL" }, { "category": "laboratory", - "unit": "{nominal}", + "vital_sign": "Urea Nitrogen", "codes": [ { "system": "LOINC", - "code": "2514-8", - "display": "Ketones [Presence] in Urine by Test strip" + "code": "3094-0", + "display": "Urea nitrogen [Mass/volume] in Serum or Plasma" } ], - "value_code": { - "system": "SNOMED-CT", - "code": 167287002, - "display": "Urine ketone test negative (finding)" - } + "unit": "mg/dL" }, { "category": "laboratory", - "unit": "{nominal}", "codes": [ { "system": "LOINC", - "code": "5811-5", - "display": "Specific gravity of Urine by Test strip" + "code": "2160-0", + "display": "Creatinine [Mass/volume] in Serum or Plasma" } ], + "unit": "mg/dL", "range": { - "low": 1.005, - "high": 1.03 + "low": 2.5, + "high": 3 } }, { "category": "laboratory", - "unit": "pH", + "vital_sign": "Calcium", "codes": [ { "system": "LOINC", - "code": "5803-2", - "display": "pH of Urine by Test strip" + "code": "17861-6", + "display": "Calcium [Mass/volume] in Serum or Plasma" } ], - "range": { - "low": 5, - "high": 7 - } + "unit": "mg/dL" }, { "category": "laboratory", - "unit": "mg/dL", + "vital_sign": "Sodium", "codes": [ { "system": "LOINC", - "code": "5804-0", - "display": "Protein [Mass/volume] in Urine by Test strip" + "code": "2951-2", + "display": "Sodium [Moles/volume] in Serum or Plasma" } ], - "range": { - "low": 0, - "high": 14 - } + "unit": "mmol/L" }, { "category": "laboratory", - "unit": "{nominal}", + "vital_sign": "Potassium", "codes": [ { "system": "LOINC", - "code": "5802-4", - "display": "Nitrite [Presence] in Urine by Test strip" + "code": "2823-3", + "display": "Potassium [Moles/volume] in Serum or Plasma" } ], - "value_code": { - "system": "SNOMED-CT", - "code": 314137006, - "display": "Urine nitrite positive (finding)" - } + "unit": "mmol/L" }, { "category": "laboratory", - "unit": "{nominal}", + "vital_sign": "Chloride", "codes": [ { "system": "LOINC", - "code": "5794-3", - "display": "Hemoglobin [Presence] in Urine by Test strip" + "code": "2075-0", + "display": "Chloride [Moles/volume] in Serum or Plasma" } ], - "value_code": { - "system": "SNOMED-CT", - "code": 167300001, - "display": "Urine blood test = + (finding)" - } + "unit": "mmol/L" }, { "category": "laboratory", - "unit": "{nominal}", + "vital_sign": "Carbon Dioxide", "codes": [ { "system": "LOINC", - "code": "5799-2", - "display": "Leukocyte esterase [Presence] in Urine by Test strip" + "code": "2028-9", + "display": "Carbon dioxide, total [Moles/volume] in Serum or Plasma" } ], - "value_code": { - "system": "SNOMED-CT", - "code": 394712000, - "display": "Urine leukocyte test = + (finding)" - } + "unit": "mmol/L" }, { "category": "laboratory", - "unit": "/[HPF]", + "unit": "mL/min", "codes": [ { "system": "LOINC", - "code": "5821-4", - "display": "WBCs" + "code": "33914-3", + "display": "Glomerular filtration rate/1.73 sq M.predicted" } ], "range": { - "low": 11, - "high": 50 + "low": 5, + "high": 14 } }, { "category": "laboratory", - "unit": "/[HPF]", + "unit": "g/dL", "codes": [ { "system": "LOINC", - "code": "13945-1", - "display": "RBCs" + "code": "2885-2", + "display": "Protein [Mass/volume] in Serum or Plasma" } ], "range": { - "low": 1, - "high": 3 + "low": 6, + "high": 8.5 } }, { "category": "laboratory", - "unit": "/[HPF]", + "unit": "g/dL", "codes": [ { "system": "LOINC", - "code": "5787-7", - "display": "Epithelial Cells" + "code": "1751-7", + "display": "Albumin [Mass/volume] in Serum or Plasma" } ], "range": { - "low": 0, - "high": 4 + "low": 4, + "high": 5 } }, { "category": "laboratory", - "unit": "{nominal}", + "unit": "mg/dL", "codes": [ { "system": "LOINC", - "code": "24124-0", - "display": "Casts" + "code": "1975-2", + "display": "Bilirubin.total [Mass/volume] in Serum or Plasma" } ], - "value_code": { - "system": "SNOMED-CT", - "code": 167336003, - "display": "Urine microscopy: no casts (finding)" + "range": { + "low": 6, + "high": 15 } }, { "category": "laboratory", - "unit": "{nominal}", + "unit": "U/L", "codes": [ { "system": "LOINC", - "code": "8247-9", - "display": "Mucus Threads" + "code": "6768-6", + "display": "Alkaline phosphatase [Enzymatic activity/volume] in Serum or Plasma" } ], - "value_code": { - "system": "SNOMED-CT", - "code": 276409005, - "display": "Mucus in urine (finding)" + "range": { + "low": 39, + "high": 117 } }, { "category": "laboratory", - "unit": "{nominal}", + "unit": "U/L", "codes": [ { "system": "LOINC", - "code": "5769-5", - "display": "Bacteria" + "code": "1742-6", + "display": "Alanine aminotransferase [Enzymatic activity/volume] in Serum or Plasma" } ], - "value_code": { - "system": "SNOMED-CT", - "code": 365691004, - "display": "Finding of presence of bacteria (finding)" + "range": { + "low": 0, + "high": 44 } - } - ], - "name": "Record_Urinalysis_Micro", - "direct_transition": "Urine Culture Result" - }, - "Urine Culture": { - "type": "Procedure", - "codes": [ - { - "system": "SNOMED-CT", - "code": 117010004, - "display": "Urine culture (procedure)", - "value_set": "" - } - ], - "distribution": { - "kind": "EXACT", - "parameters": { - "value": 10 - } - }, - "unit": "minutes", - "direct_transition": "Urine Culture Result", - "name": "Urine Culture" - }, - "Urine Culture Result": { - "type": "Simple", - "name": "Urine Culture Result", - "complex_transition": [ - { - "condition": { - "condition_type": "And", - "conditions": [ - { - "condition_type": "Attribute", - "attribute": "UTI_Ambulatory", - "operator": "is not nil" - }, - { - "condition_type": "Attribute", - "attribute": "UTI_Tx", - "operator": "is not nil" - } - ] - }, - "distributions": [ - { - "transition": "No Growth", - "distribution": 1 - } - ] }, { - "distributions": [ - { - "transition": "E Coli", - "distribution": 0.76 - }, - { - "transition": "Klebsiella", - "distribution": 0.09 - }, - { - "transition": "Enterococcus", - "distribution": 0.05 - }, - { - "transition": "Proteus", - "distribution": 0.04 - }, - { - "transition": "Pseudomonas", - "distribution": 0.02 - }, - { - "transition": "Klebsiella oxytoca", - "distribution": 0.01 - }, - { - "transition": "Citrobacter", - "distribution": 0.01 - }, + "category": "laboratory", + "unit": "U/L", + "codes": [ { - "transition": "Staphylococcus", - "distribution": 0.01 + "system": "LOINC", + "code": "1920-8", + "display": "Aspartate aminotransferase [Enzymatic activity/volume] in Serum or Plasma" } - ] - } - ] - }, - "E Coli": { - "type": "SetAttribute", - "attribute": "UTI_Bacteria", - "direct_transition": "Observe Bacteria", - "name": "E Coli", - "value": "Greater than 100,000 colony forming units per mL Escherichia coli" - }, - "Klebsiella": { - "type": "SetAttribute", - "attribute": "UTI_Bacteria", - "direct_transition": "Observe Bacteria", - "name": "Klebsiella", - "value": "Greater than 100,000 colony forming units per mL Klebsiella pneumoniae" - }, - "Enterococcus": { - "type": "SetAttribute", - "attribute": "UTI_Bacteria", - "direct_transition": "Observe Bacteria", - "name": "Enterococcus", - "value": "Greater than 100,000 colony forming units per mL Enterococcus faecalis" - }, - "Proteus": { - "type": "SetAttribute", - "attribute": "UTI_Bacteria", - "direct_transition": "Observe Bacteria", - "name": "Proteus", - "value": "Greater than 100,000 colony forming units per mL Proteus mirabilis" - }, - "Pseudomonas": { - "type": "SetAttribute", - "attribute": "UTI_Bacteria", - "direct_transition": "Observe Bacteria", - "name": "Pseudomonas", - "value": "Greater than 100,000 colony forming units per mL Pseudomonas aeruginosa" - }, - "Klebsiella oxytoca": { - "type": "SetAttribute", - "attribute": "UTI_Bacteria", - "direct_transition": "Observe Bacteria", - "name": "Klebsiella oxytoca", - "value": "Greater than 100,000 colony forming units per mL Klebsiella oxytoca" - }, - "Citrobacter": { - "type": "SetAttribute", - "attribute": "UTI_Bacteria", - "direct_transition": "Observe Bacteria", - "name": "Citrobacter", - "value": "Greater than 100,000 colony forming units per mL Citrobacter freundii complex" - }, - "Staphylococcus": { - "type": "SetAttribute", - "attribute": "UTI_Bacteria", - "direct_transition": "Observe Bacteria", - "name": "Staphylococcus", - "value": "Greater than 100,000 colony forming units per mL Staphylococcus aureus" - }, - "No Growth": { - "type": "Observation", - "category": "laboratory", - "unit": "", - "codes": [ - { - "system": "LOINC", - "code": "630-4", - "display": "Bacteria identified in Urine by Culture", - "value_set": "" - } - ], - "direct_transition": "Terminal", - "name": "No Growth", - "value_code": { - "system": "SNOMED-CT", - "code": 264868006, - "display": "No growth (qualifier value)" - } - }, - "Observe Bacteria": { - "type": "Observation", - "category": "laboratory", - "unit": "", - "codes": [ - { - "system": "LOINC", - "code": "630-4", - "display": "Bacteria identified in Urine by Culture", - "value_set": "" + ], + "range": { + "low": 0, + "high": 40 + } } ], - "direct_transition": "Terminal", - "name": "Observe Bacteria", - "attribute": "UTI_Bacteria" + "name": "Comprehensive_Metabolic_Panel_with_Kidney_Damage", + "direct_transition": "Blood Culture Check" } }, "gmf_version": 2 From 56942cdb35e10fa1311510a62a5d89671be07c6f Mon Sep 17 00:00:00 2001 From: Andy Gregorowicz Date: Fri, 10 Feb 2023 16:12:47 -0500 Subject: [PATCH 63/78] WIP: Implementing UTI antibiotics submodule --- src/main/resources/modules/uti/abx_tx.json | 1057 ++++++++++++++++++++ 1 file changed, 1057 insertions(+) create mode 100644 src/main/resources/modules/uti/abx_tx.json diff --git a/src/main/resources/modules/uti/abx_tx.json b/src/main/resources/modules/uti/abx_tx.json new file mode 100644 index 0000000000..3044f338e8 --- /dev/null +++ b/src/main/resources/modules/uti/abx_tx.json @@ -0,0 +1,1057 @@ +{ + "name": "Abx_Tx", + "remarks": [ + "A blank module" + ], + "states": { + "Initial": { + "type": "Initial", + "name": "Initial", + "conditional_transition": [ + { + "transition": "Female", + "condition": { + "condition_type": "Gender", + "gender": "F" + } + }, + { + "transition": "Male", + "condition": { + "condition_type": "Gender", + "gender": "M" + } + } + ] + }, + "Terminal": { + "type": "Terminal", + "name": "Terminal" + }, + "Male": { + "type": "Simple", + "name": "Male", + "conditional_transition": [ + { + "transition": "Male with Pyelo", + "condition": { + "condition_type": "Active Condition", + "codes": [ + { + "system": "SNOMED-CT", + "code": 45816000, + "display": "Pyelonephritis" + } + ] + } + }, + { + "transition": "Male with Cystitis", + "condition": { + "condition_type": "Active Condition", + "codes": [ + { + "system": "SNOMED-CT", + "code": 307426000, + "display": "Acute infective cystitis (disorder)" + } + ] + } + } + ] + }, + "Female": { + "type": "Simple", + "name": "Female", + "conditional_transition": [ + { + "transition": "Pregnant Female with Cystitis", + "condition": { + "condition_type": "And", + "conditions": [ + { + "condition_type": "Attribute", + "attribute": "GU_pregnancy_check", + "operator": "is not nil" + }, + { + "condition_type": "Attribute", + "attribute": "pregnancy", + "operator": "==", + "value": true + } + ] + } + }, + { + "transition": "Female_with_Cystitis", + "condition": { + "condition_type": "Active Condition", + "codes": [ + { + "system": "SNOMED-CT", + "code": 307426000, + "display": "Acute infective cystitis (disorder)" + } + ] + } + }, + { + "transition": "Female with Pyelo", + "condition": { + "condition_type": "Active Condition", + "codes": [ + { + "system": "SNOMED-CT", + "code": 45816000, + "display": "Pyelonephritis" + } + ] + } + } + ] + }, + "Male with Pyelo": { + "type": "Simple", + "name": "Male with Pyelo", + "complex_transition": [ + { + "condition": { + "condition_type": "And", + "conditions": [ + { + "condition_type": "Active Allergy", + "codes": [ + { + "system": "RxNorm", + "code": "7984", + "display": "Penicillin V" + } + ] + }, + { + "condition_type": "Active Allergy", + "codes": [ + { + "system": "RxNorm", + "code": 10831, + "display": "Sulfamethoxazole / Trimethoprim" + } + ] + } + ] + }, + "distributions": [ + { + "transition": "Cipro_500 7 day", + "distribution": 0.55 + }, + { + "transition": "Cepha 10 day", + "distribution": 0.24 + }, + { + "transition": "Cefpo 200", + "distribution": 0.20999999999999996 + } + ] + }, + { + "distributions": [ + { + "transition": "Sulfa 10 day", + "distribution": 0.05 + }, + { + "transition": "AmxClav 875, 10 day", + "distribution": 0.05 + }, + { + "transition": "Cipro_500 7 day", + "distribution": 0.5 + }, + { + "transition": "Cepha 5 day", + "distribution": 0.22 + }, + { + "transition": "Cefpo 200", + "distribution": 0.18 + } + ] + } + ] + }, + "Male with Cystitis": { + "type": "Simple", + "name": "Male with Cystitis", + "complex_transition": [ + { + "condition": { + "condition_type": "At Least", + "minimum": 1, + "conditions": [ + { + "condition_type": "Attribute", + "attribute": "ckd", + "operator": ">=", + "value": 4 + }, + { + "condition_type": "Active Allergy", + "codes": [ + { + "system": "RxNorm", + "code": "7984", + "display": "Penicillin V" + } + ] + }, + { + "condition_type": "Active Allergy", + "codes": [ + { + "system": "RxNorm", + "code": 10831, + "display": "Sulfamethoxazole / Trimethoprim" + } + ] + } + ] + }, + "distributions": [ + { + "transition": "Cepha 7 day", + "distribution": 0.1667 + }, + { + "transition": "Cipro 500, 5 day", + "distribution": 0.8332999999999999 + } + ] + }, + { + "distributions": [ + { + "transition": "Nitro 7 day", + "distribution": 0.08 + }, + { + "transition": "Sulfa 7 day", + "distribution": 0.21 + }, + { + "transition": "AmxClav 875, 7 day", + "distribution": 0.05 + }, + { + "transition": "Cepha 7 day", + "distribution": 0.11 + }, + { + "transition": "Cipro 500, 5 day", + "distribution": 0.55 + } + ] + } + ] + }, + "Nitro 5 day": { + "type": "MedicationOrder", + "codes": [ + { + "system": "RxNorm", + "code": 1648755, + "display": "nitrofurantoin, macrocrystals 25 MG / nitrofurantoin, monohydrate 75 MG Oral Capsule", + "value_set": "" + } + ], + "direct_transition": "ED Check", + "name": "Nitro 5 day", + "assign_to_attribute": "UTI_Tx", + "prescription": { + "dosage": { + "amount": 1, + "frequency": 2, + "period": 1, + "unit": "days" + }, + "duration": { + "quantity": 5, + "unit": "days" + } + } + }, + "Nitro 7 day": { + "type": "MedicationOrder", + "codes": [ + { + "system": "RxNorm", + "code": 1648756, + "display": "nitrofurantoin, macrocrystals 25 MG / nitrofurantoin, monohydrate 75 MG Oral Capsule", + "value_set": "" + } + ], + "name": "Nitro 7 day", + "assign_to_attribute": "UTI_Tx", + "prescription": { + "dosage": { + "amount": 1, + "frequency": 2, + "period": 1, + "unit": "days" + }, + "duration": { + "quantity": 7, + "unit": "days" + } + }, + "direct_transition": "ED Check" + }, + "Fosfo": { + "type": "MedicationOrder", + "codes": [ + { + "system": "RxNorm", + "code": 808917, + "display": "fosfomycin 3000 MG Powder", + "value_set": "" + } + ], + "name": "Fosfo", + "prescription": { + "dosage": { + "amount": 1, + "frequency": 1, + "period": 1, + "unit": "days" + }, + "duration": { + "quantity": 1, + "unit": "days" + } + }, + "assign_to_attribute": "UTI_Tx", + "direct_transition": "ED Check" + }, + "Sulfa 3 day": { + "type": "MedicationOrder", + "codes": [ + { + "system": "RxNorm", + "code": 198335, + "display": "sulfamethoxazole 800 MG / trimethoprim 160 MG Oral Tablet", + "value_set": "" + } + ], + "name": "Sulfa 3 day", + "prescription": { + "dosage": { + "amount": 1, + "frequency": 1, + "period": 2, + "unit": "days" + }, + "duration": { + "quantity": 3, + "unit": "days" + } + }, + "direct_transition": "ED Check", + "assign_to_attribute": "UTI_Tx" + }, + "Sulfa 7 day": { + "type": "MedicationOrder", + "codes": [ + { + "system": "RxNorm", + "code": 198335, + "display": "sulfamethoxazole 800 MG / trimethoprim 160 MG Oral Tablet", + "value_set": "" + } + ], + "name": "Sulfa 7 day", + "prescription": { + "dosage": { + "amount": 1, + "frequency": 1, + "period": 2, + "unit": "days" + }, + "duration": { + "quantity": 7, + "unit": "days" + } + }, + "direct_transition": "ED Check", + "assign_to_attribute": "UTI_Tx" + }, + "Sulfa 10 day": { + "type": "MedicationOrder", + "codes": [ + { + "system": "RxNorm", + "code": 198335, + "display": "sulfamethoxazole 800 MG / trimethoprim 160 MG Oral Tablet", + "value_set": "" + } + ], + "name": "Sulfa 10 day", + "prescription": { + "dosage": { + "amount": 1, + "frequency": 1, + "period": 2, + "unit": "days" + }, + "duration": { + "quantity": 10, + "unit": "days" + } + }, + "direct_transition": "ED Check", + "assign_to_attribute": "UTI_Tx" + }, + "AmxClav 500, 5 day": { + "type": "MedicationOrder", + "codes": [ + { + "system": "RxNorm", + "code": 617296, + "display": "amoxicillin 500 MG / clavulanate 125 MG Oral Tablet", + "value_set": "" + } + ], + "name": "AmxClav 500, 5 day", + "assign_to_attribute": "UTI_Tx", + "direct_transition": "ED Check" + }, + "AmxClav 875, 7 day": { + "type": "MedicationOrder", + "codes": [ + { + "system": "RxNorm", + "code": 562508, + "display": "amoxicillin 875 MG / clavulanate 125 MG Oral Tablet", + "value_set": "" + } + ], + "name": "AmxClav 875, 7 day", + "assign_to_attribute": "UTI_Tx", + "prescription": { + "dosage": { + "amount": 1, + "frequency": 2, + "period": 1, + "unit": "days" + }, + "duration": { + "quantity": 7, + "unit": "days" + } + }, + "direct_transition": "ED Check" + }, + "AmxClav 875, 10 day": { + "type": "MedicationOrder", + "codes": [ + { + "system": "RxNorm", + "code": 562508, + "display": "amoxicillin 875 MG / clavulanate 125 MG Oral Tablet", + "value_set": "" + } + ], + "name": "AmxClav 875, 10 day", + "assign_to_attribute": "UTI_Tx", + "prescription": { + "dosage": { + "amount": 1, + "frequency": 2, + "period": 1, + "unit": "days" + }, + "duration": { + "quantity": 10, + "unit": "days" + } + }, + "direct_transition": "ED Check" + }, + "Amox 7 day": { + "type": "MedicationOrder", + "codes": [ + { + "system": "RxNorm", + "code": 308192, + "display": "amoxicillin 500 MG Oral Tablet", + "value_set": "" + } + ], + "name": "Amox 7 day", + "assign_to_attribute": "UTI_Tx", + "prescription": { + "dosage": { + "amount": 1, + "frequency": 3, + "period": 1, + "unit": "days" + }, + "duration": { + "quantity": 7, + "unit": "days" + } + }, + "direct_transition": "ED Check" + }, + "Cepha 5 day": { + "type": "MedicationOrder", + "codes": [ + { + "system": "RxNorm", + "code": 197454, + "display": "cephalexin 500 MG Oral Tablet", + "value_set": "" + } + ], + "name": "Cepha 5 day", + "assign_to_attribute": "UTI_Tx", + "prescription": { + "dosage": { + "amount": 1, + "frequency": 2, + "period": 1, + "unit": "days" + }, + "duration": { + "quantity": 5, + "unit": "days" + } + }, + "direct_transition": "ED Check" + }, + "Cepha 10 day": { + "type": "MedicationOrder", + "codes": [ + { + "system": "RxNorm", + "code": 197454, + "display": "cephalexin 500 MG Oral Tablet", + "value_set": "" + } + ], + "name": "Cepha 10 day", + "assign_to_attribute": "UTI_Tx", + "prescription": { + "dosage": { + "amount": 1, + "frequency": 4, + "period": 1, + "unit": "days" + }, + "duration": { + "quantity": 10, + "unit": "days" + } + }, + "direct_transition": "ED Check" + }, + "Cepha 7 day": { + "type": "MedicationOrder", + "codes": [ + { + "system": "RxNorm", + "code": 197454, + "display": "cephalexin 500 MG Oral Tablet", + "value_set": "" + } + ], + "name": "Cepha 7 day", + "assign_to_attribute": "UTI_Tx", + "prescription": { + "dosage": { + "amount": 1, + "frequency": 4, + "period": 1, + "unit": "days" + }, + "duration": { + "quantity": 7, + "unit": "days" + } + }, + "direct_transition": "ED Check" + }, + "Cipro 250, 3 day": { + "type": "MedicationOrder", + "codes": [ + { + "system": "RxNorm", + "code": 197511, + "display": "ciprofloxacin 250 MG Oral Tablet", + "value_set": "" + } + ], + "name": "Cipro 250, 3 day", + "assign_to_attribute": "UTI_Tx", + "prescription": { + "dosage": { + "amount": 1, + "frequency": 1, + "period": 2, + "unit": "days" + }, + "duration": { + "quantity": 3, + "unit": "days" + } + }, + "direct_transition": "ED Check" + }, + "Cipro 500, 5 day": { + "type": "MedicationOrder", + "codes": [ + { + "system": "RxNorm", + "code": 309309, + "display": "ciprofloxacin 500 MG Oral Tablet", + "value_set": "" + } + ], + "name": "Cipro 500, 5 day", + "assign_to_attribute": "UTI_Tx", + "prescription": { + "dosage": { + "amount": 1, + "frequency": 2, + "period": 1, + "unit": "days" + }, + "duration": { + "quantity": 5, + "unit": "days" + } + }, + "direct_transition": "ED Check" + }, + "Cipro_500 7 day": { + "type": "MedicationOrder", + "codes": [ + { + "system": "RxNorm", + "code": 309309, + "display": "ciprofloxacin 500 MG Oral Tablet", + "value_set": "" + } + ], + "name": "Cipro_500 7 day", + "assign_to_attribute": "UTI_Tx", + "prescription": { + "dosage": { + "amount": 1, + "frequency": 2, + "period": 1, + "unit": "days" + }, + "duration": { + "quantity": 7, + "unit": "days" + } + }, + "direct_transition": "ED Check" + }, + "Cefpo 100": { + "type": "MedicationOrder", + "codes": [ + { + "system": "RxNorm", + "code": 309076, + "display": "cefpodoxime 100 MG Oral Tablet", + "value_set": "" + } + ], + "name": "Cefpo 100", + "assign_to_attribute": "UTI_Tx", + "prescription": { + "dosage": { + "amount": 1, + "frequency": 2, + "period": 1, + "unit": "days" + }, + "duration": { + "quantity": 5, + "unit": "days" + } + }, + "direct_transition": "ED Check" + }, + "Cefpo 200": { + "type": "MedicationOrder", + "codes": [ + { + "system": "RxNorm", + "code": 309078, + "display": "cefpodoxime 200 MG Oral Tablet", + "value_set": "" + } + ], + "name": "Cefpo 200", + "assign_to_attribute": "UTI_Tx", + "prescription": { + "dosage": { + "amount": 1, + "frequency": 2, + "period": 1, + "unit": "days" + }, + "duration": { + "quantity": 10, + "unit": "days" + } + }, + "direct_transition": "ED Check" + }, + "Ceftriaxone": { + "type": "MedicationOrder", + "codes": [ + { + "system": "RxNorm", + "code": 1665021, + "display": "ceftriaxone 1000 MG Injection", + "value_set": "" + } + ], + "name": "Ceftriaxone", + "assign_to_attribute": "UTI_Tx", + "prescription": { + "dosage": { + "amount": 1, + "frequency": 1, + "period": 1, + "unit": "days" + }, + "duration": { + "quantity": 1, + "unit": "days" + } + }, + "direct_transition": "Terminal" + }, + "ED Check": { + "type": "Simple", + "name": "ED Check", + "complex_transition": [ + { + "condition": { + "condition_type": "And", + "conditions": [ + { + "condition_type": "Attribute", + "attribute": "UTI_ED", + "operator": "==", + "value": true + }, + { + "condition_type": "Active Condition", + "codes": [ + { + "system": "SNOMED-CT", + "code": 45816000, + "display": "Pyelonephritis" + } + ] + } + ] + }, + "distributions": [ + { + "transition": "ED and Pyelo", + "distribution": 0.75 + }, + { + "transition": "Terminal", + "distribution": 1 + } + ] + } + ] + }, + "Female_with_Cystitis": { + "type": "Simple", + "name": "Female_with_Cystitis", + "complex_transition": [ + { + "condition": { + "condition_type": "At Least", + "minimum": 1, + "conditions": [ + { + "condition_type": "Attribute", + "attribute": "ckd", + "operator": ">=", + "value": 4 + }, + { + "condition_type": "Active Allergy", + "codes": [ + { + "system": "RxNorm", + "code": "7984", + "display": "Penicillin V" + } + ] + }, + { + "condition_type": "Active Allergy", + "codes": [ + { + "system": "RxNorm", + "code": 10831, + "display": "Sulfamethoxazole / Trimethoprim" + } + ] + } + ] + }, + "distributions": [ + { + "transition": "Fosfo", + "distribution": 0.075 + }, + { + "transition": "Cepha 5 day", + "distribution": 0.475 + }, + { + "transition": "Cipro 250, 3 day", + "distribution": 0.4500000000000002 + } + ] + }, + { + "distributions": [ + { + "transition": "Nitro 5 day", + "distribution": 0.4 + }, + { + "transition": "Fosfo", + "distribution": 0.03 + }, + { + "transition": "Sulfa 3 day", + "distribution": 0.12 + }, + { + "transition": "AmxClav 500, 5 day", + "distribution": 0.08 + }, + { + "transition": "Cepha 5 day", + "distribution": 0.19 + }, + { + "transition": "Cipro 250, 3 day", + "distribution": 0.17999999999999994 + } + ] + } + ] + }, + "Pregnant Female with Cystitis": { + "type": "Simple", + "complex_transition": [ + { + "condition": { + "condition_type": "At Least", + "minimum": 1, + "conditions": [ + { + "condition_type": "Attribute", + "attribute": "ckd", + "operator": ">=", + "value": 4 + }, + { + "condition_type": "Active Allergy", + "codes": [ + { + "system": "RxNorm", + "code": "7984", + "display": "Penicillin V" + } + ] + }, + { + "condition_type": "Active Allergy", + "codes": [ + { + "system": "RxNorm", + "code": 10831, + "display": "Sulfamethoxazole / Trimethoprim" + } + ] + } + ] + }, + "distributions": [ + { + "transition": "Cepha 7 day", + "distribution": 0.5 + }, + { + "transition": "Cefpo 100", + "distribution": 0.5 + } + ] + }, + { + "distributions": [ + { + "transition": "Nitro 5 day", + "distribution": 0.05 + }, + { + "transition": "Amox 7 day", + "distribution": 0.12 + }, + { + "transition": "AmxClav 875, 7 day", + "distribution": 0.26 + }, + { + "transition": "Cepha 7 day", + "distribution": 0.26 + }, + { + "transition": "Cefpo 100", + "distribution": 0.26 + }, + { + "transition": "Sulfa 3 day", + "distribution": 0.05 + } + ] + } + ], + "name": "Pregnant Female with Cystitis" + }, + "Female with Pyelo": { + "type": "Simple", + "name": "Female with Pyelo", + "complex_transition": [ + { + "condition": { + "condition_type": "At Least", + "minimum": 1, + "conditions": [ + { + "condition_type": "Attribute", + "attribute": "ckd", + "operator": ">=", + "value": 4 + }, + { + "condition_type": "Active Allergy", + "codes": [ + { + "system": "RxNorm", + "code": "7984", + "display": "Penicillin V" + } + ] + }, + { + "condition_type": "Active Allergy", + "codes": [ + { + "system": "RxNorm", + "code": 10831, + "display": "Sulfamethoxazole / Trimethoprim" + } + ] + } + ] + }, + "distributions": [ + { + "transition": "Cipro 500, 5 day", + "distribution": 0.231 + }, + { + "transition": "Cepha 10 day", + "distribution": 0.41 + }, + { + "transition": "Cefpo 200", + "distribution": 0.359 + } + ] + }, + { + "distributions": [ + { + "transition": "Sulfa 10 day", + "distribution": 0.1 + }, + { + "transition": "AmxClav 875, 10 day", + "distribution": 0.12 + }, + { + "transition": "Cipro_500 7 day", + "distribution": 0.18 + }, + { + "transition": "Cepha 10 day", + "distribution": 0.32 + }, + { + "transition": "Cefpo 200", + "distribution": 0.28 + } + ] + } + ] + }, + "ED and Pyelo": { + "type": "Simple", + "conditional_transition": [ + { + "transition": "Terminal", + "condition": { + "condition_type": "Or", + "conditions": [ + { + "condition_type": "Active Medication", + "codes": [ + { + "system": "RxNorm", + "code": 197511, + "display": "Cipro 250" + } + ] + }, + { + "condition_type": "Active Medication", + "codes": [ + { + "system": "RxNorm", + "code": 309309, + "display": "Cipro 500" + } + ] + } + ] + } + }, + { + "transition": "Ceftriaxone" + } + ], + "name": "ED and Pyelo" + } + }, + "gmf_version": 2 +} \ No newline at end of file From db2d47c7a86706bf913c4c5ac2a56fa357911f85 Mon Sep 17 00:00:00 2001 From: Andy Gregorowicz Date: Thu, 16 Feb 2023 09:48:14 -0500 Subject: [PATCH 64/78] WIP: UTI update cleanup and debugging --- .../modules/urinary_tract_infections.json | 184 +- src/main/resources/modules/uti/ed_bundle.json | 2 +- src/main/resources/modules/uti/labs.json | 2060 ++++------------- 3 files changed, 569 insertions(+), 1677 deletions(-) diff --git a/src/main/resources/modules/urinary_tract_infections.json b/src/main/resources/modules/urinary_tract_infections.json index 157bdc5c1b..7b63deaa20 100644 --- a/src/main/resources/modules/urinary_tract_infections.json +++ b/src/main/resources/modules/urinary_tract_infections.json @@ -40,29 +40,23 @@ "Urinary Tract Infection": { "type": "Simple", "name": "Urinary Tract Infection", - "lookup_table_transition": { - "type": "Table", - "transitions": [ - { - "transition": "Cystitis", - "default_probability": 0.1, - "lookup_table_name": "uti.csv" - }, - { - "transition": "Pyelonephritis", - "default_probability": 0.1, - "lookup_table_name": "uti.csv" - }, - { - "transition": "Wait_for_UTI", - "default_probability": 0.8, - "lookup_table_name": "uti.csv" - } - ], - "lookup_table_name_ModuleBuilder": "uti.csv", - "viewTable": false, - "lookuptable": "" - } + "lookup_table_transition": [ + { + "transition": "Cystitis", + "default_probability": 0.1, + "lookup_table_name": "uti.csv" + }, + { + "transition": "Pyelonephritis", + "default_probability": 0.1, + "lookup_table_name": "uti.csv" + }, + { + "transition": "Wait_for_UTI", + "default_probability": 0.8, + "lookup_table_name": "uti.csv" + } + ] }, "Cystitis": { "type": "ConditionOnset", @@ -133,7 +127,7 @@ }, "UTI Telemed Sub": { "type": "CallSubmodule", - "submodule": "UTI Telemed Submodule", + "submodule": "UTI_Telemed", "direct_transition": "Time Delay", "name": "UTI Telemed Sub" }, @@ -157,8 +151,148 @@ } }, "unit": "hours", - "direct_transition": "Terminal", + "direct_transition": "Clear ESI", "name": "Time Delay" + }, + "End UTI Tx": { + "type": "MedicationEnd", + "name": "End UTI Tx", + "referenced_by_attribute": "UTI_Tx", + "distributed_transition": [ + { + "transition": "End UTI", + "distribution": 0.86 + }, + { + "transition": "Care Pathways", + "distribution": 0.14 + } + ] + }, + "Clear ESI": { + "type": "SetAttribute", + "attribute": "esi", + "direct_transition": "Clear BldCx", + "name": "Clear ESI" + }, + "Clear BldCx": { + "type": "SetAttribute", + "attribute": "UTI_Positive_BldCx", + "direct_transition": "Clear UTI ED", + "name": "Clear BldCx" + }, + "Clear UTI ED": { + "type": "SetAttribute", + "attribute": "UTI_ED", + "direct_transition": "Clear UTI_Care_Referral", + "name": "Clear UTI ED" + }, + "Clear UTI_Care_Referral": { + "type": "SetAttribute", + "attribute": "UTI_Care_Referral", + "direct_transition": "Clear UTI_Lab_SendOut", + "name": "Clear UTI_Care_Referral" + }, + "Clear UTI_Lab_SendOut": { + "type": "SetAttribute", + "attribute": "UTI_Lab_SendOut", + "direct_transition": "Clear GU_Pregnancy_Check", + "name": "Clear UTI_Lab_SendOut" + }, + "Clear GU_Pregnancy_Check": { + "type": "SetAttribute", + "attribute": "GU_Pregnancy_Check", + "direct_transition": "Clear UTI_Labs", + "name": "Clear GU_Pregnancy_Check" + }, + "Clear UTI_Labs": { + "type": "SetAttribute", + "attribute": "UTI_Labs", + "direct_transition": "Clear UTI_Bacteria", + "name": "Clear UTI_Labs" + }, + "Clear UTI_Bacteria": { + "type": "SetAttribute", + "attribute": "UTI_Bacteria", + "direct_transition": "Clear UTI_Telemed", + "name": "Clear UTI_Bacteria" + }, + "Clear UTI_Telemed": { + "type": "SetAttribute", + "attribute": "UTI_Telemed", + "direct_transition": "Clear UTI_Ambulatory", + "name": "Clear UTI_Telemed" + }, + "Clear UTI_Ambulatory": { + "type": "SetAttribute", + "attribute": "UTI_Ambulatory", + "direct_transition": "End UTI Tx", + "name": "Clear UTI_Ambulatory" + }, + "End UTI": { + "type": "ConditionEnd", + "name": "End UTI", + "referenced_by_attribute": "uti", + "complex_transition": [ + { + "condition": { + "condition_type": "Gender", + "gender": "F" + }, + "distributions": [ + { + "transition": "Recurrence Delay", + "distribution": 0.096 + }, + { + "transition": "Terminal", + "distribution": 0.9039999999999999 + } + ] + }, + { + "condition": { + "condition_type": "Gender", + "gender": "M" + }, + "distributions": [ + { + "transition": "Recurrence Delay", + "distribution": 0.05 + }, + { + "transition": "Terminal", + "distribution": 0.95 + } + ] + } + ] + }, + "Recurrence Delay": { + "type": "Delay", + "distribution": { + "kind": "UNIFORM", + "parameters": { + "high": 6, + "low": 3 + } + }, + "unit": "months", + "direct_transition": "Recurrent UTI", + "name": "Recurrence Delay" + }, + "Recurrent UTI": { + "type": "ConditionOnset", + "codes": [ + { + "system": "SNOMED-CT", + "code": 197927001, + "display": "Recurrent urinary tract infection (disorder)", + "value_set": "" + } + ], + "direct_transition": "Care Pathways", + "name": "Recurrent UTI" } }, "gmf_version": 2 diff --git a/src/main/resources/modules/uti/ed_bundle.json b/src/main/resources/modules/uti/ed_bundle.json index 8062225791..a6c3dbfbab 100644 --- a/src/main/resources/modules/uti/ed_bundle.json +++ b/src/main/resources/modules/uti/ed_bundle.json @@ -1374,7 +1374,7 @@ }, "Labs Submodule": { "type": "CallSubmodule", - "submodule": "uti_labs", + "submodule": "UTI_Labs", "direct_transition": "Terminal", "name": "Labs Submodule" }, diff --git a/src/main/resources/modules/uti/labs.json b/src/main/resources/modules/uti/labs.json index 7b998ece11..0f8cf93e45 100644 --- a/src/main/resources/modules/uti/labs.json +++ b/src/main/resources/modules/uti/labs.json @@ -1,1411 +1,25 @@ { - "name": "ED_UTI_Bundle", + "name": "UTI_Labs", "remarks": [ "A blank module" ], "states": { "Initial": { "type": "Initial", - "direct_transition": "Triage", + "direct_transition": "Collection", "name": "Initial" }, "Terminal": { "type": "Terminal", "name": "Terminal" }, - "Triage": { + "Collection": { "type": "Procedure", "codes": [ { "system": "SNOMED-CT", - "code": 386478007, - "display": "Triage emergency center (procedure)", - "value_set": "" - } - ], - "distribution": { - "kind": "EXACT", - "parameters": { - "value": 15 - } - }, - "unit": "minutes", - "direct_transition": "Vitals", - "name": "Triage" - }, - "Vitals": { - "type": "Procedure", - "codes": [ - { - "system": "SNOMED-CT", - "code": 61746007, - "display": "Taking patient vital signs (procedure)", - "value_set": "" - } - ], - "distribution": { - "kind": "EXACT", - "parameters": { - "value": 5 - } - }, - "unit": "minutes", - "name": "Vitals", - "conditional_transition": [ - { - "transition": "Pyelo", - "condition": { - "condition_type": "Active Condition", - "codes": [ - { - "system": "SNOMED-CT", - "code": 45816000, - "display": "Pyelonephritis" - } - ] - } - }, - { - "transition": "Cystitis", - "condition": { - "condition_type": "Active Condition", - "codes": [ - { - "system": "SNOMED-CT", - "code": 307426000, - "display": "Acute infective cystitis (disorder)" - } - ] - } - } - ] - }, - "Cystitis": { - "type": "Simple", - "name": "Cystitis", - "distributed_transition": [ - { - "transition": "ESI-3", - "distribution": 0.2 - }, - { - "transition": "ESI-4", - "distribution": 0.7 - }, - { - "transition": "ESI-5", - "distribution": 0.1 - } - ] - }, - "Pyelo": { - "type": "Simple", - "name": "Pyelo", - "complex_transition": [ - { - "condition": { - "condition_type": "Or", - "conditions": [ - { - "condition_type": "Attribute", - "attribute": "ckd", - "operator": ">=", - "value": 1 - }, - { - "condition_type": "Attribute", - "attribute": "diabetes", - "operator": "==", - "value": true - } - ] - }, - "distributions": [ - { - "transition": "ESI-1", - "distribution": 0.007 - }, - { - "transition": "ESI-2", - "distribution": 0.062 - }, - { - "transition": "ESI-3", - "distribution": 0.931 - } - ] - }, - { - "distributions": [ - { - "transition": "ESI-1", - "distribution": 0.006 - }, - { - "transition": "ESI-2", - "distribution": 0.054 - }, - { - "transition": "ESI-3", - "distribution": 0.8 - }, - { - "transition": "ESI-4", - "distribution": 0.1 - } - ] - } - ] - }, - "ESI-1": { - "type": "Observation", - "category": "exam", - "unit": "", - "codes": [ - { - "system": "LOINC", - "code": "75636-1", - "display": "Emergency severity index", - "value_set": "" - } - ], - "direct_transition": "ESI_State 1", - "name": "ESI-1", - "value_code": { - "system": "LOINC", - "code": "LA21567-5", - "display": "Requires immediate life-saving intervention" - } - }, - "ESI-2": { - "type": "Observation", - "category": "exam", - "unit": "", - "codes": [ - { - "system": "LOINC", - "code": "75636-1", - "display": "Emergency severity index", - "value_set": "" - } - ], - "name": "ESI-2", - "value_code": { - "system": "LOINC", - "code": "LA21752-3", - "display": "High risk or confused/lethargic/disoriented or severe pain/distress" - }, - "direct_transition": "ESI_State 2" - }, - "ESI-3": { - "type": "Observation", - "category": "exam", - "unit": "", - "codes": [ - { - "system": "LOINC", - "code": "75636-1", - "display": "Emergency severity index", - "value_set": "" - } - ], - "name": "ESI-3", - "value_code": { - "system": "LOINC", - "code": "LA21753-1", - "display": "Needs 2 or more resources" - }, - "direct_transition": "ESI_State 3" - }, - "ESI-4": { - "type": "Observation", - "category": "exam", - "unit": "", - "codes": [ - { - "system": "LOINC", - "code": "75636-1", - "display": "Emergency severity index", - "value_set": "" - } - ], - "name": "ESI-4", - "value_code": { - "system": "LOINC", - "code": "LA21754-9", - "display": "Needs 1 resource" - }, - "direct_transition": "ESI_State 4" - }, - "ESI-5": { - "type": "Observation", - "category": "exam", - "unit": "", - "codes": [ - { - "system": "LOINC", - "code": "75636-1", - "display": "Emergency severity index", - "value_set": "" - } - ], - "name": "ESI-5", - "value_code": { - "system": "LOINC", - "code": "LA21755-6", - "display": "Needs no resources" - }, - "direct_transition": "ESI State 5" - }, - "Record_BP_4_5": { - "type": "MultiObservation", - "category": "vital-signs", - "codes": [ - { - "system": "LOINC", - "code": "85354-9", - "display": "Blood Pressure", - "value_set": "" - } - ], - "observations": [ - { - "category": "vital-signs", - "codes": [ - { - "system": "LOINC", - "code": "8480-6", - "display": "Systolic Blood Pressure" - } - ], - "unit": "mm[Hg]", - "range": { - "low": 110, - "high": 160 - } - }, - { - "category": "vital-signs", - "codes": [ - { - "system": "LOINC", - "code": "8462-4", - "display": "Diastolic Blood Pressure" - } - ], - "unit": "mm[Hg]", - "range": { - "low": 60, - "high": 100 - } - } - ], - "name": "Record_BP_4_5", - "direct_transition": "Record_Heart_Rate_4_5" - }, - "Record_BP_3": { - "type": "MultiObservation", - "category": "vital-signs", - "codes": [ - { - "system": "LOINC", - "code": "85354-9", - "display": "Blood Pressure", - "value_set": "" - } - ], - "observations": [ - { - "category": "vital-signs", - "codes": [ - { - "system": "LOINC", - "code": "8480-6", - "display": "Systolic Blood Pressure" - } - ], - "unit": "mm[Hg]", - "range": { - "low": 110, - "high": 180 - } - }, - { - "category": "vital-signs", - "codes": [ - { - "system": "LOINC", - "code": "8462-4", - "display": "Diastolic Blood Pressure" - } - ], - "unit": "mm[Hg]", - "range": { - "low": 60, - "high": 110 - } - } - ], - "name": "Record_BP_3", - "direct_transition": "Record_Heart_Rate_3" - }, - "Record_Heart_Rate_4_5": { - "type": "Observation", - "category": "vital-signs", - "unit": "/min", - "codes": [ - { - "system": "LOINC", - "code": "8867-4", - "display": "Heart rate", - "value_set": "" - } - ], - "name": "Record_Heart_Rate_4_5", - "direct_transition": "Record_Respiratory_Rate_4_5", - "range": { - "low": 60, - "high": 99 - } - }, - "Record_Respiratory_Rate_4_5": { - "type": "Observation", - "category": "vital-signs", - "unit": "/min", - "codes": [ - { - "system": "LOINC", - "code": "9279-1", - "display": "Respiratory rate", - "value_set": "" - } - ], - "name": "Record_Respiratory_Rate_4_5", - "direct_transition": "O2_4_5", - "range": { - "low": 12, - "high": 20 - } - }, - "O2_4_5": { - "type": "Observation", - "category": "vital-signs", - "unit": "%", - "codes": [ - { - "system": "LOINC", - "code": "2708-6", - "display": "Oxygen saturation in Arterial blood", - "value_set": "" - } - ], - "distribution": { - "kind": "UNIFORM", - "round": false, - "parameters": { - "high": 100, - "low": 99 - } - }, - "direct_transition": "Take_Temperature_4_5", - "name": "O2_4_5" - }, - "Record_Heart_Rate_3": { - "type": "Observation", - "category": "vital-signs", - "unit": "/min", - "codes": [ - { - "system": "LOINC", - "code": "8867-4", - "display": "Heart rate", - "value_set": "" - } - ], - "name": "Record_Heart_Rate_3", - "range": { - "low": 60, - "high": 99 - }, - "direct_transition": "Record_Respiratory_Rate_3" - }, - "Record_Respiratory_Rate_3": { - "type": "Observation", - "category": "vital-signs", - "unit": "/min", - "codes": [ - { - "system": "LOINC", - "code": "9279-1", - "display": "Respiratory rate", - "value_set": "" - } - ], - "name": "Record_Respiratory_Rate_3", - "range": { - "low": 12, - "high": 20 - }, - "direct_transition": "O2_3" - }, - "O2_3": { - "type": "Observation", - "category": "vital-signs", - "unit": "%", - "codes": [ - { - "system": "LOINC", - "code": "2708-6", - "display": "Oxygen saturation in Arterial blood", - "value_set": "" - } - ], - "distribution": { - "kind": "UNIFORM", - "round": false, - "parameters": { - "high": 100, - "low": 97 - } - }, - "name": "O2_3", - "direct_transition": "Take_Temperature_3" - }, - "History and Physical Exam": { - "type": "Procedure", - "codes": [ - { - "system": "SNOMED-CT", - "code": 14736009, - "display": "History and physical examination with evaluation and management of patient (procedure)", - "value_set": "" - } - ], - "distribution": { - "kind": "UNIFORM", - "parameters": { - "high": 60, - "low": 30 - } - }, - "unit": "minutes", - "direct_transition": "Check CBC", - "name": "History and Physical Exam" - }, - "Record_BP_2": { - "type": "MultiObservation", - "category": "vital-signs", - "codes": [ - { - "system": "LOINC", - "code": "85354-9", - "display": "Blood Pressure", - "value_set": "" - } - ], - "observations": [ - { - "category": "vital-signs", - "codes": [ - { - "system": "LOINC", - "code": "8480-6", - "display": "Systolic Blood Pressure" - } - ], - "unit": "mm[Hg]", - "range": { - "low": 90, - "high": 110 - } - }, - { - "category": "vital-signs", - "codes": [ - { - "system": "LOINC", - "code": "8462-4", - "display": "Diastolic Blood Pressure" - } - ], - "unit": "mm[Hg]", - "range": { - "low": 40, - "high": 60 - } - } - ], - "name": "Record_BP_2", - "direct_transition": "Record_Heart_Rate_2" - }, - "Record_Heart_Rate_2": { - "type": "Observation", - "category": "vital-signs", - "unit": "/min", - "codes": [ - { - "system": "LOINC", - "code": "8867-4", - "display": "Heart rate", - "value_set": "" - } - ], - "name": "Record_Heart_Rate_2", - "range": { - "low": 80, - "high": 130 - }, - "direct_transition": "Record_Respiratory_Rate_2" - }, - "Record_Respiratory_Rate_2": { - "type": "Observation", - "category": "vital-signs", - "unit": "/min", - "codes": [ - { - "system": "LOINC", - "code": "9279-1", - "display": "Respiratory rate", - "value_set": "" - } - ], - "name": "Record_Respiratory_Rate_2", - "range": { - "low": 21, - "high": 25 - }, - "direct_transition": "O2_2" - }, - "O2_2": { - "type": "Observation", - "category": "vital-signs", - "unit": "%", - "codes": [ - { - "system": "LOINC", - "code": "2708-6", - "display": "Oxygen saturation in Arterial blood", - "value_set": "" - } - ], - "distribution": { - "kind": "UNIFORM", - "round": false, - "parameters": { - "high": 94, - "low": 89 - } - }, - "name": "O2_2", - "direct_transition": "Take_Temperature_2" - }, - "Record_BP_1": { - "type": "MultiObservation", - "category": "vital-signs", - "codes": [ - { - "system": "LOINC", - "code": "85354-9", - "display": "Blood Pressure", - "value_set": "" - } - ], - "observations": [ - { - "category": "vital-signs", - "codes": [ - { - "system": "LOINC", - "code": "8480-6", - "display": "Systolic Blood Pressure" - } - ], - "unit": "mm[Hg]", - "range": { - "low": 60, - "high": 85 - } - }, - { - "category": "vital-signs", - "codes": [ - { - "system": "LOINC", - "code": "8462-4", - "display": "Diastolic Blood Pressure" - } - ], - "unit": "mm[Hg]", - "range": { - "low": 20, - "high": 40 - } - } - ], - "name": "Record_BP_1", - "direct_transition": "Record_Heart_Rate_1" - }, - "Record_Heart_Rate_1": { - "type": "Observation", - "category": "vital-signs", - "unit": "/min", - "codes": [ - { - "system": "LOINC", - "code": "8867-4", - "display": "Heart rate", - "value_set": "" - } - ], - "name": "Record_Heart_Rate_1", - "range": { - "low": 80, - "high": 130 - }, - "direct_transition": "Record_Respiratory_Rate_1" - }, - "Record_Respiratory_Rate_1": { - "type": "Observation", - "category": "vital-signs", - "unit": "/min", - "codes": [ - { - "system": "LOINC", - "code": "9279-1", - "display": "Respiratory rate", - "value_set": "" - } - ], - "name": "Record_Respiratory_Rate_1", - "range": { - "low": 25, - "high": 30 - }, - "direct_transition": "O2_1" - }, - "O2_1": { - "type": "Observation", - "category": "vital-signs", - "unit": "%", - "codes": [ - { - "system": "LOINC", - "code": "2708-6", - "display": "Oxygen saturation in Arterial blood", - "value_set": "" - } - ], - "distribution": { - "kind": "UNIFORM", - "round": false, - "parameters": { - "high": 88, - "low": 70 - } - }, - "name": "O2_1", - "direct_transition": "Take_Temperature_1" - }, - "Check CBC": { - "type": "Simple", - "name": "Check CBC", - "conditional_transition": [ - { - "transition": "CBC", - "condition": { - "condition_type": "Attribute", - "attribute": "esi", - "operator": "<=", - "value": 3 - } - }, - { - "transition": "Electrolyte Check" - } - ] - }, - "Electrolyte Check": { - "type": "Simple", - "name": "Electrolyte Check", - "conditional_transition": [ - { - "transition": "Provider Choice", - "condition": { - "condition_type": "Attribute", - "attribute": "esi", - "operator": "<=", - "value": 3 - } - }, - { - "transition": "Blood Culture Check" - } - ] - }, - "CBC": { - "type": "Procedure", - "codes": [ - { - "system": "SNOMED-CT", - "code": 26604007, - "display": "Complete blood count (procedure)", - "value_set": "" - } - ], - "distribution": { - "kind": "EXACT", - "parameters": { - "value": 10 - } - }, - "unit": "minutes", - "name": "CBC", - "complex_transition": [ - { - "condition": { - "condition_type": "Attribute", - "attribute": "esi", - "operator": "==", - "value": 1 - }, - "distributions": [ - { - "transition": "Record_CBC_Panel", - "distribution": 0.1 - }, - { - "transition": "Record_Abnormal CBC_Panel", - "distribution": 0.9 - } - ] - }, - { - "condition": { - "condition_type": "Attribute", - "attribute": "esi", - "operator": "==", - "value": 2 - }, - "distributions": [ - { - "transition": "Record_CBC_Panel", - "distribution": 0.3 - }, - { - "transition": "Record_Abnormal CBC_Panel", - "distribution": 0.7 - } - ] - }, - { - "condition": { - "condition_type": "Attribute", - "attribute": "esi", - "operator": "==", - "value": 3 - }, - "distributions": [ - { - "transition": "Record_CBC_Panel", - "distribution": 0.7 - }, - { - "transition": "Record_Abnormal CBC_Panel", - "distribution": 0.3 - } - ] - }, - { - "distributions": [ - { - "transition": "Record_CBC_Panel", - "distribution": 1 - } - ] - } - ] - }, - "Take_Temperature_4_5": { - "type": "Observation", - "category": "vital-signs", - "range": { - "low": 36.4, - "high": 38.6 - }, - "remarks": [ - "37.2 - 39.4 Celsius == 99 - 103 Fahrenheit" - ], - "unit": "Cel", - "codes": [ - { - "system": "LOINC", - "code": "8310-5", - "display": "Body temperature", - "value_set": "" - }, - { - "system": "LOINC", - "code": "8331-1", - "display": "Oral temperature", - "value_set": "" - } - ], - "name": "Take_Temperature_4_5", - "direct_transition": "History and Physical Exam" - }, - "Take_Temperature_3": { - "type": "Observation", - "category": "vital-signs", - "range": { - "low": 36.4, - "high": 38.6 - }, - "remarks": [ - "37.2 - 39.4 Celsius == 99 - 103 Fahrenheit" - ], - "unit": "Cel", - "codes": [ - { - "system": "LOINC", - "code": "8310-5", - "display": "Body temperature", - "value_set": "" - }, - { - "system": "LOINC", - "code": "8331-1", - "display": "Oral temperature", - "value_set": "" - } - ], - "name": "Take_Temperature_3", - "direct_transition": "History and Physical Exam" - }, - "Take_Temperature_1": { - "type": "Observation", - "category": "vital-signs", - "range": { - "low": 35, - "high": 39.4 - }, - "remarks": [ - "37.2 - 39.4 Celsius == 99 - 103 Fahrenheit" - ], - "unit": "Cel", - "codes": [ - { - "system": "LOINC", - "code": "8310-5", - "display": "Body temperature", - "value_set": "" - }, - { - "system": "LOINC", - "code": "8331-1", - "display": "Oral temperature", - "value_set": "" - } - ], - "name": "Take_Temperature_1", - "direct_transition": "History and Physical Exam" - }, - "Take_Temperature_2": { - "type": "Observation", - "category": "vital-signs", - "range": { - "low": 36.4, - "high": 38.6 - }, - "remarks": [ - "37.2 - 39.4 Celsius == 99 - 103 Fahrenheit" - ], - "unit": "Cel", - "codes": [ - { - "system": "LOINC", - "code": "8310-5", - "display": "Body temperature", - "value_set": "" - }, - { - "system": "LOINC", - "code": "8331-1", - "display": "Oral temperature", - "value_set": "" - } - ], - "name": "Take_Temperature_2", - "direct_transition": "History and Physical Exam" - }, - "ESI State 5": { - "type": "SetAttribute", - "attribute": "esi", - "direct_transition": "Record_BP_4_5", - "name": "ESI State 5", - "value": 5 - }, - "ESI_State 4": { - "type": "SetAttribute", - "attribute": "esi", - "name": "ESI_State 4", - "value": 4, - "direct_transition": "Record_BP_4_5" - }, - "ESI_State 3": { - "type": "SetAttribute", - "attribute": "esi", - "name": "ESI_State 3", - "value": 3, - "direct_transition": "Record_BP_3" - }, - "ESI_State 2": { - "type": "SetAttribute", - "attribute": "esi", - "name": "ESI_State 2", - "value": 2, - "direct_transition": "Record_BP_2" - }, - "ESI_State 1": { - "type": "SetAttribute", - "attribute": "esi", - "name": "ESI_State 1", - "value": 1, - "direct_transition": "Record_BP_1" - }, - "Record_CBC_Panel": { - "type": "DiagnosticReport", - "number_of_observations": 4, - "codes": [ - { - "system": "LOINC", - "code": "58410-2", - "display": "Complete blood count (hemogram) panel - Blood by Automated count", - "value_set": "" - } - ], - "observations": [ - { - "category": "laboratory", - "codes": [ - { - "system": "LOINC", - "code": "6690-2", - "display": "Leukocytes [#/volume] in Blood by Automated count" - } - ], - "unit": "10*3/uL", - "range": { - "low": 3.5, - "high": 10.5 - } - }, - { - "category": "laboratory", - "codes": [ - { - "system": "LOINC", - "code": "789-8", - "display": "Erythrocytes [#/volume] in Blood by Automated count" - } - ], - "unit": "10*6/uL", - "range": { - "low": 3.9, - "high": 5.5 - } - }, - { - "category": "laboratory", - "codes": [ - { - "system": "LOINC", - "code": "718-7", - "display": "Hemoglobin [Mass/volume] in Blood" - } - ], - "unit": "g/dL", - "range": { - "low": 12, - "high": 17.5 - } - }, - { - "category": "laboratory", - "codes": [ - { - "system": "LOINC", - "code": "4544-3", - "display": "Hematocrit [Volume Fraction] of Blood by Automated count" - } - ], - "unit": "%", - "range": { - "low": 35, - "high": 50 - } - }, - { - "category": "laboratory", - "unit": "fL", - "codes": [ - { - "system": "LOINC", - "code": "787-2", - "display": "MCV [Entitic volume] by Automated count" - } - ], - "range": { - "low": 80, - "high": 95 - } - }, - { - "category": "laboratory", - "unit": "pg", - "codes": [ - { - "system": "LOINC", - "code": "785-6", - "display": "MCH [Entitic mass] by Automated count" - } - ], - "range": { - "low": 27, - "high": 33 - } - }, - { - "category": "laboratory", - "unit": "g/dL", - "codes": [ - { - "system": "LOINC", - "code": "786-4", - "display": "MCHC [Mass/volume] by Automated count" - } - ], - "range": { - "low": 33, - "high": 36 - } - }, - { - "category": "laboratory", - "unit": "fL", - "codes": [ - { - "system": "LOINC", - "code": "21000-5", - "display": "Erythrocyte distribution width [Entitic volume] by Automated count" - } - ], - "range": { - "low": 39, - "high": 46 - } - }, - { - "category": "laboratory", - "unit": "10*3/uL", - "codes": [ - { - "system": "LOINC", - "code": "777-3", - "display": "Platelets [#/volume] in Blood by Automated count" - } - ], - "range": { - "low": 150, - "high": 450 - } - }, - { - "category": "laboratory", - "unit": "fL", - "codes": [ - { - "system": "LOINC", - "code": "32207-3", - "display": "Platelet distribution width [Entitic volume] in Blood by Automated count" - } - ], - "range": { - "low": 150, - "high": 520 - } - }, - { - "category": "laboratory", - "unit": "fL", - "codes": [ - { - "system": "LOINC", - "code": "32623-1", - "display": "Platelet mean volume [Entitic volume] in Blood by Automated count" - } - ], - "range": { - "low": 9.4, - "high": 12.3 - } - } - ], - "name": "Record_CBC_Panel", - "direct_transition": "Electrolyte Check" - }, - "Record_Abnormal CBC_Panel": { - "type": "DiagnosticReport", - "number_of_observations": 4, - "codes": [ - { - "system": "LOINC", - "code": "58410-2", - "display": "Complete blood count (hemogram) panel - Blood by Automated count", - "value_set": "" - } - ], - "observations": [ - { - "category": "laboratory", - "codes": [ - { - "system": "LOINC", - "code": "6690-2", - "display": "Leukocytes [#/volume] in Blood by Automated count" - } - ], - "unit": "10*3/uL", - "range": { - "low": 12, - "high": 22 - } - }, - { - "category": "laboratory", - "codes": [ - { - "system": "LOINC", - "code": "789-8", - "display": "Erythrocytes [#/volume] in Blood by Automated count" - } - ], - "unit": "10*6/uL", - "range": { - "low": 3.9, - "high": 5.5 - } - }, - { - "category": "laboratory", - "codes": [ - { - "system": "LOINC", - "code": "718-7", - "display": "Hemoglobin [Mass/volume] in Blood" - } - ], - "unit": "g/dL", - "range": { - "low": 12, - "high": 17.5 - } - }, - { - "category": "laboratory", - "codes": [ - { - "system": "LOINC", - "code": "4544-3", - "display": "Hematocrit [Volume Fraction] of Blood by Automated count" - } - ], - "unit": "%", - "range": { - "low": 35, - "high": 50 - } - }, - { - "category": "laboratory", - "unit": "fL", - "codes": [ - { - "system": "LOINC", - "code": "787-2", - "display": "MCV [Entitic volume] by Automated count" - } - ], - "range": { - "low": 80, - "high": 95 - } - }, - { - "category": "laboratory", - "unit": "pg", - "codes": [ - { - "system": "LOINC", - "code": "785-6", - "display": "MCH [Entitic mass] by Automated count" - } - ], - "range": { - "low": 27, - "high": 33 - } - }, - { - "category": "laboratory", - "unit": "g/dL", - "codes": [ - { - "system": "LOINC", - "code": "786-4", - "display": "MCHC [Mass/volume] by Automated count" - } - ], - "range": { - "low": 33, - "high": 36 - } - }, - { - "category": "laboratory", - "unit": "fL", - "codes": [ - { - "system": "LOINC", - "code": "21000-5", - "display": "Erythrocyte distribution width [Entitic volume] by Automated count" - } - ], - "range": { - "low": 39, - "high": 46 - } - }, - { - "category": "laboratory", - "unit": "10*3/uL", - "codes": [ - { - "system": "LOINC", - "code": "777-3", - "display": "Platelets [#/volume] in Blood by Automated count" - } - ], - "range": { - "low": 150, - "high": 450 - } - }, - { - "category": "laboratory", - "unit": "fL", - "codes": [ - { - "system": "LOINC", - "code": "32207-3", - "display": "Platelet distribution width [Entitic volume] in Blood by Automated count" - } - ], - "range": { - "low": 150, - "high": 520 - } - }, - { - "category": "laboratory", - "unit": "fL", - "codes": [ - { - "system": "LOINC", - "code": "32623-1", - "display": "Platelet mean volume [Entitic volume] in Blood by Automated count" - } - ], - "range": { - "low": 9.4, - "high": 12.3 - } - } - ], - "name": "Record_Abnormal CBC_Panel", - "direct_transition": "Electrolyte Check" - }, - "Blood Culture Check": { - "type": "Simple", - "direct_transition": "Urinalysis", - "name": "Blood Culture Check" - }, - "Urinalysis": { - "type": "Procedure", - "codes": [ - { - "system": "SNOMED-CT", - "code": 441550005, - "display": "Urinalysis with reflex to microscopy and culture (procedure)", - "value_set": "" - } - ], - "distribution": { - "kind": "EXACT", - "parameters": { - "value": 10 - } - }, - "unit": "minutes", - "direct_transition": "Labs Submodule", - "name": "Urinalysis" - }, - "Labs Submodule": { - "type": "CallSubmodule", - "submodule": "uti_labs", - "direct_transition": "Terminal", - "name": "Labs Submodule" - }, - "Provider Choice": { - "type": "Simple", - "name": "Provider Choice", - "complex_transition": [ - { - "condition": { - "condition_type": "Attribute", - "attribute": "esi", - "operator": "<=", - "value": 2 - }, - "distributions": [], - "transition": "CMP" - }, - { - "condition": { - "condition_type": "Attribute", - "attribute": "esi", - "operator": "==", - "value": 3 - }, - "distributions": [ - { - "transition": "CMP", - "distribution": 0.3 - }, - { - "transition": "BMP", - "distribution": 0.7 - } - ] - } - ] - }, - "CMP": { - "type": "Procedure", - "codes": [ - { - "system": "SNOMED-CT", - "code": 371361000119107, - "display": "Comprehensive metabolic panel (procedure)", + "code": 57617002, + "display": "Urine specimen collection (procedure)", "value_set": "" } ], @@ -1416,63 +30,28 @@ } }, "unit": "minutes", - "name": "CMP", - "complex_transition": [ - { - "condition": { - "condition_type": "Attribute", - "attribute": "ckd", - "operator": ">=", - "value": 1 - }, - "distributions": [], - "transition": "Comprehensive_Metabolic_Panel_with_Kidney_Damage" - }, - { - "condition": { - "condition_type": "Attribute", - "attribute": "esi", - "operator": "<=", - "value": 2 - }, - "distributions": [ - { - "transition": "Comprehensive_Metabolic_Panel_with_Kidney_Damage", - "distribution": 0.6 - }, - { - "transition": "Comprehensive_Metabolic_Panel", - "distribution": 0.4 - } - ] - }, + "name": "Collection", + "conditional_transition": [ { - "condition": { - "condition_type": "Attribute", - "attribute": "esi", - "operator": "==", - "value": 3 - }, - "distributions": [ - { - "transition": "Comprehensive_Metabolic_Panel_with_Kidney_Damage", - "distribution": 0.05 - }, - { - "transition": "Comprehensive_Metabolic_Panel", - "distribution": 0.95 - } - ] + "transition": "Dipstick", + "condition": { + "condition_type": "Attribute", + "attribute": "UTI_ambulatory", + "operator": "is not nil" + } + }, + { + "transition": "Urinalysis Micro" } ] }, - "BMP": { + "Dipstick": { "type": "Procedure", "codes": [ { "system": "SNOMED-CT", - "code": 866146005, - "display": "Serum metabolic panel (procedure)", + "code": 167226008, + "display": "Urine dipstick test (procedure)", "value_set": "" } ], @@ -1483,446 +62,625 @@ } }, "unit": "minutes", - "direct_transition": "Blood Culture Check", - "name": "BMP" + "direct_transition": "Record_Urinalysis", + "name": "Dipstick" }, - "Comprehensive_Metabolic_Panel": { + "Record_Urinalysis": { "type": "DiagnosticReport", "codes": [ { "system": "LOINC", - "code": "24323-8", - "display": "Comprehensive metabolic 2000 panel - Serum or Plasma", + "code": "24357-6", + "display": "Urinalysis macro (dipstick) panel - Urine", "value_set": "" } ], "observations": [ - { - "category": "laboratory", - "vital_sign": "Glucose", - "codes": [ - { - "system": "LOINC", - "code": "2345-7", - "display": "Glucose [Mass/volume] in Serum or Plasma" - } - ], - "unit": "mg/dL" - }, - { - "category": "laboratory", - "vital_sign": "Urea Nitrogen", - "codes": [ - { - "system": "LOINC", - "code": "3094-0", - "display": "Urea nitrogen [Mass/volume] in Serum or Plasma" - } - ], - "unit": "mg/dL" - }, { "category": "laboratory", "codes": [ { "system": "LOINC", - "code": "2160-0", - "display": "Creatinine [Mass/volume] in Serum or Plasma" + "code": "5792-7", + "display": "Glucose [Mass/volume] in Urine by Test strip" } ], "unit": "mg/dL", "range": { - "low": 1.5, - "high": 3 + "low": 0, + "high": 15 } }, { "category": "laboratory", - "vital_sign": "Calcium", - "codes": [ - { - "system": "LOINC", - "code": "17861-6", - "display": "Calcium [Mass/volume] in Serum or Plasma" - } - ], - "unit": "mg/dL" - }, - { - "category": "laboratory", - "vital_sign": "Sodium", + "unit": "{nominal}", "codes": [ { "system": "LOINC", - "code": "2951-2", - "display": "Sodium [Moles/volume] in Serum or Plasma" + "code": "2514-8", + "display": "Ketones [Presence] in Urine by Test strip" } ], - "unit": "mmol/L" - }, - { - "category": "laboratory", - "vital_sign": "Potassium", - "codes": [ - { - "system": "LOINC", - "code": "2823-3", - "display": "Potassium [Moles/volume] in Serum or Plasma" - } - ], - "unit": "mmol/L" - }, - { - "category": "laboratory", - "vital_sign": "Chloride", - "codes": [ - { - "system": "LOINC", - "code": "2075-0", - "display": "Chloride [Moles/volume] in Serum or Plasma" - } - ], - "unit": "mmol/L" + "value_code": { + "system": "SNOMED-CT", + "code": 167287002, + "display": "Urine ketone test negative (finding)" + } }, { "category": "laboratory", - "vital_sign": "Carbon Dioxide", + "unit": "{nominal}", "codes": [ { "system": "LOINC", - "code": "2028-9", - "display": "Carbon dioxide, total [Moles/volume] in Serum or Plasma" + "code": "5811-5", + "display": "Specific gravity of Urine by Test strip" } ], - "unit": "mmol/L" + "range": { + "low": 1.005, + "high": 1.03 + } }, { "category": "laboratory", - "unit": "mL/min", + "unit": "pH", "codes": [ { "system": "LOINC", - "code": "33914-3", - "display": "Glomerular filtration rate/1.73 sq M.predicted" + "code": "5803-2", + "display": "pH of Urine by Test strip" } ], "range": { "low": 5, - "high": 14 + "high": 7 } }, { "category": "laboratory", - "unit": "g/dL", + "unit": "mg/dL", "codes": [ { "system": "LOINC", - "code": "2885-2", - "display": "Protein [Mass/volume] in Serum or Plasma" + "code": "5804-0", + "display": "Protein [Mass/volume] in Urine by Test strip" } ], "range": { - "low": 6, - "high": 8.5 + "low": 0, + "high": 14 } }, { "category": "laboratory", - "unit": "g/dL", + "unit": "{nominal}", "codes": [ { "system": "LOINC", - "code": "1751-7", - "display": "Albumin [Mass/volume] in Serum or Plasma" + "code": "5802-4", + "display": "Nitrite [Presence] in Urine by Test strip" } ], - "range": { - "low": 4, - "high": 5 + "value_code": { + "system": "SNOMED-CT", + "code": 314137006, + "display": "Urine nitrite positive (finding)" } }, { "category": "laboratory", - "unit": "mg/dL", + "unit": "{nominal}", "codes": [ { "system": "LOINC", - "code": "1975-2", - "display": "Bilirubin.total [Mass/volume] in Serum or Plasma" + "code": "5794-3", + "display": "Hemoglobin [Presence] in Urine by Test strip" } ], - "range": { - "low": 6, - "high": 15 + "value_code": { + "system": "SNOMED-CT", + "code": 167300001, + "display": "Urine blood test = + (finding)" } }, { "category": "laboratory", - "unit": "U/L", + "unit": "{nominal}", "codes": [ { "system": "LOINC", - "code": "6768-6", - "display": "Alkaline phosphatase [Enzymatic activity/volume] in Serum or Plasma" + "code": "5799-2", + "display": "Leukocyte esterase [Presence] in Urine by Test strip" } ], - "range": { - "low": 39, - "high": 117 + "value_code": { + "system": "SNOMED-CT", + "code": 394712000, + "display": "Urine leukocyte test = + (finding)" } - }, + } + ], + "name": "Record_Urinalysis", + "complex_transition": [ { - "category": "laboratory", - "unit": "U/L", - "codes": [ + "condition": { + "condition_type": "Active Condition", + "codes": [ + { + "system": "SNOMED-CT", + "code": 45816000, + "display": "Pyelonephritis" + } + ] + }, + "distributions": [ { - "system": "LOINC", - "code": "1742-6", - "display": "Alanine aminotransferase [Enzymatic activity/volume] in Serum or Plasma" + "transition": "Urine Culture", + "distribution": 0.95 + }, + { + "transition": "Terminal", + "distribution": 0.05 } - ], - "range": { - "low": 0, - "high": 44 - } + ] }, { - "category": "laboratory", - "unit": "U/L", - "codes": [ + "condition": { + "condition_type": "Active Condition", + "codes": [ + { + "system": "SNOMED-CT", + "code": 307426000, + "display": "Acute infective cystitis (disorder)" + } + ] + }, + "distributions": [ { - "system": "LOINC", - "code": "1920-8", - "display": "Aspartate aminotransferase [Enzymatic activity/volume] in Serum or Plasma" + "transition": "Urine Culture", + "distribution": 0.55 + }, + { + "transition": "Terminal", + "distribution": 0.44999999999999996 } - ], - "range": { - "low": 0, - "high": 40 - } + ] + }, + { + "distributions": [], + "transition": "Terminal" + } + ] + }, + "Urinalysis Micro": { + "type": "Procedure", + "codes": [ + { + "system": "SNOMED-CT", + "code": 441550005, + "display": "Urinalysis with reflex to microscopy and culture (procedure)", + "value_set": "" } ], - "name": "Comprehensive_Metabolic_Panel", - "direct_transition": "Blood Culture Check" + "distribution": { + "kind": "EXACT", + "parameters": { + "value": 10 + } + }, + "unit": "minutes", + "direct_transition": "Record_Urinalysis_Micro", + "name": "Urinalysis Micro" }, - "Comprehensive_Metabolic_Panel_with_Kidney_Damage": { + "Record_Urinalysis_Micro": { "type": "DiagnosticReport", "codes": [ { "system": "LOINC", - "code": "24323-8", - "display": "Comprehensive metabolic 2000 panel - Serum or Plasma", + "code": "24357-6", + "display": "Urinalysis macro (dipstick) panel - Urine", "value_set": "" } ], "observations": [ { "category": "laboratory", - "vital_sign": "Glucose", "codes": [ { "system": "LOINC", - "code": "2345-7", - "display": "Glucose [Mass/volume] in Serum or Plasma" + "code": "5792-7", + "display": "Glucose [Mass/volume] in Urine by Test strip" } ], - "unit": "mg/dL" + "unit": "mg/dL", + "range": { + "low": 0, + "high": 15 + } }, { "category": "laboratory", - "vital_sign": "Urea Nitrogen", + "unit": "{nominal}", "codes": [ { "system": "LOINC", - "code": "3094-0", - "display": "Urea nitrogen [Mass/volume] in Serum or Plasma" + "code": "2514-8", + "display": "Ketones [Presence] in Urine by Test strip" } ], - "unit": "mg/dL" + "value_code": { + "system": "SNOMED-CT", + "code": 167287002, + "display": "Urine ketone test negative (finding)" + } }, { "category": "laboratory", + "unit": "{nominal}", "codes": [ { "system": "LOINC", - "code": "2160-0", - "display": "Creatinine [Mass/volume] in Serum or Plasma" + "code": "5811-5", + "display": "Specific gravity of Urine by Test strip" } ], - "unit": "mg/dL", "range": { - "low": 2.5, - "high": 3 + "low": 1.005, + "high": 1.03 } }, { "category": "laboratory", - "vital_sign": "Calcium", + "unit": "pH", "codes": [ { "system": "LOINC", - "code": "17861-6", - "display": "Calcium [Mass/volume] in Serum or Plasma" + "code": "5803-2", + "display": "pH of Urine by Test strip" } ], - "unit": "mg/dL" + "range": { + "low": 5, + "high": 7 + } }, { "category": "laboratory", - "vital_sign": "Sodium", + "unit": "mg/dL", "codes": [ { "system": "LOINC", - "code": "2951-2", - "display": "Sodium [Moles/volume] in Serum or Plasma" + "code": "5804-0", + "display": "Protein [Mass/volume] in Urine by Test strip" } ], - "unit": "mmol/L" + "range": { + "low": 0, + "high": 14 + } }, { "category": "laboratory", - "vital_sign": "Potassium", + "unit": "{nominal}", "codes": [ { "system": "LOINC", - "code": "2823-3", - "display": "Potassium [Moles/volume] in Serum or Plasma" + "code": "5802-4", + "display": "Nitrite [Presence] in Urine by Test strip" } ], - "unit": "mmol/L" + "value_code": { + "system": "SNOMED-CT", + "code": 314137006, + "display": "Urine nitrite positive (finding)" + } }, { "category": "laboratory", - "vital_sign": "Chloride", + "unit": "{nominal}", "codes": [ { "system": "LOINC", - "code": "2075-0", - "display": "Chloride [Moles/volume] in Serum or Plasma" + "code": "5794-3", + "display": "Hemoglobin [Presence] in Urine by Test strip" } ], - "unit": "mmol/L" + "value_code": { + "system": "SNOMED-CT", + "code": 167300001, + "display": "Urine blood test = + (finding)" + } }, { "category": "laboratory", - "vital_sign": "Carbon Dioxide", + "unit": "{nominal}", "codes": [ { "system": "LOINC", - "code": "2028-9", - "display": "Carbon dioxide, total [Moles/volume] in Serum or Plasma" + "code": "5799-2", + "display": "Leukocyte esterase [Presence] in Urine by Test strip" } ], - "unit": "mmol/L" + "value_code": { + "system": "SNOMED-CT", + "code": 394712000, + "display": "Urine leukocyte test = + (finding)" + } }, { "category": "laboratory", - "unit": "mL/min", + "unit": "/[HPF]", "codes": [ { "system": "LOINC", - "code": "33914-3", - "display": "Glomerular filtration rate/1.73 sq M.predicted" + "code": "5821-4", + "display": "WBCs" } ], "range": { - "low": 5, - "high": 14 + "low": 11, + "high": 50 } }, { "category": "laboratory", - "unit": "g/dL", + "unit": "/[HPF]", "codes": [ { "system": "LOINC", - "code": "2885-2", - "display": "Protein [Mass/volume] in Serum or Plasma" + "code": "13945-1", + "display": "RBCs" } ], "range": { - "low": 6, - "high": 8.5 + "low": 1, + "high": 3 } }, { "category": "laboratory", - "unit": "g/dL", + "unit": "/[HPF]", "codes": [ { "system": "LOINC", - "code": "1751-7", - "display": "Albumin [Mass/volume] in Serum or Plasma" + "code": "5787-7", + "display": "Epithelial Cells" } ], "range": { - "low": 4, - "high": 5 + "low": 0, + "high": 4 } }, { "category": "laboratory", - "unit": "mg/dL", + "unit": "{nominal}", "codes": [ { "system": "LOINC", - "code": "1975-2", - "display": "Bilirubin.total [Mass/volume] in Serum or Plasma" + "code": "24124-0", + "display": "Casts" } ], - "range": { - "low": 6, - "high": 15 + "value_code": { + "system": "SNOMED-CT", + "code": 167336003, + "display": "Urine microscopy: no casts (finding)" } }, { "category": "laboratory", - "unit": "U/L", + "unit": "{nominal}", "codes": [ { "system": "LOINC", - "code": "6768-6", - "display": "Alkaline phosphatase [Enzymatic activity/volume] in Serum or Plasma" + "code": "8247-9", + "display": "Mucus Threads" } ], - "range": { - "low": 39, - "high": 117 + "value_code": { + "system": "SNOMED-CT", + "code": 276409005, + "display": "Mucus in urine (finding)" } }, { "category": "laboratory", - "unit": "U/L", + "unit": "{nominal}", "codes": [ { "system": "LOINC", - "code": "1742-6", - "display": "Alanine aminotransferase [Enzymatic activity/volume] in Serum or Plasma" + "code": "5769-5", + "display": "Bacteria" } ], - "range": { - "low": 0, - "high": 44 + "value_code": { + "system": "SNOMED-CT", + "code": 365691004, + "display": "Finding of presence of bacteria (finding)" } + } + ], + "name": "Record_Urinalysis_Micro", + "direct_transition": "Urine Culture Result" + }, + "Urine Culture": { + "type": "Procedure", + "codes": [ + { + "system": "SNOMED-CT", + "code": 117010004, + "display": "Urine culture (procedure)", + "value_set": "" + } + ], + "distribution": { + "kind": "EXACT", + "parameters": { + "value": 10 + } + }, + "unit": "minutes", + "direct_transition": "Urine Culture Result", + "name": "Urine Culture" + }, + "Urine Culture Result": { + "type": "Simple", + "name": "Urine Culture Result", + "complex_transition": [ + { + "condition": { + "condition_type": "And", + "conditions": [ + { + "condition_type": "Attribute", + "attribute": "UTI_Ambulatory", + "operator": "is not nil" + }, + { + "condition_type": "Attribute", + "attribute": "UTI_Tx", + "operator": "is not nil" + } + ] + }, + "distributions": [ + { + "transition": "No Growth", + "distribution": 1 + } + ] }, { - "category": "laboratory", - "unit": "U/L", - "codes": [ + "distributions": [ { - "system": "LOINC", - "code": "1920-8", - "display": "Aspartate aminotransferase [Enzymatic activity/volume] in Serum or Plasma" + "transition": "E Coli", + "distribution": 0.76 + }, + { + "transition": "Klebsiella", + "distribution": 0.09 + }, + { + "transition": "Enterococcus", + "distribution": 0.05 + }, + { + "transition": "Proteus", + "distribution": 0.04 + }, + { + "transition": "Pseudomonas", + "distribution": 0.02 + }, + { + "transition": "Klebsiella oxytoca", + "distribution": 0.01 + }, + { + "transition": "Citrobacter", + "distribution": 0.01 + }, + { + "transition": "Staphylococcus", + "distribution": 0.01 } - ], - "range": { - "low": 0, - "high": 40 - } + ] + } + ] + }, + "E Coli": { + "type": "SetAttribute", + "attribute": "UTI_Bacteria", + "direct_transition": "Observe Bacteria", + "name": "E Coli", + "value": "Greater than 100,000 colony forming units per mL Escherichia coli" + }, + "Klebsiella": { + "type": "SetAttribute", + "attribute": "UTI_Bacteria", + "direct_transition": "Observe Bacteria", + "name": "Klebsiella", + "value": "Greater than 100,000 colony forming units per mL Klebsiella pneumoniae" + }, + "Enterococcus": { + "type": "SetAttribute", + "attribute": "UTI_Bacteria", + "direct_transition": "Observe Bacteria", + "name": "Enterococcus", + "value": "Greater than 100,000 colony forming units per mL Enterococcus faecalis" + }, + "Proteus": { + "type": "SetAttribute", + "attribute": "UTI_Bacteria", + "direct_transition": "Observe Bacteria", + "name": "Proteus", + "value": "Greater than 100,000 colony forming units per mL Proteus mirabilis" + }, + "Pseudomonas": { + "type": "SetAttribute", + "attribute": "UTI_Bacteria", + "direct_transition": "Observe Bacteria", + "name": "Pseudomonas", + "value": "Greater than 100,000 colony forming units per mL Pseudomonas aeruginosa" + }, + "Klebsiella oxytoca": { + "type": "SetAttribute", + "attribute": "UTI_Bacteria", + "direct_transition": "Observe Bacteria", + "name": "Klebsiella oxytoca", + "value": "Greater than 100,000 colony forming units per mL Klebsiella oxytoca" + }, + "Citrobacter": { + "type": "SetAttribute", + "attribute": "UTI_Bacteria", + "direct_transition": "Observe Bacteria", + "name": "Citrobacter", + "value": "Greater than 100,000 colony forming units per mL Citrobacter freundii complex" + }, + "Staphylococcus": { + "type": "SetAttribute", + "attribute": "UTI_Bacteria", + "direct_transition": "Observe Bacteria", + "name": "Staphylococcus", + "value": "Greater than 100,000 colony forming units per mL Staphylococcus aureus" + }, + "No Growth": { + "type": "Observation", + "category": "laboratory", + "unit": "", + "codes": [ + { + "system": "LOINC", + "code": "630-4", + "display": "Bacteria identified in Urine by Culture", + "value_set": "" + } + ], + "direct_transition": "Terminal", + "name": "No Growth", + "value_code": { + "system": "SNOMED-CT", + "code": 264868006, + "display": "No growth (qualifier value)" + } + }, + "Observe Bacteria": { + "type": "Observation", + "category": "laboratory", + "unit": "", + "codes": [ + { + "system": "LOINC", + "code": "630-4", + "display": "Bacteria identified in Urine by Culture", + "value_set": "" } ], - "name": "Comprehensive_Metabolic_Panel_with_Kidney_Damage", - "direct_transition": "Blood Culture Check" + "direct_transition": "Terminal", + "name": "Observe Bacteria", + "attribute": "UTI_Bacteria" } }, "gmf_version": 2 From ae840b71be54cc308837183df175293373513199 Mon Sep 17 00:00:00 2001 From: Andy Gregorowicz Date: Thu, 16 Feb 2023 15:51:32 -0500 Subject: [PATCH 65/78] WIP: Yet more debugging of uti updates --- .../modules/urinary_tract_infections.json | 8 +++--- .../modules/uti/ambulatory_eval.json | 6 ++--- ...blatory_path.json => ambulatory_path.json} | 20 ++++++++------ src/main/resources/modules/uti/ed_bundle.json | 4 +-- src/main/resources/modules/uti/ed_eval.json | 26 +++++++++++-------- src/main/resources/modules/uti/ed_path.json | 4 +-- .../resources/modules/uti/lab_follow_up.json | 2 +- .../resources/modules/uti/telemed_path.json | 18 ++++++++----- 8 files changed, 51 insertions(+), 37 deletions(-) rename src/main/resources/modules/uti/{amublatory_path.json => ambulatory_path.json} (93%) diff --git a/src/main/resources/modules/urinary_tract_infections.json b/src/main/resources/modules/urinary_tract_infections.json index 7b63deaa20..c6960d9679 100644 --- a/src/main/resources/modules/urinary_tract_infections.json +++ b/src/main/resources/modules/urinary_tract_infections.json @@ -127,17 +127,19 @@ }, "UTI Telemed Sub": { "type": "CallSubmodule", - "submodule": "UTI_Telemed", + "submodule": "uti/telemed_path", "direct_transition": "Time Delay", "name": "UTI Telemed Sub" }, "UTI Ambulatory Sub": { - "type": "Simple", + "type": "CallSubmodule", + "submodule": "uti/ambulatory_path", "direct_transition": "Time Delay", "name": "UTI Ambulatory Sub" }, "UTI ED Sub": { - "type": "Simple", + "type": "CallSubmodule", + "submodule": "uti/ed_path", "direct_transition": "Time Delay", "name": "UTI ED Sub" }, diff --git a/src/main/resources/modules/uti/ambulatory_eval.json b/src/main/resources/modules/uti/ambulatory_eval.json index cd26a75512..ff7532ba5e 100644 --- a/src/main/resources/modules/uti/ambulatory_eval.json +++ b/src/main/resources/modules/uti/ambulatory_eval.json @@ -52,13 +52,13 @@ }, "GU_Pregnancy_Check": { "type": "CallSubmodule", - "submodule": "GU_Pregnancy_Check", + "submodule": "uti/gu_pregnancy_check", "direct_transition": "UTI_Labs", "name": "GU_Pregnancy_Check" }, "UTI_Labs": { "type": "CallSubmodule", - "submodule": "UTI_Labs", + "submodule": "uti/labs", "direct_transition": "Abx Therapy", "name": "UTI_Labs" }, @@ -84,7 +84,7 @@ }, "UTI_Abx": { "type": "CallSubmodule", - "submodule": "UTI_Abx", + "submodule": "uti/abx_tx", "direct_transition": "Terminal", "name": "UTI_Abx" } diff --git a/src/main/resources/modules/uti/amublatory_path.json b/src/main/resources/modules/uti/ambulatory_path.json similarity index 93% rename from src/main/resources/modules/uti/amublatory_path.json rename to src/main/resources/modules/uti/ambulatory_path.json index f4f56c8798..15d0d7bdb1 100644 --- a/src/main/resources/modules/uti/amublatory_path.json +++ b/src/main/resources/modules/uti/ambulatory_path.json @@ -57,7 +57,7 @@ }, "UTI_Ambulatory_Eval": { "type": "CallSubmodule", - "submodule": "UTI_Ambulatory_Eval", + "submodule": "uti/ambulatory_eval", "name": "UTI_Ambulatory_Eval", "direct_transition": "End Ambulatory Encounter" }, @@ -75,10 +75,14 @@ "value": true }, { - "condition_type": "Attribute", - "attribute": "uti", - "operator": "==", - "value": "Pyelonephritis" + "condition_type": "Active Condition", + "codes": [ + { + "system": "SNOMED-CT", + "code": 45816000, + "display": "Pyelonephritis" + } + ] } ] }, @@ -169,7 +173,7 @@ }, "UTI_Lab_FollowUp": { "type": "CallSubmodule", - "submodule": "UTI_Lab_FollowUp", + "submodule": "uti/lab_follow_up", "direct_transition": "End Telephone Encounter", "name": "UTI_Lab_FollowUp" }, @@ -195,7 +199,7 @@ }, "UTI_ED_Eval": { "type": "CallSubmodule", - "submodule": "UTI_ED_Eval", + "submodule": "uti/ed_eval", "direct_transition": "End ED Follow-up", "name": "UTI_ED_Eval" }, @@ -229,7 +233,7 @@ }, "UTI_HPI": { "type": "CallSubmodule", - "submodule": "UTI_HPI", + "submodule": "uti/hpi", "direct_transition": "Exam", "name": "UTI_HPI" } diff --git a/src/main/resources/modules/uti/ed_bundle.json b/src/main/resources/modules/uti/ed_bundle.json index a6c3dbfbab..078a665682 100644 --- a/src/main/resources/modules/uti/ed_bundle.json +++ b/src/main/resources/modules/uti/ed_bundle.json @@ -1,5 +1,5 @@ { - "name": "ED_UTI_Bundle", + "name": "UTI_ED_Bundle", "remarks": [ "A blank module" ], @@ -1374,7 +1374,7 @@ }, "Labs Submodule": { "type": "CallSubmodule", - "submodule": "UTI_Labs", + "submodule": "uti/labs", "direct_transition": "Terminal", "name": "Labs Submodule" }, diff --git a/src/main/resources/modules/uti/ed_eval.json b/src/main/resources/modules/uti/ed_eval.json index 30225937c2..411c7ead85 100644 --- a/src/main/resources/modules/uti/ed_eval.json +++ b/src/main/resources/modules/uti/ed_eval.json @@ -15,7 +15,7 @@ }, "UTI_ED_Bundle": { "type": "CallSubmodule", - "submodule": "UTI_ED_Bundle", + "submodule": "uti/ed_bundle", "name": "UTI_ED_Bundle", "complex_transition": [ { @@ -54,16 +54,10 @@ }, { "condition": { - "condition_type": "Observation", - "codes": [ - { - "system": "LOINC", - "code": "75636-1", - "display": "Emergency severity index 3" - } - ], + "condition_type": "Attribute", + "attribute": "esi", "operator": "==", - "value": 0 + "value": 3 }, "distributions": [ { @@ -76,6 +70,16 @@ } ] }, + { + "distributions": [], + "transition": "Hospital admission", + "condition": { + "condition_type": "Attribute", + "attribute": "esi", + "operator": "<=", + "value": 2 + } + }, { "distributions": [], "transition": "Antibiotic therapy" @@ -105,7 +109,7 @@ }, "UTI_Abx": { "type": "CallSubmodule", - "submodule": "UTI_Abx", + "submodule": "uti/abx_tx", "direct_transition": "Patient discharge", "name": "UTI_Abx" }, diff --git a/src/main/resources/modules/uti/ed_path.json b/src/main/resources/modules/uti/ed_path.json index f566f84f53..0399a55788 100644 --- a/src/main/resources/modules/uti/ed_path.json +++ b/src/main/resources/modules/uti/ed_path.json @@ -38,7 +38,7 @@ }, "UTI_ED_Eval": { "type": "CallSubmodule", - "submodule": "UTI_ED_Eval", + "submodule": "uti/ed_eval", "name": "UTI_ED_Eval", "direct_transition": "End_ED_Follow_up" }, @@ -49,7 +49,7 @@ }, "UTI_HPI": { "type": "CallSubmodule", - "submodule": "UTI_HPI", + "submodule": "uti/hpi", "name": "UTI_HPI", "direct_transition": "UTI_ED_Eval" } diff --git a/src/main/resources/modules/uti/lab_follow_up.json b/src/main/resources/modules/uti/lab_follow_up.json index 877f90a161..3dd37b8201 100644 --- a/src/main/resources/modules/uti/lab_follow_up.json +++ b/src/main/resources/modules/uti/lab_follow_up.json @@ -107,7 +107,7 @@ }, "UTI Abx Tx Sub": { "type": "CallSubmodule", - "submodule": "UTI_Abx_Tx", + "submodule": "uti/abx_tx", "direct_transition": "Terminal", "name": "UTI Abx Tx Sub" }, diff --git a/src/main/resources/modules/uti/telemed_path.json b/src/main/resources/modules/uti/telemed_path.json index 6cd6e6a973..4e1842b23d 100644 --- a/src/main/resources/modules/uti/telemed_path.json +++ b/src/main/resources/modules/uti/telemed_path.json @@ -81,10 +81,14 @@ "complex_transition": [ { "condition": { - "condition_type": "Attribute", - "attribute": "uti", - "operator": "==", - "value": "Pyelonephritis" + "condition_type": "Active Condition", + "codes": [ + { + "system": "SNOMED-CT", + "code": 45816000, + "display": "Pyelonephritis" + } + ] }, "distributions": [], "transition": "Evaluation" @@ -240,7 +244,7 @@ }, "UTI_HPI": { "type": "CallSubmodule", - "submodule": "UTI_HPI", + "submodule": "uti/hpi", "complex_transition": [ { "condition": { @@ -267,13 +271,13 @@ }, "GU_Pregnancy_Check": { "type": "CallSubmodule", - "submodule": "GU_Pregnancy_Check", + "submodule": "uti/gu_pregnancy_check", "direct_transition": "Risk_Check", "name": "GU_Pregnancy_Check" }, "UTI_Abx": { "type": "CallSubmodule", - "submodule": "UTI_Abx", + "submodule": "uti/abx_tx", "distributed_transition": [ { "transition": "End_UTI_Diagnosis", From d7c549ef74514724d09e3ddc6883a15974ce6518 Mon Sep 17 00:00:00 2001 From: Andy Gregorowicz Date: Mon, 20 Feb 2023 13:46:34 -0500 Subject: [PATCH 66/78] WIP: Fixing bug in Cystitis onset and bug in UTI recurrence not setting the actual condition --- .../modules/lookup_tables/uti_recurrence.csv | 11 +++++++++++ .../modules/urinary_tract_infections.json | 15 +++++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 src/main/resources/modules/lookup_tables/uti_recurrence.csv diff --git a/src/main/resources/modules/lookup_tables/uti_recurrence.csv b/src/main/resources/modules/lookup_tables/uti_recurrence.csv new file mode 100644 index 0000000000..8d814fb9b7 --- /dev/null +++ b/src/main/resources/modules/lookup_tables/uti_recurrence.csv @@ -0,0 +1,11 @@ +age,gender,Cystitis,Pyelonephritis +15-24,F,0.977044476,0.022955524 +25-44,F,0.97826087,0.02173913 +45-64,F,0.979890311,0.020109689 +65-74,F,0.987792472,0.012207528 +75-140,F,0.982372881,0.017627119 +15-24,M,0.928571429,0.071428571 +25-44,M,0.972222222,0.027777778 +45-64,M,0.964285714,0.035714286 +65-74,M,0.971774194,0.028225806 +75-140,M,0.980237154,0.019762846 \ No newline at end of file diff --git a/src/main/resources/modules/urinary_tract_infections.json b/src/main/resources/modules/urinary_tract_infections.json index c6960d9679..b6fc7d0f6a 100644 --- a/src/main/resources/modules/urinary_tract_infections.json +++ b/src/main/resources/modules/urinary_tract_infections.json @@ -60,7 +60,7 @@ }, "Cystitis": { "type": "ConditionOnset", - "target_encounter": "text", + "target_encounter": "", "codes": [ { "system": "SNOMED-CT", @@ -293,7 +293,18 @@ "value_set": "" } ], - "direct_transition": "Care Pathways", + "lookup_table_transition": [ + { + "transition": "Cystitis", + "default_probability": 0.9, + "lookup_table_name": "uti_recurrence.csv" + }, + { + "transition": "Pyelonephritis", + "default_probability": 0.1, + "lookup_table_name": "uti_recurrence.csv" + } + ], "name": "Recurrent UTI" } }, From 064058765207f2e11a7f8d7c574a34796d0e1d3a Mon Sep 17 00:00:00 2001 From: Andy Gregorowicz Date: Wed, 22 Feb 2023 16:51:57 -0500 Subject: [PATCH 67/78] Adding UTI as the reason to the encounters and medications --- src/main/resources/modules/uti/abx_tx.json | 19 +++++++++++++++++++ .../modules/uti/ambulatory_path.json | 2 +- .../resources/modules/uti/telemed_path.json | 2 +- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/main/resources/modules/uti/abx_tx.json b/src/main/resources/modules/uti/abx_tx.json index 3044f338e8..dee1abaa6c 100644 --- a/src/main/resources/modules/uti/abx_tx.json +++ b/src/main/resources/modules/uti/abx_tx.json @@ -266,6 +266,7 @@ "value_set": "" } ], + "reason": "uti", "direct_transition": "ED Check", "name": "Nitro 5 day", "assign_to_attribute": "UTI_Tx", @@ -292,6 +293,7 @@ "value_set": "" } ], + "reason": "uti", "name": "Nitro 7 day", "assign_to_attribute": "UTI_Tx", "prescription": { @@ -318,6 +320,7 @@ "value_set": "" } ], + "reason": "uti", "name": "Fosfo", "prescription": { "dosage": { @@ -344,6 +347,7 @@ "value_set": "" } ], + "reason": "uti", "name": "Sulfa 3 day", "prescription": { "dosage": { @@ -370,6 +374,7 @@ "value_set": "" } ], + "reason": "uti", "name": "Sulfa 7 day", "prescription": { "dosage": { @@ -396,6 +401,7 @@ "value_set": "" } ], + "reason": "uti", "name": "Sulfa 10 day", "prescription": { "dosage": { @@ -422,6 +428,7 @@ "value_set": "" } ], + "reason": "uti", "name": "AmxClav 500, 5 day", "assign_to_attribute": "UTI_Tx", "direct_transition": "ED Check" @@ -436,6 +443,7 @@ "value_set": "" } ], + "reason": "uti", "name": "AmxClav 875, 7 day", "assign_to_attribute": "UTI_Tx", "prescription": { @@ -462,6 +470,7 @@ "value_set": "" } ], + "reason": "uti", "name": "AmxClav 875, 10 day", "assign_to_attribute": "UTI_Tx", "prescription": { @@ -488,6 +497,7 @@ "value_set": "" } ], + "reason": "uti", "name": "Amox 7 day", "assign_to_attribute": "UTI_Tx", "prescription": { @@ -514,6 +524,7 @@ "value_set": "" } ], + "reason": "uti", "name": "Cepha 5 day", "assign_to_attribute": "UTI_Tx", "prescription": { @@ -540,6 +551,7 @@ "value_set": "" } ], + "reason": "uti", "name": "Cepha 10 day", "assign_to_attribute": "UTI_Tx", "prescription": { @@ -566,6 +578,7 @@ "value_set": "" } ], + "reason": "uti", "name": "Cepha 7 day", "assign_to_attribute": "UTI_Tx", "prescription": { @@ -592,6 +605,7 @@ "value_set": "" } ], + "reason": "uti", "name": "Cipro 250, 3 day", "assign_to_attribute": "UTI_Tx", "prescription": { @@ -618,6 +632,7 @@ "value_set": "" } ], + "reason": "uti", "name": "Cipro 500, 5 day", "assign_to_attribute": "UTI_Tx", "prescription": { @@ -644,6 +659,7 @@ "value_set": "" } ], + "reason": "uti", "name": "Cipro_500 7 day", "assign_to_attribute": "UTI_Tx", "prescription": { @@ -670,6 +686,7 @@ "value_set": "" } ], + "reason": "uti", "name": "Cefpo 100", "assign_to_attribute": "UTI_Tx", "prescription": { @@ -696,6 +713,7 @@ "value_set": "" } ], + "reason": "uti", "name": "Cefpo 200", "assign_to_attribute": "UTI_Tx", "prescription": { @@ -722,6 +740,7 @@ "value_set": "" } ], + "reason": "uti", "name": "Ceftriaxone", "assign_to_attribute": "UTI_Tx", "prescription": { diff --git a/src/main/resources/modules/uti/ambulatory_path.json b/src/main/resources/modules/uti/ambulatory_path.json index 15d0d7bdb1..fc5be22f2f 100644 --- a/src/main/resources/modules/uti/ambulatory_path.json +++ b/src/main/resources/modules/uti/ambulatory_path.json @@ -218,7 +218,7 @@ "UTI Diagnosis": { "type": "Encounter", "encounter_class": "ambulatory", - "reason": "Select Condition/Enter Attribute", + "reason": "uti", "telemedicine_possibility": "none", "codes": [ { diff --git a/src/main/resources/modules/uti/telemed_path.json b/src/main/resources/modules/uti/telemed_path.json index 4e1842b23d..bd5e3c79fd 100644 --- a/src/main/resources/modules/uti/telemed_path.json +++ b/src/main/resources/modules/uti/telemed_path.json @@ -25,7 +25,7 @@ "UTI_Diagnosis_Encounter_Audio_Only": { "type": "Encounter", "encounter_class": "ambulatory", - "reason": "", + "reason": "uti", "telemedicine_possibility": "always", "codes": [ { From 90c6ab75bdf04756947080bb11edd5991e62e789 Mon Sep 17 00:00:00 2001 From: Andy Gregorowicz Date: Thu, 23 Feb 2023 17:16:12 -0500 Subject: [PATCH 68/78] Fixing a typo in distro probability and fixing Ceftriaxone single dose --- src/main/resources/modules/uti/abx_tx.json | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/resources/modules/uti/abx_tx.json b/src/main/resources/modules/uti/abx_tx.json index dee1abaa6c..5361ead0a6 100644 --- a/src/main/resources/modules/uti/abx_tx.json +++ b/src/main/resources/modules/uti/abx_tx.json @@ -742,7 +742,6 @@ ], "reason": "uti", "name": "Ceftriaxone", - "assign_to_attribute": "UTI_Tx", "prescription": { "dosage": { "amount": 1, @@ -755,7 +754,8 @@ "unit": "days" } }, - "direct_transition": "Terminal" + "direct_transition": "Terminal", + "administration": true }, "ED Check": { "type": "Simple", @@ -790,9 +790,13 @@ }, { "transition": "Terminal", - "distribution": 1 + "distribution": 0.25 } ] + }, + { + "distributions": [], + "transition": "Terminal" } ] }, From 64ece1c69eb48ee70a21b0851b82f5e731e9d398 Mon Sep 17 00:00:00 2001 From: Andy Gregorowicz Date: Fri, 24 Feb 2023 14:08:31 -0500 Subject: [PATCH 69/78] Java and UTI module fixes Some parts of the telemedicine support were crashing the test suite as they haven't been used before. I also missed an entire slide of module implementation in the UTI telemed submodule. --- .../org/mitre/synthea/engine/Transition.java | 2 +- .../world/concepts/TelemedicineConfig.java | 3 +- src/main/resources/modules/uti/labs.json | 3 +- .../resources/modules/uti/telemed_path.json | 254 +++++++++++++++++- 4 files changed, 252 insertions(+), 10 deletions(-) diff --git a/src/main/java/org/mitre/synthea/engine/Transition.java b/src/main/java/org/mitre/synthea/engine/Transition.java index 700f77baaf..d6d65e25ba 100644 --- a/src/main/java/org/mitre/synthea/engine/Transition.java +++ b/src/main/java/org/mitre/synthea/engine/Transition.java @@ -189,7 +189,7 @@ public String follow(Person person, long time) { } } - public static final class TypeOfCareTransitionOptions { + public static final class TypeOfCareTransitionOptions implements Serializable { private String ambulatory; private String telemedicine; private String emergency; diff --git a/src/main/java/org/mitre/synthea/world/concepts/TelemedicineConfig.java b/src/main/java/org/mitre/synthea/world/concepts/TelemedicineConfig.java index ae352a108a..fe8a7402e0 100644 --- a/src/main/java/org/mitre/synthea/world/concepts/TelemedicineConfig.java +++ b/src/main/java/org/mitre/synthea/world/concepts/TelemedicineConfig.java @@ -2,6 +2,7 @@ import com.google.gson.Gson; +import java.io.Serializable; import java.time.LocalDate; import java.util.ArrayList; import java.util.HashMap; @@ -18,7 +19,7 @@ * in the simulation and their insurance. Some insurance types, or lack thereof will have higher * utilization of the emergency department. */ -public class TelemedicineConfig { +public class TelemedicineConfig implements Serializable { public static final String AMBULATORY = "ambulatory"; public static final String EMERGENCY = "emergency"; public static final String TELEMEDICINE = "telemedicine"; diff --git a/src/main/resources/modules/uti/labs.json b/src/main/resources/modules/uti/labs.json index 0f8cf93e45..c63f5be04c 100644 --- a/src/main/resources/modules/uti/labs.json +++ b/src/main/resources/modules/uti/labs.json @@ -523,7 +523,8 @@ }, "unit": "minutes", "direct_transition": "Urine Culture Result", - "name": "Urine Culture" + "name": "Urine Culture", + "assign_to_attribute": "UTI_Lab_Send_Out" }, "Urine Culture Result": { "type": "Simple", diff --git a/src/main/resources/modules/uti/telemed_path.json b/src/main/resources/modules/uti/telemed_path.json index bd5e3c79fd..b5e4b4982a 100644 --- a/src/main/resources/modules/uti/telemed_path.json +++ b/src/main/resources/modules/uti/telemed_path.json @@ -217,8 +217,30 @@ }, "End_UTI_Diagnosis": { "type": "EncounterEnd", - "direct_transition": "Terminal", - "name": "End_UTI_Diagnosis" + "name": "End_UTI_Diagnosis", + "conditional_transition": [ + { + "transition": "Time Delay", + "condition": { + "condition_type": "Or", + "conditions": [ + { + "condition_type": "Attribute", + "attribute": "UTI_Care_Referral", + "operator": "is not nil" + }, + { + "condition_type": "Attribute", + "attribute": "UTI_Labs", + "operator": "is not nil" + } + ] + } + }, + { + "transition": "Terminal" + } + ] }, "Antibiotics": { "type": "Procedure", @@ -231,16 +253,14 @@ } ], "distribution": { - "kind": "UNIFORM", + "kind": "EXACT", "parameters": { - "high": 60, - "low": 30 + "value": 10 } }, "unit": "minutes", "direct_transition": "UTI_Abx", - "name": "Antibiotics", - "assign_to_attribute": "UTI_Tx" + "name": "Antibiotics" }, "UTI_HPI": { "type": "CallSubmodule", @@ -289,6 +309,226 @@ } ], "name": "UTI_Abx" + }, + "Time Delay": { + "type": "Delay", + "distribution": { + "kind": "UNIFORM", + "parameters": { + "high": 48, + "low": 0 + } + }, + "unit": "hours", + "name": "Time Delay", + "conditional_transition": [ + { + "transition": "Lab Encounter", + "condition": { + "condition_type": "Attribute", + "attribute": "UTI_Labs", + "operator": "is not nil" + } + }, + { + "transition": "Patient Choice", + "condition": { + "condition_type": "Attribute", + "attribute": "UTI_Care_Referral", + "operator": "is not nil" + } + } + ] + }, + "Lab Encounter": { + "type": "Encounter", + "encounter_class": "ambulatory", + "reason": "uti", + "telemedicine_possibility": "none", + "codes": [ + { + "system": "SNOMED-CT", + "code": 185347001, + "display": "Encounter for problem (procedure)", + "value_set": "" + } + ], + "direct_transition": "Labs Sub", + "name": "Lab Encounter" + }, + "Labs Sub": { + "type": "CallSubmodule", + "submodule": "uti/labs", + "direct_transition": "End Labs Encounter", + "name": "Labs Sub" + }, + "End Labs Encounter": { + "type": "EncounterEnd", + "direct_transition": "Result Delay", + "name": "End Labs Encounter" + }, + "Result Delay": { + "type": "Delay", + "distribution": { + "kind": "UNIFORM", + "parameters": { + "high": 48, + "low": 24 + } + }, + "unit": "hours", + "direct_transition": "Lab Result Encounter", + "name": "Result Delay" + }, + "Lab Result Encounter": { + "type": "Encounter", + "encounter_class": "virtual", + "reason": "uti", + "telemedicine_possibility": "always", + "codes": [ + { + "system": "SNOMED-CT", + "code": 185316007, + "display": "Indirect encounter (procedure)", + "value_set": "" + } + ], + "direct_transition": "Follow Up", + "name": "Lab Result Encounter" + }, + "Follow Up": { + "type": "CallSubmodule", + "submodule": "uti/lab_follow_up", + "direct_transition": "End Results Encounter", + "name": "Follow Up" + }, + "End Results Encounter": { + "type": "EncounterEnd", + "direct_transition": "Terminal", + "name": "End Results Encounter" + }, + "Patient Choice": { + "type": "Simple", + "name": "Patient Choice", + "complex_transition": [ + { + "condition": { + "condition_type": "And", + "conditions": [ + { + "condition_type": "Attribute", + "attribute": "pregnant", + "operator": "==", + "value": true + }, + { + "condition_type": "Active Condition", + "codes": [ + { + "system": "SNOMED-CT", + "code": 45816000, + "display": "Pyelonephritis" + } + ] + } + ] + }, + "distributions": [], + "transition": "Emergency Follow Up" + }, + { + "distributions": [ + { + "transition": "Emergency Follow Up", + "distribution": 0.1 + }, + { + "transition": "Ambulatory Encounter", + "distribution": 1 + } + ] + } + ] + }, + "Ambulatory Eval": { + "type": "CallSubmodule", + "submodule": "uti/ambulatory_eval", + "name": "Ambulatory Eval", + "direct_transition": "End Ambulatory" + }, + "Ambulatory Encounter": { + "type": "Encounter", + "encounter_class": "ambulatory", + "reason": "uti", + "telemedicine_possibility": "none", + "codes": [ + { + "system": "SNOMED-CT", + "code": 390906007, + "display": "Follow-up encounter (procedure)", + "value_set": "" + } + ], + "direct_transition": "Set UTI_Ambulatory", + "name": "Ambulatory Encounter" + }, + "Set UTI_Ambulatory": { + "type": "SetAttribute", + "attribute": "UTI_Ambulatory", + "direct_transition": "Ambulatory Eval", + "name": "Set UTI_Ambulatory", + "value": true + }, + "End Ambulatory": { + "type": "EncounterEnd", + "conditional_transition": [ + { + "transition": "Result Delay", + "condition": { + "condition_type": "Attribute", + "attribute": "UTI_Lab_Send_Out", + "operator": "is not nil" + } + }, + { + "transition": "Terminal" + } + ], + "name": "End Ambulatory" + }, + "Emergency Follow Up": { + "type": "Encounter", + "encounter_class": "emergency", + "reason": "uti", + "telemedicine_possibility": "none", + "codes": [ + { + "system": "SNOMED-CT", + "code": 390906007, + "display": "Follow-up encounter (procedure)", + "value_set": "" + } + ], + "direct_transition": "Set UTI_ED", + "name": "Emergency Follow Up" + }, + "ED Eval": { + "type": "CallSubmodule", + "submodule": "uti/ed_eval", + "direct_transition": "End ED Encounter", + "name": "ED Eval" + }, + "End ED Encounter": { + "type": "EncounterEnd", + "direct_transition": "Terminal", + "name": "End ED Encounter" + }, + "Set UTI_ED": { + "type": "SetAttribute", + "attribute": "UTI_ED", + "direct_transition": "ED Eval", + "name": "Set UTI_ED", + "value": true } }, "gmf_version": 2 From be7588215a863f756dca909c1ef965014ff54923 Mon Sep 17 00:00:00 2001 From: Andy Gregorowicz Date: Wed, 1 Mar 2023 14:13:30 -0500 Subject: [PATCH 70/78] Addressing an issue on the UTI ED path with a temp fix --- src/main/resources/modules/uti/ed_eval.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/modules/uti/ed_eval.json b/src/main/resources/modules/uti/ed_eval.json index 411c7ead85..fe9a1c778f 100644 --- a/src/main/resources/modules/uti/ed_eval.json +++ b/src/main/resources/modules/uti/ed_eval.json @@ -150,7 +150,7 @@ } }, "unit": "minutes", - "direct_transition": "Terminal", + "direct_transition": "Antibiotic therapy", "name": "Hospital admission" } }, From b1d60a51fd80989179eea56714c73d94c58dbb4a Mon Sep 17 00:00:00 2001 From: Andy Gregorowicz Date: Thu, 2 Mar 2023 17:09:57 -0500 Subject: [PATCH 71/78] Final tweak to the UTI ED Eval submodule to handle lack of information on inpatient admission --- src/main/resources/modules/uti/ed_eval.json | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/src/main/resources/modules/uti/ed_eval.json b/src/main/resources/modules/uti/ed_eval.json index fe9a1c778f..5d20ce1463 100644 --- a/src/main/resources/modules/uti/ed_eval.json +++ b/src/main/resources/modules/uti/ed_eval.json @@ -104,8 +104,7 @@ }, "unit": "minutes", "direct_transition": "UTI_Abx", - "name": "Antibiotic therapy", - "assign_to_attribute": "UTI_Tx" + "name": "Antibiotic therapy" }, "UTI_Abx": { "type": "CallSubmodule", @@ -134,22 +133,7 @@ "name": "Patient discharge" }, "Hospital admission": { - "type": "Procedure", - "codes": [ - { - "system": "SNOMED-CT", - "code": 32485007, - "display": "Hospital admission (procedure)", - "value_set": "" - } - ], - "distribution": { - "kind": "EXACT", - "parameters": { - "value": 10 - } - }, - "unit": "minutes", + "type": "Simple", "direct_transition": "Antibiotic therapy", "name": "Hospital admission" } From 66f2c1b8de674750369b9bae6686dc6dee18fede Mon Sep 17 00:00:00 2001 From: Andy Gregorowicz Date: Tue, 21 Nov 2023 15:52:03 -0500 Subject: [PATCH 72/78] Update src/main/resources/modules/uti/abx_tx.json Co-authored-by: Dylan Hall --- src/main/resources/modules/uti/abx_tx.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/modules/uti/abx_tx.json b/src/main/resources/modules/uti/abx_tx.json index 5361ead0a6..8fb0028f38 100644 --- a/src/main/resources/modules/uti/abx_tx.json +++ b/src/main/resources/modules/uti/abx_tx.json @@ -352,8 +352,8 @@ "prescription": { "dosage": { "amount": 1, - "frequency": 1, - "period": 2, + "frequency": 2, + "period": 1, "unit": "days" }, "duration": { From e9da3e4e4dcf624c97b1f72e1e3b3c66b8034c1e Mon Sep 17 00:00:00 2001 From: Andy Gregorowicz Date: Tue, 21 Nov 2023 15:52:22 -0500 Subject: [PATCH 73/78] Update src/main/resources/modules/uti/abx_tx.json Co-authored-by: Dylan Hall --- src/main/resources/modules/uti/abx_tx.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/modules/uti/abx_tx.json b/src/main/resources/modules/uti/abx_tx.json index 8fb0028f38..1e0606d138 100644 --- a/src/main/resources/modules/uti/abx_tx.json +++ b/src/main/resources/modules/uti/abx_tx.json @@ -406,8 +406,8 @@ "prescription": { "dosage": { "amount": 1, - "frequency": 1, - "period": 2, + "frequency": 2, + "period": 1, "unit": "days" }, "duration": { From 5f31d4a154a15c2a378f50361a953e66b9fdc297 Mon Sep 17 00:00:00 2001 From: Andy Gregorowicz Date: Tue, 21 Nov 2023 15:52:30 -0500 Subject: [PATCH 74/78] Update src/main/resources/modules/uti/abx_tx.json Co-authored-by: Dylan Hall --- src/main/resources/modules/uti/abx_tx.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/modules/uti/abx_tx.json b/src/main/resources/modules/uti/abx_tx.json index 1e0606d138..0a9aefb791 100644 --- a/src/main/resources/modules/uti/abx_tx.json +++ b/src/main/resources/modules/uti/abx_tx.json @@ -379,8 +379,8 @@ "prescription": { "dosage": { "amount": 1, - "frequency": 1, - "period": 2, + "frequency": 2, + "period": 1, "unit": "days" }, "duration": { From 4479542b668a8d1a3f824827c617cb6830bc522a Mon Sep 17 00:00:00 2001 From: Andy Gregorowicz Date: Tue, 21 Nov 2023 15:53:14 -0500 Subject: [PATCH 75/78] Update src/main/resources/modules/uti/ed_path.json Co-authored-by: Dylan Hall --- src/main/resources/modules/uti/ed_path.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/modules/uti/ed_path.json b/src/main/resources/modules/uti/ed_path.json index 0399a55788..3cfce0eda0 100644 --- a/src/main/resources/modules/uti/ed_path.json +++ b/src/main/resources/modules/uti/ed_path.json @@ -1,5 +1,5 @@ { - "name": "UTI_ED", + "name": "UTI_ED_Path", "remarks": [ "A blank module" ], From 60a5623570601e7502f8869e53d51617e433d49d Mon Sep 17 00:00:00 2001 From: Andy Gregorowicz Date: Tue, 21 Nov 2023 15:53:24 -0500 Subject: [PATCH 76/78] Update src/main/resources/modules/uti/telemed_path.json Co-authored-by: Dylan Hall --- src/main/resources/modules/uti/telemed_path.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/modules/uti/telemed_path.json b/src/main/resources/modules/uti/telemed_path.json index b5e4b4982a..d29cb5761a 100644 --- a/src/main/resources/modules/uti/telemed_path.json +++ b/src/main/resources/modules/uti/telemed_path.json @@ -1,5 +1,5 @@ { - "name": "UTI_Telemed", + "name": "UTI_Telemed_Path", "remarks": [ "A blank module" ], From 8fbe3fe8a6bab9d55cd193786e40af678c08792d Mon Sep 17 00:00:00 2001 From: Andy Gregorowicz Date: Tue, 21 Nov 2023 15:53:38 -0500 Subject: [PATCH 77/78] Update src/main/resources/modules/uti/telemed_path.json Co-authored-by: Dylan Hall --- src/main/resources/modules/uti/telemed_path.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/modules/uti/telemed_path.json b/src/main/resources/modules/uti/telemed_path.json index d29cb5761a..36c6246536 100644 --- a/src/main/resources/modules/uti/telemed_path.json +++ b/src/main/resources/modules/uti/telemed_path.json @@ -444,7 +444,7 @@ }, { "transition": "Ambulatory Encounter", - "distribution": 1 + "distribution": 0.9 } ] } From 0b73cc0a670e258d64d781e5846882ffaeeec73c Mon Sep 17 00:00:00 2001 From: Andy Gregorowicz Date: Mon, 27 Nov 2023 16:26:33 -0500 Subject: [PATCH 78/78] Removing blank module remarks --- src/main/resources/modules/uti/abx_tx.json | 3 --- src/main/resources/modules/uti/ambulatory_eval.json | 3 --- src/main/resources/modules/uti/ambulatory_path.json | 3 --- src/main/resources/modules/uti/ed_bundle.json | 3 --- src/main/resources/modules/uti/ed_eval.json | 3 --- src/main/resources/modules/uti/ed_path.json | 3 --- src/main/resources/modules/uti/gu_pregnancy_check.json | 3 --- src/main/resources/modules/uti/lab_follow_up.json | 3 --- src/main/resources/modules/uti/labs.json | 3 --- src/main/resources/modules/uti/telemed_path.json | 3 --- 10 files changed, 30 deletions(-) diff --git a/src/main/resources/modules/uti/abx_tx.json b/src/main/resources/modules/uti/abx_tx.json index 0a9aefb791..918921a5f9 100644 --- a/src/main/resources/modules/uti/abx_tx.json +++ b/src/main/resources/modules/uti/abx_tx.json @@ -1,8 +1,5 @@ { "name": "Abx_Tx", - "remarks": [ - "A blank module" - ], "states": { "Initial": { "type": "Initial", diff --git a/src/main/resources/modules/uti/ambulatory_eval.json b/src/main/resources/modules/uti/ambulatory_eval.json index ff7532ba5e..52c339867c 100644 --- a/src/main/resources/modules/uti/ambulatory_eval.json +++ b/src/main/resources/modules/uti/ambulatory_eval.json @@ -1,8 +1,5 @@ { "name": "UTI_Ambulatory_Eval", - "remarks": [ - "A blank module" - ], "states": { "Initial": { "type": "Initial", diff --git a/src/main/resources/modules/uti/ambulatory_path.json b/src/main/resources/modules/uti/ambulatory_path.json index fc5be22f2f..6b819efbcc 100644 --- a/src/main/resources/modules/uti/ambulatory_path.json +++ b/src/main/resources/modules/uti/ambulatory_path.json @@ -1,8 +1,5 @@ { "name": "UTI_Ambulatory", - "remarks": [ - "A blank module" - ], "states": { "Initial": { "type": "Initial", diff --git a/src/main/resources/modules/uti/ed_bundle.json b/src/main/resources/modules/uti/ed_bundle.json index 078a665682..c5f6e9dc73 100644 --- a/src/main/resources/modules/uti/ed_bundle.json +++ b/src/main/resources/modules/uti/ed_bundle.json @@ -1,8 +1,5 @@ { "name": "UTI_ED_Bundle", - "remarks": [ - "A blank module" - ], "states": { "Initial": { "type": "Initial", diff --git a/src/main/resources/modules/uti/ed_eval.json b/src/main/resources/modules/uti/ed_eval.json index 5d20ce1463..68ca9f63e1 100644 --- a/src/main/resources/modules/uti/ed_eval.json +++ b/src/main/resources/modules/uti/ed_eval.json @@ -1,8 +1,5 @@ { "name": "UTI_ED_Eval", - "remarks": [ - "A blank module" - ], "states": { "Initial": { "type": "Initial", diff --git a/src/main/resources/modules/uti/ed_path.json b/src/main/resources/modules/uti/ed_path.json index 3cfce0eda0..99f8957572 100644 --- a/src/main/resources/modules/uti/ed_path.json +++ b/src/main/resources/modules/uti/ed_path.json @@ -1,8 +1,5 @@ { "name": "UTI_ED_Path", - "remarks": [ - "A blank module" - ], "states": { "Initial": { "type": "Initial", diff --git a/src/main/resources/modules/uti/gu_pregnancy_check.json b/src/main/resources/modules/uti/gu_pregnancy_check.json index 6de70ca573..4cab684af3 100644 --- a/src/main/resources/modules/uti/gu_pregnancy_check.json +++ b/src/main/resources/modules/uti/gu_pregnancy_check.json @@ -1,8 +1,5 @@ { "name": "GU_Pregnancy_Check", - "remarks": [ - "A blank module" - ], "states": { "Initial": { "type": "Initial", diff --git a/src/main/resources/modules/uti/lab_follow_up.json b/src/main/resources/modules/uti/lab_follow_up.json index 3dd37b8201..00ad3a2261 100644 --- a/src/main/resources/modules/uti/lab_follow_up.json +++ b/src/main/resources/modules/uti/lab_follow_up.json @@ -1,8 +1,5 @@ { "name": "UTI_Lab_Follow_Up", - "remarks": [ - "A blank module" - ], "states": { "Initial": { "type": "Initial", diff --git a/src/main/resources/modules/uti/labs.json b/src/main/resources/modules/uti/labs.json index c63f5be04c..9563966953 100644 --- a/src/main/resources/modules/uti/labs.json +++ b/src/main/resources/modules/uti/labs.json @@ -1,8 +1,5 @@ { "name": "UTI_Labs", - "remarks": [ - "A blank module" - ], "states": { "Initial": { "type": "Initial", diff --git a/src/main/resources/modules/uti/telemed_path.json b/src/main/resources/modules/uti/telemed_path.json index 36c6246536..e2574f2e0c 100644 --- a/src/main/resources/modules/uti/telemed_path.json +++ b/src/main/resources/modules/uti/telemed_path.json @@ -1,8 +1,5 @@ { "name": "UTI_Telemed_Path", - "remarks": [ - "A blank module" - ], "states": { "Initial": { "type": "Initial",