Add test for #739
This commit is contained in:
parent
87383ad802
commit
328080e87b
|
@ -336,6 +336,19 @@ public class FhirInstanceValidatorDstu3Test {
|
|||
assertTrue(output.isSuccessful());
|
||||
}
|
||||
|
||||
/**
|
||||
* See #739
|
||||
*/
|
||||
@Test
|
||||
public void testValidateMedicationIngredient() throws IOException {
|
||||
String input = IOUtils.toString(FhirInstanceValidatorDstu3Test.class.getResourceAsStream("/dstu3/bug739.json"), Charsets.UTF_8);
|
||||
|
||||
ValidationResult results = myVal.validateWithResult(input);
|
||||
List<SingleValidationMessage> outcome = logResultsAndReturnNonInformationalOnes(results);
|
||||
assertThat(outcome.toString(), containsString("Element 'Medication.ingredient.item[x]': minimum required = 1"));
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testValidateQuestionnaireResponse() throws IOException {
|
||||
String input = IOUtils.toString(FhirInstanceValidatorDstu3Test.class.getResourceAsStream("/qr_jon.xml"));
|
||||
|
|
|
@ -0,0 +1,45 @@
|
|||
{
|
||||
"resourceType": "Medication",
|
||||
"code": {
|
||||
"coding": [
|
||||
{
|
||||
"system": "urn:2.16.840.1.113883.6.88",
|
||||
"code": "1191",
|
||||
"display": "aspirin"
|
||||
}
|
||||
],
|
||||
"text": "ASPIRIN 325 MG TABLET"
|
||||
},
|
||||
"form": {
|
||||
"coding": [
|
||||
{
|
||||
"system": "http://upmc.com/enterprises/rakia/rakida/cerner/h1/medication/form/code",
|
||||
"code": "687545",
|
||||
"display": "Tab"
|
||||
}
|
||||
],
|
||||
"text": "Tab"
|
||||
},
|
||||
"ingredient": [
|
||||
{
|
||||
"item": {
|
||||
"reference": "medication/613168",
|
||||
"display": "aspirin"
|
||||
},
|
||||
"amount": {
|
||||
"numerator": {
|
||||
"value": "650",
|
||||
"unit": "mg",
|
||||
"system": "http://upmc.com/enterprises/rakia/rakida/cerner/h1/medication/strength/unit",
|
||||
"code": "MG"
|
||||
},
|
||||
"denominator": {
|
||||
"value": "2",
|
||||
"unit": "tab(s)",
|
||||
"system": "http://upmc.com/enterprises/rakia/rakida/cerner/h1/medication/volume/unit",
|
||||
"code": "TAB"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
Loading…
Reference in New Issue