/** * Creates and persists a FICR Coverage Extension Request Pharmacy message * * @throws IOException */ public void testCreate() throws IOException { DataGraph dataGraph = PlasmaDataFactory.INSTANCE.createDataGraph(); dataGraph.getChangeSummary().beginLogging(); // log changes from this point Type rootType = PlasmaTypeHelper.INSTANCE.getType(PaymentRequest.class); PaymentRequest paymentRequest = (PaymentRequest) dataGraph.createRootObject(rootType); paymentRequest.setAmt(this.amount); paymentRequest.setClassCode("XACT"); paymentRequest.setId(new String[] {String.valueOf(rand.nextLong())}); paymentRequest.setMoodCode("PRP"); PaymentRequestAttention performer = paymentRequest.createPrimaryPerformer(); performer.setTypeCode("PPRF"); ContactParty contactParty = performer.createContactParty(); contactParty.setClassCode("CON"); contactParty.setCode("PAYOR"); contactParty.setId(String.valueOf(System.currentTimeMillis())); ContactPerson contactPerson = contactParty.createContactPerson(); contactPerson.setName("Albert Dunhurst"); contactPerson.setClassCode("PSN"); contactPerson.setDeterminerCode("INSTANCE"); contactPerson.setTelecom("(540)364-2293"); PaymentRequestReason paymentReason = paymentRequest.createReasonOf(); paymentReason.setTypeCode("RSON"); InvoiceElementGroup invoiceElementGroup = paymentReason.createInvoiceElementGroup(); invoiceElementGroup.setClassCode("INME"); invoiceElementGroup.setMoodCode("PRP"); invoiceElementGroup.setConfidentialityCode("N"); invoiceElementGroup.setNetAmt(this.amount); InvoiceElementGroupAttachment groupAttachment = invoiceElementGroup.createPertinentInformation1(); groupAttachment.setTypeCode("PERT"); HealthDocumentAttachment attachment = groupAttachment.createHealthDocumentAttachment(); attachment.setClassCode("OBS"); attachment.setMoodCode("EVN"); attachment.setId(new String[] {String.valueOf(System.currentTimeMillis())}); // attachment.setCode(value) attachment.setValue("<Content>attachment content</<Content>"); // InvoiceElementReason invoiceReason = invoiceElementGroup.createReasonOf(); log.info(this.serializeGraph(paymentRequest.getDataGraph())); this.service.commit(paymentRequest.getDataGraph(), USERNAME); }