Fix a crash in R4 validation

This commit is contained in:
James Agnew 2019-07-04 16:27:04 -04:00
parent eacee1516b
commit 6e20b53979
15 changed files with 9114 additions and 1 deletions

View File

@ -1,5 +1,8 @@
package ca.uhn.fhir.jpa.dao.r4;
import ca.uhn.fhir.jpa.dao.DaoConfig;
import ca.uhn.fhir.jpa.dao.DaoRegistry;
import ca.uhn.fhir.jpa.dao.IFhirResourceDao;
import ca.uhn.fhir.rest.api.EncodingEnum;
import ca.uhn.fhir.rest.api.MethodOutcome;
import ca.uhn.fhir.rest.api.ValidationModeEnum;
@ -10,6 +13,7 @@ import ca.uhn.fhir.rest.server.exceptions.UnprocessableEntityException;
import ca.uhn.fhir.util.StopWatch;
import ca.uhn.fhir.util.TestUtil;
import ca.uhn.fhir.validation.IValidatorModule;
import com.google.common.base.Charsets;
import org.apache.commons.io.IOUtils;
import org.hl7.fhir.instance.model.api.IBaseResource;
import org.hl7.fhir.instance.model.api.IIdType;
@ -229,6 +233,9 @@ public class FhirResourceDaoR4ValidateTest extends BaseJpaR4Test {
public void after() {
FhirInstanceValidator val = AopTestUtils.getTargetObject(myValidatorModule);
val.setBestPracticeWarningLevel(IResourceValidator.BestPracticeWarningLevel.Warning);
myDaoConfig.setAllowExternalReferences(new DaoConfig().isAllowExternalReferences());
}
@Test
@ -370,6 +377,61 @@ public class FhirResourceDaoR4ValidateTest extends BaseJpaR4Test {
}
@Test
public void testValidateUsCoreR4Content() throws IOException {
myDaoConfig.setAllowExternalReferences(true);
upload("/r4/uscore/CodeSystem-cdcrec.json");
upload("/r4/uscore/StructureDefinition-us-core-birthsex.json");
upload("/r4/uscore/StructureDefinition-us-core-ethnicity.json");
upload("/r4/uscore/StructureDefinition-us-core-patient.json");
upload("/r4/uscore/StructureDefinition-us-core-race.json");
upload("/r4/uscore/ValueSet-birthsex.json");
upload("/r4/uscore/ValueSet-detailed-ethnicity.json");
upload("/r4/uscore/ValueSet-detailed-race.json");
upload("/r4/uscore/ValueSet-omb-ethnicity-category.json");
upload("/r4/uscore/ValueSet-omb-race-category.json");
upload("/r4/uscore/ValueSet-us-core-usps-state.json");
{
String resource = loadResource("/r4/uscore/patient-resource-badcode.json");
IBaseResource parsedResource = myFhirCtx.newJsonParser().parseResource(resource);
try {
myPatientDao.validate((Patient) parsedResource, null, resource, null, null, null, mySrd);
fail();
} catch (PreconditionFailedException e) {
OperationOutcome oo = (OperationOutcome) e.getOperationOutcome();
String encoded = myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(oo);
ourLog.info("Outcome:\n{}", encoded);
assertThat(encoded, containsString("Unknown code {urn:oid:2.16.840.1.113883.6.238}2106-3AAA"));
}
}
{
String resource = loadResource("/r4/uscore/patient-resource-good.json");
IBaseResource parsedResource = myFhirCtx.newJsonParser().parseResource(resource);
MethodOutcome outcome = myPatientDao.validate((Patient) parsedResource, null, resource, null, null, null, mySrd);
OperationOutcome oo = (OperationOutcome) outcome.getOperationOutcome();
String encoded = myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(oo);
ourLog.info("Outcome:\n{}", encoded);
assertThat(encoded, containsString("No issues detected"));
}
}
@SuppressWarnings("unchecked")
private void upload(String theClasspath) throws IOException {
String resource = loadResource(theClasspath);
IBaseResource resourceParsed = myFhirCtx.newJsonParser().parseResource(resource);
IFhirResourceDao dao = myDaoRegistry.getResourceDao(resourceParsed.getIdElement().getResourceType());
dao.update(resourceParsed);
}
private String loadResource(String theClasspath) throws IOException {
return IOUtils.toString(FhirResourceDaoR4ValidateTest.class.getResourceAsStream(theClasspath), Charsets.UTF_8);
}
@Autowired
private DaoRegistry myDaoRegistry;
private IBaseResource findResourceByIdInBundle(Bundle vss, String name) {
IBaseResource retVal = null;
for (BundleEntryComponent next : vss.getEntry()) {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
{"resourceType":"ValueSet","id":"birthsex","text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>Birth Sex</h2><div><p>Codes for assigning sex at birth as specified by the <a href=\"https://www.healthit.gov/newsroom/about-onc\">Office of the National Coordinator for Health IT (ONC)</a></p>\n</div><p>This value set includes codes from the following code systems:</p><ul><li>Include these codes as defined in <a href=\"http://hl7.org/fhir/R4/v3/AdministrativeGender/cs.html\"><code>http://terminology.hl7.org/CodeSystem/v3-AdministrativeGender</code></a><table class=\"none\"><tr><td style=\"white-space:nowrap\"><b>Code</b></td><td><b>Display</b></td></tr><tr><td><a href=\"http://hl7.org/fhir/R4/v3/AdministrativeGender/cs.html#v3-AdministrativeGender-F\">F</a></td><td>Female</td><td>Female</td></tr><tr><td><a href=\"http://hl7.org/fhir/R4/v3/AdministrativeGender/cs.html#v3-AdministrativeGender-M\">M</a></td><td>Male</td><td>Male</td></tr></table></li><li>Include these codes as defined in <a href=\"http://hl7.org/fhir/R4/v3/NullFlavor/cs.html\"><code>http://terminology.hl7.org/CodeSystem/v3-NullFlavor</code></a><table class=\"none\"><tr><td style=\"white-space:nowrap\"><b>Code</b></td><td><b>Display</b></td></tr><tr><td><a href=\"http://hl7.org/fhir/R4/v3/NullFlavor/cs.html#v3-NullFlavor-UNK\">UNK</a></td><td>Unknown</td><td>Description:A proper value is applicable, but not known.<br/>\n \n Usage Notes: This means the actual value is not known. If the only thing that is unknown is how to properly express the value in the necessary constraints (value set, datatype, etc.), then the OTH or UNC flavor should be used. No properties should be included for a datatype with this property unless:<br/>\n \n Those properties themselves directly translate to a semantic of &quot;unknown&quot;. (E.g. a local code sent as a translation that conveys 'unknown')\n Those properties further qualify the nature of what is unknown. (E.g. specifying a use code of &quot;H&quot; and a URL prefix of &quot;tel:&quot; to convey that it is the home phone number that is unknown.)</td></tr></table></li></ul></div>"},"url":"http://hl7.org/fhir/us/core/ValueSet/birthsex","identifier":[{"system":"urn:ietf:rfc:3986","value":"urn:oid:2.16.840.1.113762.1.4.1021.24"}],"version":"3.0.0","name":"BirthSex","title":"Birth Sex","status":"active","date":"2019-05-21T00:00:00+00:00","publisher":"HL7 US Realm Steering Committee","contact":[{"telecom":[{"system":"other","value":"http://hl7.org/fhir"}]}],"description":"Codes for assigning sex at birth as specified by the [Office of the National Coordinator for Health IT (ONC)](https://www.healthit.gov/newsroom/about-onc)","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"compose":{"include":[{"system":"http://terminology.hl7.org/CodeSystem/v3-AdministrativeGender","concept":[{"code":"F","display":"Female"},{"code":"M","display":"Male"}]},{"system":"http://terminology.hl7.org/CodeSystem/v3-NullFlavor","concept":[{"code":"UNK","display":"Unknown"}]}]}}

View File

@ -0,0 +1 @@
{"resourceType":"ValueSet","id":"detailed-ethnicity","text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>Detailed ethnicity</h2><div><p>The 41 <a href=\"http://www.cdc.gov/phin/resources/vocabulary/index.html\">CDC ethnicity codes</a> that are grouped under one of the 2 OMB ethnicity category codes.</p>\n</div><p>This value set includes codes from the following code systems:</p><ul><li>Include codes from <a href=\"CodeSystem-cdcrec.html\"><code>urn:oid:2.16.840.1.113883.6.238</code></a> where concept is-a <a href=\"CodeSystem-cdcrec.html#cdcrec-2133-7\">2133-7</a></li><li>Exclude these codes as defined in <a href=\"CodeSystem-cdcrec.html\"><code>urn:oid:2.16.840.1.113883.6.238</code></a><table class=\"none\"><tr><td style=\"white-space:nowrap\"><b>Code</b></td><td><b>Display</b></td></tr><tr><td><a href=\"CodeSystem-cdcrec.html#cdcrec-2135-2\">2135-2</a></td><td>Hispanic or Latino</td><td>Hispanic or Latino</td></tr><tr><td><a href=\"CodeSystem-cdcrec.html#cdcrec-2186-5\">2186-5</a></td><td>Not Hispanic or Latino</td><td>Note that this term remains in the table for completeness, even though within HL7, the notion of &quot;not otherwise coded&quot; term is deprecated.</td></tr></table></li></ul></div>"},"url":"http://hl7.org/fhir/us/core/ValueSet/detailed-ethnicity","version":"3.0.0","name":"DetailedEthnicity","title":"Detailed ethnicity","status":"active","date":"2019-05-21T00:00:00+00:00","publisher":"HL7 US Realm Steering Committee","description":"The 41 [CDC ethnicity codes](http://www.cdc.gov/phin/resources/vocabulary/index.html) that are grouped under one of the 2 OMB ethnicity category codes.","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"compose":{"include":[{"system":"urn:oid:2.16.840.1.113883.6.238","filter":[{"property":"concept","op":"is-a","value":"2133-7"}]}],"exclude":[{"system":"urn:oid:2.16.840.1.113883.6.238","concept":[{"code":"2135-2"},{"code":"2186-5"}]}]}}

View File

@ -0,0 +1 @@
{"resourceType":"ValueSet","id":"detailed-race","text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>Detailed Race</h2><div><p>The 900+ <a href=\"http://www.cdc.gov/phin/resources/vocabulary/index.html\">CDC Race codes</a> that are grouped under one of the 5 OMB race category codes.</p>\n</div><p>This value set includes codes from the following code systems:</p><ul><li>Include codes from <a href=\"CodeSystem-cdcrec.html\"><code>urn:oid:2.16.840.1.113883.6.238</code></a> where concept is-a <a href=\"CodeSystem-cdcrec.html#cdcrec-1000-9\">1000-9</a></li><li>Exclude these codes as defined in <a href=\"CodeSystem-cdcrec.html\"><code>urn:oid:2.16.840.1.113883.6.238</code></a><table class=\"none\"><tr><td style=\"white-space:nowrap\"><b>Code</b></td><td><b>Display</b></td></tr><tr><td><a href=\"CodeSystem-cdcrec.html#cdcrec-1002-5\">1002-5</a></td><td>American Indian or Alaska Native</td><td>American Indian or Alaska Native</td></tr><tr><td><a href=\"CodeSystem-cdcrec.html#cdcrec-2028-9\">2028-9</a></td><td>Asian</td><td>Asian</td></tr><tr><td><a href=\"CodeSystem-cdcrec.html#cdcrec-2054-5\">2054-5</a></td><td>Black or African American</td><td>Black or African American</td></tr><tr><td><a href=\"CodeSystem-cdcrec.html#cdcrec-2076-8\">2076-8</a></td><td>Native Hawaiian or Other Pacific Islander</td><td>Native Hawaiian or Other Pacific Islander</td></tr><tr><td><a href=\"CodeSystem-cdcrec.html#cdcrec-2106-3\">2106-3</a></td><td>White</td><td>White</td></tr></table></li></ul></div>"},"url":"http://hl7.org/fhir/us/core/ValueSet/detailed-race","version":"3.0.0","name":"DetailedRace","title":"Detailed Race","status":"active","date":"2019-05-21T00:00:00+00:00","publisher":"HL7 US Realm Steering Committee","description":"The 900+ [CDC Race codes](http://www.cdc.gov/phin/resources/vocabulary/index.html) that are grouped under one of the 5 OMB race category codes.","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"compose":{"include":[{"system":"urn:oid:2.16.840.1.113883.6.238","filter":[{"property":"concept","op":"is-a","value":"1000-9"}]}],"exclude":[{"system":"urn:oid:2.16.840.1.113883.6.238","concept":[{"code":"1002-5"},{"code":"2028-9"},{"code":"2054-5"},{"code":"2076-8"},{"code":"2106-3"}]}]}}

View File

@ -0,0 +1 @@
{"resourceType":"ValueSet","id":"omb-ethnicity-category","text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>OMB Ethnicity Categories</h2><div><p>The codes for the ethnicity categories - 'Hispanic or Latino' and 'Non Hispanic or Latino' - as defined by the <a href=\"https://www.whitehouse.gov/omb/fedreg_1997standards\">OMB Standards for Maintaining, Collecting, and Presenting Federal Data on Race and Ethnicity, Statistical Policy Directive No. 15, as revised, October 30, 1997</a>.</p>\n</div><p>This value set includes codes from the following code systems:</p><ul><li>Include these codes as defined in <a href=\"CodeSystem-cdcrec.html\"><code>urn:oid:2.16.840.1.113883.6.238</code></a><table class=\"none\"><tr><td style=\"white-space:nowrap\"><b>Code</b></td><td><b>Display</b></td></tr><tr><td><a href=\"CodeSystem-cdcrec.html#cdcrec-2135-2\">2135-2</a></td><td>Hispanic or Latino</td><td>Hispanic or Latino</td></tr><tr><td><a href=\"CodeSystem-cdcrec.html#cdcrec-2186-5\">2186-5</a></td><td>Non Hispanic or Latino</td><td>Note that this term remains in the table for completeness, even though within HL7, the notion of &quot;not otherwise coded&quot; term is deprecated.</td></tr></table></li></ul></div>"},"url":"http://hl7.org/fhir/us/core/ValueSet/omb-ethnicity-category","version":"3.0.0","name":"OmbEthnicityCategories","title":"OMB Ethnicity Categories","status":"active","date":"2019-05-21T00:00:00+00:00","publisher":"HL7 US Realm Steering Committee","description":"The codes for the ethnicity categories - 'Hispanic or Latino' and 'Non Hispanic or Latino' - as defined by the [OMB Standards for Maintaining, Collecting, and Presenting Federal Data on Race and Ethnicity, Statistical Policy Directive No. 15, as revised, October 30, 1997](https://www.whitehouse.gov/omb/fedreg_1997standards).","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"compose":{"include":[{"system":"urn:oid:2.16.840.1.113883.6.238","concept":[{"code":"2135-2","display":"Hispanic or Latino"},{"code":"2186-5","display":"Non Hispanic or Latino"}]}]}}

View File

@ -0,0 +1 @@
{"resourceType":"ValueSet","id":"omb-race-category","text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>OMB Race Categories</h2><div><p>The codes for the concepts 'Unknown' and 'Asked but no answer' and the the codes for the five race categories - 'American Indian' or 'Alaska Native', 'Asian', 'Black or African American', 'Native Hawaiian or Other Pacific Islander', and 'White' - as defined by the <a href=\"https://www.whitehouse.gov/omb/fedreg_1997standards\">OMB Standards for Maintaining, Collecting, and Presenting Federal Data on Race and Ethnicity, Statistical Policy Directive No. 15, as revised, October 30, 1997</a> .</p>\n</div><p>This value set includes codes from the following code systems:</p><ul><li>Include these codes as defined in <a href=\"CodeSystem-cdcrec.html\"><code>urn:oid:2.16.840.1.113883.6.238</code></a><table class=\"none\"><tr><td style=\"white-space:nowrap\"><b>Code</b></td><td><b>Display</b></td></tr><tr><td><a href=\"CodeSystem-cdcrec.html#cdcrec-1002-5\">1002-5</a></td><td>American Indian or Alaska Native</td><td>American Indian or Alaska Native</td></tr><tr><td><a href=\"CodeSystem-cdcrec.html#cdcrec-2028-9\">2028-9</a></td><td>Asian</td><td>Asian</td></tr><tr><td><a href=\"CodeSystem-cdcrec.html#cdcrec-2054-5\">2054-5</a></td><td>Black or African American</td><td>Black or African American</td></tr><tr><td><a href=\"CodeSystem-cdcrec.html#cdcrec-2076-8\">2076-8</a></td><td>Native Hawaiian or Other Pacific Islander</td><td>Native Hawaiian or Other Pacific Islander</td></tr><tr><td><a href=\"CodeSystem-cdcrec.html#cdcrec-2106-3\">2106-3</a></td><td>White</td><td>White</td></tr></table></li><li>Include these codes as defined in <a href=\"http://hl7.org/fhir/R4/v3/NullFlavor/cs.html\"><code>http://terminology.hl7.org/CodeSystem/v3-NullFlavor</code></a><table class=\"none\"><tr><td style=\"white-space:nowrap\"><b>Code</b></td><td><b>Display</b></td></tr><tr><td><a href=\"http://hl7.org/fhir/R4/v3/NullFlavor/cs.html#v3-NullFlavor-UNK\">UNK</a></td><td>Unknown</td><td>Description:A proper value is applicable, but not known.<br/>\n \n Usage Notes: This means the actual value is not known. If the only thing that is unknown is how to properly express the value in the necessary constraints (value set, datatype, etc.), then the OTH or UNC flavor should be used. No properties should be included for a datatype with this property unless:<br/>\n \n Those properties themselves directly translate to a semantic of &quot;unknown&quot;. (E.g. a local code sent as a translation that conveys 'unknown')\n Those properties further qualify the nature of what is unknown. (E.g. specifying a use code of &quot;H&quot; and a URL prefix of &quot;tel:&quot; to convey that it is the home phone number that is unknown.)</td></tr><tr><td><a href=\"http://hl7.org/fhir/R4/v3/NullFlavor/cs.html#v3-NullFlavor-ASKU\">ASKU</a></td><td>Asked but no answer</td><td>Information was sought but not found (e.g., patient was asked but didn't know)</td></tr></table></li></ul></div>"},"url":"http://hl7.org/fhir/us/core/ValueSet/omb-race-category","identifier":[{"system":"urn:ietf:rfc:3986","value":"urn:oid:2.16.840.1.113883.4.642.2.575"}],"version":"3.0.0","name":"OmbRaceCategories","title":"OMB Race Categories","status":"active","date":"2019-05-21T00:00:00+00:00","publisher":"HL7 US Realm Steering Committee","contact":[{"telecom":[{"system":"other","value":"http://hl7.org/fhir"}]},{"telecom":[{"system":"other","value":"http://wiki.siframework.org/Data+Access+Framework+Homepage"}]}],"description":"The codes for the concepts 'Unknown' and 'Asked but no answer' and the the codes for the five race categories - 'American Indian' or 'Alaska Native', 'Asian', 'Black or African American', 'Native Hawaiian or Other Pacific Islander', and 'White' - as defined by the [OMB Standards for Maintaining, Collecting, and Presenting Federal Data on Race and Ethnicity, Statistical Policy Directive No. 15, as revised, October 30, 1997](https://www.whitehouse.gov/omb/fedreg_1997standards) .","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"compose":{"include":[{"system":"urn:oid:2.16.840.1.113883.6.238","concept":[{"code":"1002-5","display":"American Indian or Alaska Native"},{"code":"2028-9","display":"Asian"},{"code":"2054-5","display":"Black or African American"},{"code":"2076-8","display":"Native Hawaiian or Other Pacific Islander"},{"code":"2106-3","display":"White"}]},{"system":"http://terminology.hl7.org/CodeSystem/v3-NullFlavor","concept":[{"code":"UNK","display":"Unknown"},{"code":"ASKU","display":"Asked but no answer"}]}]}}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,152 @@
{
"resourceType" : "Patient",
"id" : "example",
"meta" : {
"profile" : [
"http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient"
]
},
"text" : {
"status" : "generated",
"div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\">Amy Shaw</div>"
},
"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-3AAA",
"display" : "White"
}
},
{
"url" : "ombCategory",
"valueCoding" : {
"system" : "urn:oid:2.16.840.1.113883.6.238",
"code" : "1002-5",
"display" : "American Indian or Alaska Native"
}
},
{
"url" : "ombCategory",
"valueCoding" : {
"system" : "urn:oid:2.16.840.1.113883.6.238",
"code" : "2028-9",
"display" : "Asian"
}
},
{
"url" : "detailed",
"valueCoding" : {
"system" : "urn:oid:2.16.840.1.113883.6.238",
"code" : "1586-7",
"display" : "Shoshone"
}
},
{
"url" : "detailed",
"valueCoding" : {
"system" : "urn:oid:2.16.840.1.113883.6.238",
"code" : "2036-2",
"display" : "Filipino"
}
},
{
"url" : "text",
"valueString" : "Mixed"
}
]
},
{
"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" : "2135-2",
"display" : "Hispanic or Latino"
}
},
{
"url" : "detailed",
"valueCoding" : {
"system" : "urn:oid:2.16.840.1.113883.6.238",
"code" : "2184-0",
"display" : "Dominican"
}
},
{
"url" : "detailed",
"valueCoding" : {
"system" : "urn:oid:2.16.840.1.113883.6.238",
"code" : "2148-5",
"display" : "Mexican"
}
},
{
"url" : "text",
"valueString" : "Hispanic or Latino"
}
]
},
{
"url" : "http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex",
"valueCode" : "F"
}
],
"identifier" : [
{
"use" : "usual",
"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" : "1032702"
}
],
"active" : true,
"name" : [
{
"family" : "Shaw",
"given" : [
"Amy",
"V."
]
}
],
"telecom" : [
{
"system" : "phone",
"value" : "555-555-5555",
"use" : "home"
},
{
"system" : "email",
"value" : "amy.shaw@example.com"
}
],
"gender" : "female",
"birthDate" : "2007-02-20",
"address" : [
{
"line" : [
"49 Meadow St"
],
"city" : "Mounds",
"state" : "OK",
"postalCode" : "74047",
"country" : "US"
}
]
}

