protected final void renderNextOfKinVoToNK1(NextOfKin nok, NK1 nk1,ProviderSystemVo providerSystem) throws Exception { LOG.debug("VoMapper renderNextOfKinVoToNK1: entry"); if (nok == null) return; renderNameVoToXPN(nok.getName(), nk1.getNKName(0),providerSystem); renderAddressVoToXAD(nok.getAddress(), nk1.getAddress(0),providerSystem); CommChannelVo voWork = nok.getCommunicationChannel(ChannelType.WORK_PHONE); if (voWork != null) nk1.getBusinessPhoneNumber(0).getAnyText().setValue(voWork.getCommValue()); CommChannelVo vo = nok.getCommunicationChannel(ChannelType.HOME_PHONE); if (vo != null) { nk1.getPhoneNumber(0).getAnyText().setValue(vo.getCommValue()); } else { // wdev-3087 Check if home phone is set at address level if (nok.getAddressIsNotNull() && nok.getAddress().getPhoneIsNotNull()) nk1.getPhoneNumber(0).getAnyText().setValue(nok.getAddress().getPhone()); } if (nok.getRelationshipIsNotNull()) nk1.getRelationship().getIdentifier().setValue(svc.getRemoteLookup(nok.getRelationship().getID(), providerSystem.getCodeSystem().getText())); LOG.debug("VoMapper renderNextOfKinVoToNK1: exit (" + nk1.toString() + ")"); }
protected void onFormOpen() throws FormOpenException { if (ConfigFlag.UI.DEMOGRAPHICS_TYPE.getValue().equals("UK")) { if(!ConfigFlag.DOM.HEARTS_REPLICATE_PATIENTS.getValue()) form.ccAddressSearch().setPhoneVisible(false); } if (form.getGlobalContext().Core.getNOKDetailsIsNotNull()) { NextOfKin nok = (NextOfKin) form.getGlobalContext().Core.getNOKDetails().clone(); populateScreenFromData( nok.getAddress()); if (nok.getName() != null) { form.cmbTitle().setValue(nok.getName().getTitle()); form.txtNOKSName().setValue(nok.getName().getSurname()); form.txtNOKMiddlename().setValue(nok.getName().getMiddleName()); form.txtNOKForename().setValue(nok.getName().getForename()); } if(nok.getCommChannelsIsNotNull()) { if(nok.getCommChannels().getCommunicationChannel(ChannelType.WORK_PHONE) != null) form.txtPhoneWork().setValue(nok.getCommChannels().getCommunicationChannel(ChannelType.WORK_PHONE).getCommValue()); //WDEV-8427 - interface uses commchannel but screen uses phone field in NOK if(ConfigFlag.DOM.HEARTS_REPLICATE_PATIENTS.getValue()) { if(nok.getCommChannels().getCommunicationChannel(ChannelType.HOME_PHONE) != null) { if(nok.getAddressIsNotNull()) nok.getAddress().setPhone(nok.getCommChannels().getCommunicationChannel(ChannelType.HOME_PHONE).getCommValue()); if(nok.getAddress() == null) { nok.setAddress(new PersonAddress()); nok.getAddress().setPhone(nok.getCommChannels().getCommunicationChannel(ChannelType.HOME_PHONE).getCommValue()); } form.ccAddressSearch().setValue(nok.getAddress()); } } } if (nok.getRelationship() == null) { if (form.getGlobalContext().Core.getNOKDetails().getTempFieldIsNotNull()) { PersonRelationship lkupPersonRelationship = new PersonRelationship(); form.cmbRelationship().newRow(lkupPersonRelationship, form.getGlobalContext().Core.getNOKDetails().getTempField()); form.cmbRelationship().setValue(lkupPersonRelationship); } } else if (nok.getRelationshipIsNotNull()) form.cmbRelationship().setValue(form.getGlobalContext().Core.getNOKDetails().getRelationship()); } // Unless using local patient registration, this form should go to view // mode only if ((!ims.configuration.gen.ConfigFlag.DOM.LOCAL_PATIENT_REGISTRATION.getValue()) || form.getGlobalContext().Core.getParentFormMode().equals(FormMode.VIEW)) { form.setMode(FormMode.VIEW); form.ccAddressSearch().setMode(FormMode.VIEW); form.ccAddressSearch().setComponentEnabled(false); } else { form.ccAddressSearch().setMode(FormMode.EDIT); form.ccAddressSearch().setComponentEnabled(true); } updateControlsState();//WDEV-17185 }
public NextOfKin populateNextOfKinVoFromNK1(NK1 nk1,ProviderSystemVo providerSystem) throws HL7Exception { return (populateNextOfKinVoFromNK1(new NextOfKin(), nk1,providerSystem)); }
protected final void renderNextOfKinVoToNK1(NextOfKin nok, NK1 nk1,ProviderSystemVo providerSystem, Boolean isConfidential) throws Exception //WDEV-20335 { LOG.debug("VoMapper renderNextOfKinVoToNK1: entry"); if (nok == null) return; renderNameVoToXPN(nok.getName(), nk1.getNKName(0),providerSystem); //WDEV-20335 if((isConfidential == null) || (!isConfidential)) { renderAddressVoToXAD(nok.getAddress(), nk1.getAddress(0), providerSystem); }//WDEV-20335 //WDEV-22006 // CommChannelVo voWork = nok.getCommunicationChannel(ChannelType.WORK_PHONE); // if (voWork != null) // nk1.getBusinessPhoneNumber(0).getAnyText().setValue(voWork.getCommValue()); // CommChannelVo vo = nok.getCommunicationChannel(ChannelType.HOME_PHONE); // if (vo != null) // { // nk1.getPhoneNumber(0).getAnyText().setValue(vo.getCommValue()); // } // else // { // // wdev-3087 Check if home phone is set at address level // // if (nok.getAddressIsNotNull() && nok.getAddress().getPhoneIsNotNull()) // nk1.getPhoneNumber(0).getAnyText().setValue(nok.getAddress().getPhone()); // } //WDEV-22006 if (nok.getCommChannels() != null) { renderCommChannelVoCollToNK1(nok.getCommChannels(), nk1, providerSystem); } else if (nok.getAddress() != null && nok.getAddress().getPhone() != null) { nk1.getBusinessPhoneNumber(0).getTelecommunicationUseCode().setValue("WPN"); nk1.getBusinessPhoneNumber(0).getTelecommunicationEquipmentType().setValue("PH"); nk1.getBusinessPhoneNumber(0).getAnyText().setValue(nok.getAddress().getPhone()); } //WDEV-22006 if (nok.getRelationshipIsNotNull()) { nk1.getRelationship().getIdentifier().setValue(svc.getRemoteLookup(nok.getRelationship().getID(), providerSystem.getCodeSystem().getText())); } //WDEV-20336 //NK1-7 Contact role (CE) if (nok.getRoleIsNotNull()) { nk1.getContactRole().getIdentifier().setValue(svc.getRemoteLookup(nok.getRole().getID(), providerSystem.getCodeSystem().getText())); } //NK1-16 Date/time of birth (TS) if (nok.getDobIsNotNull()) { nk1.getDateTimeOfBirth().getTimeOfAnEvent().setValue(nok.getDob().toString(DateFormat.ISO)); } //WDEV-20336 LOG.debug("VoMapper renderNextOfKinVoToNK1: exit (" + nk1.toString() + ")"); }