Work on tests
This commit is contained in:
parent
2fd1357363
commit
22ff1db183
|
@ -34,7 +34,6 @@ import java.lang.reflect.Proxy;
|
|||
import java.lang.reflect.Type;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
|
@ -48,7 +47,6 @@ import java.util.Set;
|
|||
import java.util.TreeMap;
|
||||
import java.util.TreeSet;
|
||||
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.hl7.fhir.instance.model.api.IAnyResource;
|
||||
import org.hl7.fhir.instance.model.api.IBase;
|
||||
import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
|
||||
|
@ -84,7 +82,6 @@ import ca.uhn.fhir.model.base.composite.BaseContainedDt;
|
|||
import ca.uhn.fhir.model.base.composite.BaseNarrativeDt;
|
||||
import ca.uhn.fhir.model.base.composite.BaseResourceReferenceDt;
|
||||
import ca.uhn.fhir.model.primitive.BoundCodeDt;
|
||||
import ca.uhn.fhir.model.primitive.CodeDt;
|
||||
import ca.uhn.fhir.model.primitive.ICodedDatatype;
|
||||
import ca.uhn.fhir.model.primitive.XhtmlDt;
|
||||
import ca.uhn.fhir.rest.method.RestSearchParameterTypeEnum;
|
||||
|
@ -195,15 +192,6 @@ class ModelScanner {
|
|||
Map<String, Class<? extends IBaseResource>> resourceTypes = myNameToResourceType;
|
||||
|
||||
myVersionTypes = scanVersionPropertyFile(theDatatypes, resourceTypes, myVersion);
|
||||
|
||||
// FIXME: remove
|
||||
if (myVersionTypes.contains(CodeDt.class) == false) {
|
||||
try {
|
||||
throw new ConfigurationException("Did not request CodeDt1: " + myVersionTypes + "\ndatatypes: " + theDatatypes + "\n\n" + IOUtils.toString(myVersion.getVersionImplementation().getFhirVersionPropertiesFile()));
|
||||
} catch (IOException e) {
|
||||
throw new ConfigurationException("FAILED: " + e.toString());
|
||||
}
|
||||
}
|
||||
|
||||
// toScan.add(DateDt.class);
|
||||
// toScan.add(CodeDt.class);
|
||||
|
|
|
@ -155,18 +155,8 @@ public class RuntimeChildUndeclaredExtensionDefinition extends BaseRuntimeChildD
|
|||
myDatatypeToAttributeName = new HashMap<Class<? extends IBase>, String>();
|
||||
myDatatypeToDefinition = new HashMap<Class<? extends IBase>, BaseRuntimeElementDefinition<?>>();
|
||||
|
||||
// FIXME: remove
|
||||
if (theClassToElementDefinitions.containsKey(CodeDt.class) == false) {
|
||||
throw new ConfigurationException("Did not request CodeDt2: " + (theClassToElementDefinitions.keySet()));
|
||||
}
|
||||
|
||||
// for (theContext.get)
|
||||
|
||||
for (BaseRuntimeElementDefinition<?> next : theClassToElementDefinitions.values()) {
|
||||
if (next instanceof IRuntimeDatatypeDefinition) {
|
||||
// if (next.getName().equals("CodeableConcept")) {
|
||||
// System.out.println();
|
||||
// }
|
||||
|
||||
myDatatypeToDefinition.put(next.getImplementingClass(), next);
|
||||
|
||||
|
@ -205,12 +195,6 @@ public class RuntimeChildUndeclaredExtensionDefinition extends BaseRuntimeChildD
|
|||
myAttributeNameToDefinition = datatypeAttributeNameToDefinition;
|
||||
|
||||
|
||||
// for (Entry<String, BaseRuntimeElementDefinition<?>> next : myAttributeNameToDefinition.entrySet()) {
|
||||
// @SuppressWarnings("unchecked")
|
||||
// Class<? extends IDatatype> type = (Class<? extends IDatatype>) next.getValue().getImplementingClass();
|
||||
// myDatatypeToDefinition.put(type, next.getValue());
|
||||
// }
|
||||
|
||||
/*
|
||||
* Resource reference - The correct name is 'valueReference' in DSTU2 and 'valueResource' in DSTU1
|
||||
*/
|
||||
|
|
|
@ -67,6 +67,9 @@ patient.title=classpath:ca/uhn/fhir/narrative/title/Patient.html
|
|||
medicationprescription.class=ca.uhn.fhir.model.dstu.resource.MedicationPrescription
|
||||
medicationprescription.narrative=classpath:ca/uhn/fhir/narrative/MedicationPrescription.html
|
||||
medicationprescription.title=classpath:ca/uhn/fhir/narrative/title/MedicationPrescription.html
|
||||
medicationorder.class=ca.uhn.fhir.model.dstu2.resource.MedicationOrder
|
||||
medicationorder.narrative=classpath:ca/uhn/fhir/narrative/MedicationPrescription.html
|
||||
medicationorder.title=classpath:ca/uhn/fhir/narrative/title/MedicationPrescription.html
|
||||
|
||||
medication.class=ca.uhn.fhir.model.dstu.resource.Medication
|
||||
medication.narrative=classpath:ca/uhn/fhir/narrative/Medication.html
|
||||
|
|
|
@ -564,7 +564,7 @@ public class XmlParserDstu2Test {
|
|||
}
|
||||
|
||||
/**
|
||||
* Test for #233
|
||||
* Test for #233 - This was reversed after a conversation with Grahame
|
||||
*/
|
||||
@Test
|
||||
public void testEncodeAndParseProfiledDatatype() {
|
||||
|
@ -572,7 +572,7 @@ public class XmlParserDstu2Test {
|
|||
mo.addDosageInstruction().getTiming().getRepeat().setBounds(new DurationDt().setCode("code"));
|
||||
String out = ourCtx.newXmlParser().encodeResourceToString(mo);
|
||||
ourLog.info(out);
|
||||
assertThat(out, containsString("</boundsQuantity>"));
|
||||
assertThat(out, containsString("</boundsDuration>"));
|
||||
|
||||
mo = ourCtx.newXmlParser().parseResource(MedicationOrder.class, out);
|
||||
DurationDt duration = (DurationDt) mo.getDosageInstruction().get(0).getTiming().getRepeat().getBounds();
|
||||
|
@ -592,7 +592,7 @@ public class XmlParserDstu2Test {
|
|||
assertEquals("1", q.getValueElement().getValueAsString());
|
||||
|
||||
String output = xmlParser.encodeResourceToString(ms);
|
||||
assertThat(output, containsString("<quantityQuantity><value value=\"1\"/></quantityQuantity>"));
|
||||
assertThat(output, containsString("<quantitySimpleQuantity><value value=\"1\"/></quantitySimpleQuantity>"));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Reference in New Issue