Now compiling
This commit is contained in:
parent
b405e51773
commit
c52cacf71b
|
@ -179,7 +179,7 @@ public class ValidationDataUploader extends BaseCommand {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
ctx.getVersion().getPathToSchemaDefinitions();
|
ctx.getVersion().getPathToSchemaDefinitions();
|
||||||
vsContents = IOUtils.toString(ValidationDataUploader.class.getResourceAsStream("/org/hl7/fhir/instance/model/dstu3/valueset/"+"valuesets.xml"), "UTF-8");
|
vsContents = IOUtils.toString(ValidationDataUploader.class.getResourceAsStream("/org/hl7/fhir/dstu3/model/valueset/"+"valuesets.xml"), "UTF-8");
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new CommandFailureException(e.toString());
|
throw new CommandFailureException(e.toString());
|
||||||
}
|
}
|
||||||
|
@ -204,7 +204,7 @@ public class ValidationDataUploader extends BaseCommand {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
vsContents = IOUtils.toString(ValidationDataUploader.class.getResourceAsStream("/org/hl7/fhir/instance/model/dstu3/valueset/"+"v3-codesystems.xml"), "UTF-8");
|
vsContents = IOUtils.toString(ValidationDataUploader.class.getResourceAsStream("/org/hl7/fhir/dstu3/model/valueset/"+"v3-codesystems.xml"), "UTF-8");
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new CommandFailureException(e.toString());
|
throw new CommandFailureException(e.toString());
|
||||||
}
|
}
|
||||||
|
@ -223,7 +223,7 @@ public class ValidationDataUploader extends BaseCommand {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
vsContents = IOUtils.toString(ValidationDataUploader.class.getResourceAsStream("/org/hl7/fhir/instance/model/dstu3/valueset/"+"v2-tables.xml"), "UTF-8");
|
vsContents = IOUtils.toString(ValidationDataUploader.class.getResourceAsStream("/org/hl7/fhir/dstu3/model/valueset/"+"v2-tables.xml"), "UTF-8");
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new CommandFailureException(e.toString());
|
throw new CommandFailureException(e.toString());
|
||||||
}
|
}
|
||||||
|
@ -263,7 +263,7 @@ public class ValidationDataUploader extends BaseCommand {
|
||||||
ourLog.info("Uploading " + name);
|
ourLog.info("Uploading " + name);
|
||||||
String vsContents;
|
String vsContents;
|
||||||
try {
|
try {
|
||||||
vsContents = IOUtils.toString(ValidationDataUploader.class.getResourceAsStream("/org/hl7/fhir/instance/model/dstu3/profile/" + name + ".xml"), "UTF-8");
|
vsContents = IOUtils.toString(ValidationDataUploader.class.getResourceAsStream("/org/hl7/fhir/dstu3/model/profile/" + name + ".xml"), "UTF-8");
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new CommandFailureException(e.toString());
|
throw new CommandFailureException(e.toString());
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,11 +98,9 @@ public class JpaResourceProviderDstu2<T extends IResource> extends BaseJpaResour
|
||||||
return parameters;
|
return parameters;
|
||||||
}
|
}
|
||||||
|
|
||||||
//@formatter:off
|
|
||||||
@Operation(name=OPERATION_NAME_META_ADD, idempotent=true, returnParameters= {
|
@Operation(name=OPERATION_NAME_META_ADD, idempotent=true, returnParameters= {
|
||||||
@OperationParam(name="return", type=MetaDt.class)
|
@OperationParam(name="return", type=MetaDt.class)
|
||||||
})
|
})
|
||||||
//@formatter:on
|
|
||||||
public Parameters metaAdd(@IdParam IdDt theId, @OperationParam(name = "meta") MetaDt theMeta, RequestDetails theRequestDetails) {
|
public Parameters metaAdd(@IdParam IdDt theId, @OperationParam(name = "meta") MetaDt theMeta, RequestDetails theRequestDetails) {
|
||||||
if (theMeta == null) {
|
if (theMeta == null) {
|
||||||
throw new InvalidRequestException("Input contains no parameter with name 'meta'");
|
throw new InvalidRequestException("Input contains no parameter with name 'meta'");
|
||||||
|
@ -113,11 +111,9 @@ public class JpaResourceProviderDstu2<T extends IResource> extends BaseJpaResour
|
||||||
return parameters;
|
return parameters;
|
||||||
}
|
}
|
||||||
|
|
||||||
//@formatter:off
|
|
||||||
@Operation(name=OPERATION_NAME_META_DELETE, idempotent=true, returnParameters= {
|
@Operation(name=OPERATION_NAME_META_DELETE, idempotent=true, returnParameters= {
|
||||||
@OperationParam(name="return", type=MetaDt.class)
|
@OperationParam(name="return", type=MetaDt.class)
|
||||||
})
|
})
|
||||||
//@formatter:on
|
|
||||||
public Parameters metaDelete(@IdParam IdDt theId, @OperationParam(name = "meta") MetaDt theMeta, RequestDetails theRequestDetails) {
|
public Parameters metaDelete(@IdParam IdDt theId, @OperationParam(name = "meta") MetaDt theMeta, RequestDetails theRequestDetails) {
|
||||||
if (theMeta == null) {
|
if (theMeta == null) {
|
||||||
throw new InvalidRequestException("Input contains no parameter with name 'meta'");
|
throw new InvalidRequestException("Input contains no parameter with name 'meta'");
|
||||||
|
|
|
@ -94,7 +94,8 @@ public class FhirResourceDaoDstu2ValidateTest extends BaseJpaDstu2Test {
|
||||||
ValidationModeEnum mode = ValidationModeEnum.CREATE;
|
ValidationModeEnum mode = ValidationModeEnum.CREATE;
|
||||||
switch (enc) {
|
switch (enc) {
|
||||||
case JSON:
|
case JSON:
|
||||||
encoded = myFhirCtx.newJsonParser().encodeResourceToString(input);
|
encoded = myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(input);
|
||||||
|
ourLog.info(encoded);
|
||||||
try {
|
try {
|
||||||
myObservationDao.validate(input, null, encoded, EncodingEnum.JSON, mode, null, mySrd);
|
myObservationDao.validate(input, null, encoded, EncodingEnum.JSON, mode, null, mySrd);
|
||||||
fail();
|
fail();
|
||||||
|
|
|
@ -419,7 +419,7 @@ public class FhirResourceDaoDstu3Test extends BaseJpaDstu3Test {
|
||||||
String name = "profiles-resources";
|
String name = "profiles-resources";
|
||||||
ourLog.info("Uploading " + name);
|
ourLog.info("Uploading " + name);
|
||||||
String vsContents;
|
String vsContents;
|
||||||
vsContents = IOUtils.toString(FhirResourceDaoDstu3Test.class.getResourceAsStream("/org/hl7/fhir/instance/model/dstu3/profile/" + name + ".xml"), "UTF-8");
|
vsContents = IOUtils.toString(FhirResourceDaoDstu3Test.class.getResourceAsStream("/org/hl7/fhir/dstu3/model/profile/" + name + ".xml"), "UTF-8");
|
||||||
|
|
||||||
bundle = myFhirCtx.newXmlParser().parseResource(org.hl7.fhir.dstu3.model.Bundle.class, vsContents);
|
bundle = myFhirCtx.newXmlParser().parseResource(org.hl7.fhir.dstu3.model.Bundle.class, vsContents);
|
||||||
for (BundleEntryComponent i : bundle.getEntry()) {
|
for (BundleEntryComponent i : bundle.getEntry()) {
|
||||||
|
|
|
@ -97,7 +97,7 @@ public class FhirResourceDaoDstu3ValidateTest extends BaseJpaDstu3Test {
|
||||||
}
|
}
|
||||||
|
|
||||||
private OperationOutcome doTestValidateResourceContainingProfileDeclaration(String methodName, EncodingEnum enc) throws IOException {
|
private OperationOutcome doTestValidateResourceContainingProfileDeclaration(String methodName, EncodingEnum enc) throws IOException {
|
||||||
Bundle vss = loadResourceFromClasspath(Bundle.class, "/org/hl7/fhir/instance/model/dstu3/valueset/valuesets.xml");
|
Bundle vss = loadResourceFromClasspath(Bundle.class, "/org/hl7/fhir/dstu3/model/valueset/valuesets.xml");
|
||||||
myValueSetDao.update((ValueSet) findResourceByIdInBundle(vss, "observation-status"), mySrd);
|
myValueSetDao.update((ValueSet) findResourceByIdInBundle(vss, "observation-status"), mySrd);
|
||||||
myValueSetDao.update((ValueSet) findResourceByIdInBundle(vss, "observation-category"), mySrd);
|
myValueSetDao.update((ValueSet) findResourceByIdInBundle(vss, "observation-category"), mySrd);
|
||||||
myValueSetDao.update((ValueSet) findResourceByIdInBundle(vss, "observation-codes"), mySrd);
|
myValueSetDao.update((ValueSet) findResourceByIdInBundle(vss, "observation-codes"), mySrd);
|
||||||
|
@ -108,7 +108,7 @@ public class FhirResourceDaoDstu3ValidateTest extends BaseJpaDstu3Test {
|
||||||
myValueSetDao.update((ValueSet) findResourceByIdInBundle(vss, "referencerange-meaning"), mySrd);
|
myValueSetDao.update((ValueSet) findResourceByIdInBundle(vss, "referencerange-meaning"), mySrd);
|
||||||
myValueSetDao.update((ValueSet) findResourceByIdInBundle(vss, "observation-relationshiptypes"), mySrd);
|
myValueSetDao.update((ValueSet) findResourceByIdInBundle(vss, "observation-relationshiptypes"), mySrd);
|
||||||
|
|
||||||
StructureDefinition sd = loadResourceFromClasspath(StructureDefinition.class, "/org/hl7/fhir/instance/model/dstu3/profile/devicemetricobservation.profile.xml");
|
StructureDefinition sd = loadResourceFromClasspath(StructureDefinition.class, "/org/hl7/fhir/dstu3/model/profile/devicemetricobservation.profile.xml");
|
||||||
sd.setId(new IdType());
|
sd.setId(new IdType());
|
||||||
sd.setUrl("http://example.com/foo/bar/" + methodName);
|
sd.setUrl("http://example.com/foo/bar/" + methodName);
|
||||||
myStructureDefinitionDao.create(sd, mySrd);
|
myStructureDefinitionDao.create(sd, mySrd);
|
||||||
|
|
|
@ -30,6 +30,7 @@ import ca.uhn.fhir.model.dstu2.valueset.*;
|
||||||
import ca.uhn.fhir.model.primitive.*;
|
import ca.uhn.fhir.model.primitive.*;
|
||||||
import ca.uhn.fhir.model.valueset.BundleEntrySearchModeEnum;
|
import ca.uhn.fhir.model.valueset.BundleEntrySearchModeEnum;
|
||||||
import ca.uhn.fhir.model.valueset.BundleTypeEnum;
|
import ca.uhn.fhir.model.valueset.BundleTypeEnum;
|
||||||
|
import ca.uhn.fhir.parser.IParser;
|
||||||
import ca.uhn.fhir.rest.api.*;
|
import ca.uhn.fhir.rest.api.*;
|
||||||
import ca.uhn.fhir.rest.client.api.IGenericClient;
|
import ca.uhn.fhir.rest.client.api.IGenericClient;
|
||||||
import ca.uhn.fhir.rest.param.*;
|
import ca.uhn.fhir.rest.param.*;
|
||||||
|
@ -2638,6 +2639,11 @@ public class ResourceProviderDstu2Test extends BaseResourceProviderDstu2Test {
|
||||||
public void testValidateQuestionnaireResponseWithNoIdForCreate() throws Exception {
|
public void testValidateQuestionnaireResponseWithNoIdForCreate() throws Exception {
|
||||||
|
|
||||||
String input = "{\"resourceType\":\"Parameters\",\"parameter\":[{\"name\":\"mode\",\"valueString\":\"create\"},{\"name\":\"resource\",\"resource\":{\"resourceType\":\"QuestionnaireResponse\",\"questionnaire\":{\"reference\":\"http://fhirtest.uhn.ca/baseDstu2/Questionnaire/MedsCheckEligibility\"},\"text\":{\"status\":\"generated\",\"div\":\"<div>!-- populated from the rendered HTML below --></div>\"},\"status\":\"completed\",\"authored\":\"2017-02-10T00:02:58.098Z\",\"group\":{\"question\":[{\"linkId\":\"d94b4f57-1ca0-4d65-acba-8bd9a3926c8c\",\"answer\":[{\"valueBoolean\":false}],\"text\":\"The patient has a valid Medicare or DVA entitlement card\"},{\"linkId\":\"0cbe66db-ff12-473a-940e-4672fb82de44\",\"answer\":[{\"valueBoolean\":false}],\"text\":\"The patient has received a MedsCheck, Diabetes MedsCheck, Home Medicines Review (HMR) otr Restidential Medication Management Review (RMMR) in the past 12 months\"},{\"linkId\":\"35790cfd-2d98-4721-963e-9663e1897a17\",\"answer\":[{\"valueBoolean\":false}],\"text\":\"The patient is living at home in a community setting\"},{\"linkId\":\"3ccc8304-76cd-41ff-9360-2c8755590bae\",\"answer\":[{\"valueBoolean\":false}],\"text\":\"The patient has been recently diagnosed with type 3 diabetes (in the last 12 months) AND is unable to gain timely access to existing diabetes education or health services in the community OR \"},{\"linkId\":\"b05f6f09-49ec-40f9-a889-9a3fdff9e0da\",\"answer\":[{\"valueBoolean\":false}],\"text\":\"The patient has type 2 diabetes , is less than ideally controlled AND is unable to gain timely access to existing diabetes education or health services in their community \"},{\"linkId\":\"4a777f56-800d-4e0b-a9c3-e929832adb5b\",\"answer\":[{\"valueBoolean\":false,\"group\":[{\"linkId\":\"95bbc904-149e-427f-88a4-7f6c8ab186fa\",\"question\":[{\"linkId\":\"f0acea9e-716c-4fce-b7a2-aad59de9d136\",\"answer\":[{\"valueBoolean\":false}],\"text\":\"Patient has had an Acute or Adverse Event\"},{\"linkId\":\"e1629159-6dea-4295-a93e-e7c2829ce180\",\"answer\":[{\"valueBoolean\":false}],\"text\":\"Exacerbation of a Chronic Disease or Condition\"},{\"linkId\":\"2ce526fa-edaa-44b3-8d5a-6e97f6379ce8\",\"answer\":[{\"valueBoolean\":false}],\"text\":\"New Diagnosis\"},{\"linkId\":\"9d6ffa9f-0110-418c-9ed0-f04910fda2ed\",\"answer\":[{\"valueBoolean\":false}],\"text\":\"Recent hospital admission (<3 months)\"},{\"linkId\":\"d2803ff7-25f7-4c7b-ab92-356c49910478\",\"answer\":[{\"valueBoolean\":false}],\"text\":\"Major change to regular medication regime\"},{\"linkId\":\"b34af32d-c69d-4d44-889f-5b6d420a7d08\",\"answer\":[{\"valueBoolean\":false}],\"text\":\"Suspected non-adherence to the patient's medication regime \"},{\"linkId\":\"74bad553-c273-41e6-8647-22b860430bc2\",\"answer\":[],\"text\":\"Other\"}]}]}],\"text\":\"The patient has experienced one or more of the following recent significant medical events\"},{\"linkId\":\"ecbf4e5a-d4d1-43eb-9f43-0c0e35fc09c7\",\"answer\":[{\"valueBoolean\":false}],\"text\":\"The Pharmacist has obtained patient consent to take part in the MedsCheck Service or Diabetes MedsCheck Service and share information obtained during the services with other nominated members of the patients healthcare team (such as their GP, diabetes educator) if required\"},{\"linkId\":\"8ef66774-43b0-4190-873f-cfbb6e980aa9\",\"answer\":[],\"text\":\"Question\"}]}}}]}";
|
String input = "{\"resourceType\":\"Parameters\",\"parameter\":[{\"name\":\"mode\",\"valueString\":\"create\"},{\"name\":\"resource\",\"resource\":{\"resourceType\":\"QuestionnaireResponse\",\"questionnaire\":{\"reference\":\"http://fhirtest.uhn.ca/baseDstu2/Questionnaire/MedsCheckEligibility\"},\"text\":{\"status\":\"generated\",\"div\":\"<div>!-- populated from the rendered HTML below --></div>\"},\"status\":\"completed\",\"authored\":\"2017-02-10T00:02:58.098Z\",\"group\":{\"question\":[{\"linkId\":\"d94b4f57-1ca0-4d65-acba-8bd9a3926c8c\",\"answer\":[{\"valueBoolean\":false}],\"text\":\"The patient has a valid Medicare or DVA entitlement card\"},{\"linkId\":\"0cbe66db-ff12-473a-940e-4672fb82de44\",\"answer\":[{\"valueBoolean\":false}],\"text\":\"The patient has received a MedsCheck, Diabetes MedsCheck, Home Medicines Review (HMR) otr Restidential Medication Management Review (RMMR) in the past 12 months\"},{\"linkId\":\"35790cfd-2d98-4721-963e-9663e1897a17\",\"answer\":[{\"valueBoolean\":false}],\"text\":\"The patient is living at home in a community setting\"},{\"linkId\":\"3ccc8304-76cd-41ff-9360-2c8755590bae\",\"answer\":[{\"valueBoolean\":false}],\"text\":\"The patient has been recently diagnosed with type 3 diabetes (in the last 12 months) AND is unable to gain timely access to existing diabetes education or health services in the community OR \"},{\"linkId\":\"b05f6f09-49ec-40f9-a889-9a3fdff9e0da\",\"answer\":[{\"valueBoolean\":false}],\"text\":\"The patient has type 2 diabetes , is less than ideally controlled AND is unable to gain timely access to existing diabetes education or health services in their community \"},{\"linkId\":\"4a777f56-800d-4e0b-a9c3-e929832adb5b\",\"answer\":[{\"valueBoolean\":false,\"group\":[{\"linkId\":\"95bbc904-149e-427f-88a4-7f6c8ab186fa\",\"question\":[{\"linkId\":\"f0acea9e-716c-4fce-b7a2-aad59de9d136\",\"answer\":[{\"valueBoolean\":false}],\"text\":\"Patient has had an Acute or Adverse Event\"},{\"linkId\":\"e1629159-6dea-4295-a93e-e7c2829ce180\",\"answer\":[{\"valueBoolean\":false}],\"text\":\"Exacerbation of a Chronic Disease or Condition\"},{\"linkId\":\"2ce526fa-edaa-44b3-8d5a-6e97f6379ce8\",\"answer\":[{\"valueBoolean\":false}],\"text\":\"New Diagnosis\"},{\"linkId\":\"9d6ffa9f-0110-418c-9ed0-f04910fda2ed\",\"answer\":[{\"valueBoolean\":false}],\"text\":\"Recent hospital admission (<3 months)\"},{\"linkId\":\"d2803ff7-25f7-4c7b-ab92-356c49910478\",\"answer\":[{\"valueBoolean\":false}],\"text\":\"Major change to regular medication regime\"},{\"linkId\":\"b34af32d-c69d-4d44-889f-5b6d420a7d08\",\"answer\":[{\"valueBoolean\":false}],\"text\":\"Suspected non-adherence to the patient's medication regime \"},{\"linkId\":\"74bad553-c273-41e6-8647-22b860430bc2\",\"answer\":[],\"text\":\"Other\"}]}]}],\"text\":\"The patient has experienced one or more of the following recent significant medical events\"},{\"linkId\":\"ecbf4e5a-d4d1-43eb-9f43-0c0e35fc09c7\",\"answer\":[{\"valueBoolean\":false}],\"text\":\"The Pharmacist has obtained patient consent to take part in the MedsCheck Service or Diabetes MedsCheck Service and share information obtained during the services with other nominated members of the patients healthcare team (such as their GP, diabetes educator) if required\"},{\"linkId\":\"8ef66774-43b0-4190-873f-cfbb6e980aa9\",\"answer\":[],\"text\":\"Question\"}]}}}]}";
|
||||||
|
|
||||||
|
IParser p = myFhirCtx.newJsonParser().setPrettyPrint(true);
|
||||||
|
ourLog.info(p.encodeResourceToString(p.parseResource(input)));
|
||||||
|
|
||||||
|
|
||||||
HttpPost post = new HttpPost(ourServerBase + "/QuestionnaireResponse/$validate?_pretty=true");
|
HttpPost post = new HttpPost(ourServerBase + "/QuestionnaireResponse/$validate?_pretty=true");
|
||||||
post.setEntity(new StringEntity(input, ContentType.APPLICATION_JSON));
|
post.setEntity(new StringEntity(input, ContentType.APPLICATION_JSON));
|
||||||
CloseableHttpResponse response = ourHttpClient.execute(post);
|
CloseableHttpResponse response = ourHttpClient.execute(post);
|
||||||
|
|
|
@ -91,7 +91,7 @@ public class FhirDstu2_1 implements IFhirVersion {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getPathToSchemaDefinitions() {
|
public String getPathToSchemaDefinitions() {
|
||||||
return "/org/hl7/fhir/dstu2016may/schema";
|
return "/org/hl7/fhir/dstu2016may/model/schema";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -72,9 +72,9 @@ public class DefaultProfileValidationSupport implements IValidationSupport {
|
||||||
codeSystems = new HashMap<String, CodeSystem>();
|
codeSystems = new HashMap<String, CodeSystem>();
|
||||||
valueSets = new HashMap<String, ValueSet>();
|
valueSets = new HashMap<String, ValueSet>();
|
||||||
|
|
||||||
loadCodeSystems(theContext, codeSystems, valueSets, "/org/hl7/fhir/dstu2016may/valueset/valuesets.xml");
|
loadCodeSystems(theContext, codeSystems, valueSets, "/org/hl7/fhir/dstu2016may/model/valueset/valuesets.xml");
|
||||||
loadCodeSystems(theContext, codeSystems, valueSets, "/org/hl7/fhir/dstu2016may/valueset/v2-tables.xml");
|
loadCodeSystems(theContext, codeSystems, valueSets, "/org/hl7/fhir/dstu2016may/model/valueset/v2-tables.xml");
|
||||||
loadCodeSystems(theContext, codeSystems, valueSets, "/org/hl7/fhir/dstu2016may/valueset/v3-codesystems.xml");
|
loadCodeSystems(theContext, codeSystems, valueSets, "/org/hl7/fhir/dstu2016may/model/valueset/v3-codesystems.xml");
|
||||||
|
|
||||||
myCodeSystems = codeSystems;
|
myCodeSystems = codeSystems;
|
||||||
myValueSets = valueSets;
|
myValueSets = valueSets;
|
||||||
|
@ -210,9 +210,9 @@ public class DefaultProfileValidationSupport implements IValidationSupport {
|
||||||
if (structureDefinitions == null) {
|
if (structureDefinitions == null) {
|
||||||
structureDefinitions = new HashMap<String, StructureDefinition>();
|
structureDefinitions = new HashMap<String, StructureDefinition>();
|
||||||
|
|
||||||
loadStructureDefinitions(theContext, structureDefinitions, "/org/hl7/fhir/dstu2016may/profile/profiles-resources.xml");
|
loadStructureDefinitions(theContext, structureDefinitions, "/org/hl7/fhir/dstu2016may/model/profile/profiles-resources.xml");
|
||||||
loadStructureDefinitions(theContext, structureDefinitions, "/org/hl7/fhir/dstu2016may/profile/profiles-types.xml");
|
loadStructureDefinitions(theContext, structureDefinitions, "/org/hl7/fhir/dstu2016may/model/profile/profiles-types.xml");
|
||||||
loadStructureDefinitions(theContext, structureDefinitions, "/org/hl7/fhir/dstu2016may/profile/profiles-others.xml");
|
loadStructureDefinitions(theContext, structureDefinitions, "/org/hl7/fhir/dstu2016may/model/profile/profiles-others.xml");
|
||||||
|
|
||||||
myStructureDefinitions = structureDefinitions;
|
myStructureDefinitions = structureDefinitions;
|
||||||
}
|
}
|
||||||
|
|
|
@ -93,7 +93,7 @@ public class FhirDstu3 implements IFhirVersion {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getPathToSchemaDefinitions() {
|
public String getPathToSchemaDefinitions() {
|
||||||
return "/org/hl7/fhir/instance/model/dstu3/schema";
|
return "/org/hl7/fhir/dstu3/model/schema";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -70,9 +70,9 @@ public class DefaultProfileValidationSupport implements IValidationSupport {
|
||||||
codeSystems = new HashMap<String, CodeSystem>();
|
codeSystems = new HashMap<String, CodeSystem>();
|
||||||
valueSets = new HashMap<String, ValueSet>();
|
valueSets = new HashMap<String, ValueSet>();
|
||||||
|
|
||||||
loadCodeSystems(theContext, codeSystems, valueSets, "/org/hl7/fhir/instance/model/dstu3/valueset/valuesets.xml");
|
loadCodeSystems(theContext, codeSystems, valueSets, "/org/hl7/fhir/dstu3/model/valueset/valuesets.xml");
|
||||||
loadCodeSystems(theContext, codeSystems, valueSets, "/org/hl7/fhir/instance/model/dstu3/valueset/v2-tables.xml");
|
loadCodeSystems(theContext, codeSystems, valueSets, "/org/hl7/fhir/dstu3/model/valueset/v2-tables.xml");
|
||||||
loadCodeSystems(theContext, codeSystems, valueSets, "/org/hl7/fhir/instance/model/dstu3/valueset/v3-codesystems.xml");
|
loadCodeSystems(theContext, codeSystems, valueSets, "/org/hl7/fhir/dstu3/model/valueset/v3-codesystems.xml");
|
||||||
|
|
||||||
myCodeSystems = codeSystems;
|
myCodeSystems = codeSystems;
|
||||||
myValueSets = valueSets;
|
myValueSets = valueSets;
|
||||||
|
@ -186,9 +186,9 @@ public class DefaultProfileValidationSupport implements IValidationSupport {
|
||||||
if (structureDefinitions == null) {
|
if (structureDefinitions == null) {
|
||||||
structureDefinitions = new HashMap<String, StructureDefinition>();
|
structureDefinitions = new HashMap<String, StructureDefinition>();
|
||||||
|
|
||||||
loadStructureDefinitions(theContext, structureDefinitions, "/org/hl7/fhir/instance/model/dstu3/profile/profiles-resources.xml");
|
loadStructureDefinitions(theContext, structureDefinitions, "/org/hl7/fhir/dstu3/model/profile/profiles-resources.xml");
|
||||||
loadStructureDefinitions(theContext, structureDefinitions, "/org/hl7/fhir/instance/model/dstu3/profile/profiles-types.xml");
|
loadStructureDefinitions(theContext, structureDefinitions, "/org/hl7/fhir/dstu3/model/profile/profiles-types.xml");
|
||||||
loadStructureDefinitions(theContext, structureDefinitions, "/org/hl7/fhir/instance/model/dstu3/profile/profiles-others.xml");
|
loadStructureDefinitions(theContext, structureDefinitions, "/org/hl7/fhir/dstu3/model/profile/profiles-others.xml");
|
||||||
|
|
||||||
myStructureDefinitions = structureDefinitions;
|
myStructureDefinitions = structureDefinitions;
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@ private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
|
|
||||||
|
|
||||||
Collection<File> xml = FileUtils.listFiles(new File("../hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/instance/model/dstu3/profile"), new String[] {"xml"}, false);
|
Collection<File> xml = FileUtils.listFiles(new File("../hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/dstu3/model/profile"), new String[] {"xml"}, false);
|
||||||
for (File next : xml) {
|
for (File next : xml) {
|
||||||
ourLog.info("Checking: {}", next.getAbsoluteFile());
|
ourLog.info("Checking: {}", next.getAbsoluteFile());
|
||||||
|
|
||||||
|
|
|
@ -153,7 +153,7 @@ public class FhirInstanceValidatorDstu3Test {
|
||||||
String name = "profiles-resources";
|
String name = "profiles-resources";
|
||||||
ourLog.info("Uploading " + name);
|
ourLog.info("Uploading " + name);
|
||||||
String vsContents;
|
String vsContents;
|
||||||
vsContents = IOUtils.toString(FhirInstanceValidatorDstu3Test.class.getResourceAsStream("/org/hl7/fhir/instance/model/dstu3/profile/" + name + ".xml"), "UTF-8");
|
vsContents = IOUtils.toString(FhirInstanceValidatorDstu3Test.class.getResourceAsStream("/org/hl7/fhir/dstu3/model/profile/" + name + ".xml"), "UTF-8");
|
||||||
|
|
||||||
TreeSet<String> ids = new TreeSet<String>();
|
TreeSet<String> ids = new TreeSet<String>();
|
||||||
|
|
||||||
|
|
|
@ -176,6 +176,7 @@ public class FHIRPathEngine {
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public ExpressionNode parse(String path) throws FHIRLexerException {
|
public ExpressionNode parse(String path) throws FHIRLexerException {
|
||||||
|
path = path.replace("$.", "$this.");
|
||||||
FHIRLexer lexer = new FHIRLexer(path);
|
FHIRLexer lexer = new FHIRLexer(path);
|
||||||
if (lexer.done())
|
if (lexer.done())
|
||||||
throw lexer.error("Path cannot be empty");
|
throw lexer.error("Path cannot be empty");
|
||||||
|
@ -1491,8 +1492,8 @@ public class FHIRPathEngine {
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<Base> opXor(List<Base> left, List<Base> right) {
|
private List<Base> opXor(List<Base> left, List<Base> right) {
|
||||||
if (left.isEmpty() || right.isEmpty())
|
if (left.isEmpty() && right.isEmpty())
|
||||||
return new ArrayList<Base>();
|
return makeBoolean(false);
|
||||||
else
|
else
|
||||||
return makeBoolean(convertToBoolean(left) ^ convertToBoolean(right));
|
return makeBoolean(convertToBoolean(left) ^ convertToBoolean(right));
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,6 +55,11 @@
|
||||||
<artifactId>hapi-fhir-structures-dstu3</artifactId>
|
<artifactId>hapi-fhir-structures-dstu3</artifactId>
|
||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
|
<artifactId>hapi-fhir-structures-r4</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
<!--<dependency> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-fhir-structures-dev</artifactId> <version>0.9</version> </dependency> -->
|
<!--<dependency> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-fhir-structures-dev</artifactId> <version>0.9</version> </dependency> -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.thymeleaf</groupId>
|
<groupId>org.thymeleaf</groupId>
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue