public POCDMT000040ClinicalDocument getDocument(String docType, String patientId) throws InvalidTypeException, InvalidIdentifierException, DocumentBuilderException { // check for valid document type if (docType == null) { throw new InvalidTypeException("Must specify a document type."); } if (!DocumentTypeDAO.getInstance().isValidDocumentType(docType)) { log.debug("Requested document type \"" + docType + "\" is not supported!"); throw new InvalidTypeException( "Requested document type \"" + docType + "\" is not supported."); } documentType = docType; // check for valid patient identifier parameter if (patientId == null || patientId.length() < 1) { log.debug("Patient identifier \"" + patientId + "\" is invalid!"); throw new InvalidIdentifierException("Identifier is invalid."); } log.debug("Requesting document of type=" + docType + " for patient=" + patientId); // get a document builder CDADocumentBuilder docBuilder = AssemblerFactory.cdaBuilder(docType); docBuilder.setPatientId(patientId); POCDMT000040ClinicalDocument clinDoc = docBuilder.build(); log.debug("NEW DOCUMENT=" + XMLUtil.toPrettyXML(clinDoc)); log.debug( "Request for document=\"" + docBuilder.getDocumentType().getDisplayName() + "\" for patient[" + patientId + "] completed!"); return clinDoc; }
public PropertyAssembler createPropertyAssembler(ComponentDef componentDef) { return AssemblerFactory.createManualOnlyPropertyAssembler(componentDef); }
public ConstructorAssembler createConstructorAssembler(ComponentDef componentDef) { return AssemblerFactory.createDefaultConstructorConstructorAssembler(componentDef); }