View File

@ -0,0 +1,152 @@
{
"resourceType" : "Patient",
"id" : "example",
"meta" : {
"profile" : [
"http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient"
]
},
"text" : {
"status" : "generated",
"div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\">Amy Shaw</div>"
},
"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" : "ombCategory",
"valueCoding" : {
"system" : "urn:oid:2.16.840.1.113883.6.238",
"code" : "1002-5",
"display" : "American Indian or Alaska Native"
}
},
{
"url" : "ombCategory",
"valueCoding" : {
"system" : "urn:oid:2.16.840.1.113883.6.238",
"code" : "2028-9",
"display" : "Asian"
}
},
{
"url" : "detailed",
"valueCoding" : {
"system" : "urn:oid:2.16.840.1.113883.6.238",
"code" : "1586-7",
"display" : "Shoshone"
}
},
{
"url" : "detailed",
"valueCoding" : {
"system" : "urn:oid:2.16.840.1.113883.6.238",
"code" : "2036-2",
"display" : "Filipino"
}
},
{
"url" : "text",
"valueString" : "Mixed"
}
]
},
{
"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" : "2135-2",
"display" : "Hispanic or Latino"
}
},
{
"url" : "detailed",
"valueCoding" : {
"system" : "urn:oid:2.16.840.1.113883.6.238",
"code" : "2184-0",
"display" : "Dominican"
}
},
{
"url" : "detailed",
"valueCoding" : {
"system" : "urn:oid:2.16.840.1.113883.6.238",
"code" : "2148-5",
"display" : "Mexican"
}
},
{
"url" : "text",
"valueString" : "Hispanic or Latino"
}
]
},
{
"url" : "http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex",
"valueCode" : "F"
}
],
"identifier" : [
{
"use" : "usual",
"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" : "1032702"
}
],
"active" : true,
"name" : [
{
"family" : "Shaw",
"given" : [
"Amy",
"V."
]
}
],
"telecom" : [
{
"system" : "phone",
"value" : "555-555-5555",
"use" : "home"
},
{
"system" : "email",
"value" : "amy.shaw@example.com"
}
],
"gender" : "female",
"birthDate" : "2007-02-20",
"address" : [
{
"line" : [
"49 Meadow St"
],
"city" : "Mounds",
"state" : "OK",
"postalCode" : "74047",
"country" : "US"
}
]
}

View File

@ -816,7 +816,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
txWarning(errors, s.getTxLink(), IssueType.CODEINVALID, element.line(), element.col(), path, s == null, s.getMessage());
return true;
}
if (s.getErrorClass().isInfrastructure())
if (s.getErrorClass() != null && s.getErrorClass().isInfrastructure())
txWarning(errors, s.getTxLink(), IssueType.CODEINVALID, element.line(), element.col(), path, s == null, s.getMessage());
else if (s.getSeverity() == IssueSeverity.INFORMATION)
txHint(errors, s.getTxLink(), IssueType.CODEINVALID, element.line(), element.col(), path, s == null, s.getMessage());