[prev in list] [next in list] [prev in thread] [next in thread]
List: openmrs-svn
Subject: [31005] openmrs-modules/chica/branches/PersonAddressError: chica person address error * update to s
From: svn-noreply () openmrs ! org
Date: 2014-11-20 15:58:01
Message-ID: 20141120155801.92E794030A () openmrs ! osuosl ! org
[Download RAW message or body]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[31005] openmrs-modules/chica/branches/PersonAddressError: chica person \
address error * update to set uuid for name, address, attributes</title> </head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: \
verdana,arial,helvetica,sans-serif; font-size: 10pt; } #msg dl a { font-weight: \
bold} #msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: \
bold; } #msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: \
6px; } #logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em \
0; } #logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg \
h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; } \
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; \
} #logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: \
-1.5em; padding-left: 1.5em; } #logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em \
1em 0 1em; background: white;} #logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid \
#fa0; border-bottom: 1px solid #fa0; background: #fff; } #logmsg table th { \
text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted \
#fa0; } #logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: \
0.2em 0.5em; } #logmsg table thead th { text-align: center; border-bottom: 1px solid \
#fa0; } #logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: \
6px; } #patch { width: 100%; }
#patch h4 {font-family: \
verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, \
#patch .copfile {border:1px solid #ccc;margin:10px 0;} #patch ins \
{background:#dfd;text-decoration:none;display:block;padding:0 10px;} #patch del \
{background:#fdd;text-decoration:none;display:block;padding:0 10px;} #patch .lines, \
.info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd>31005</dd>
<dt>Author</dt> <dd>msheley</dd>
<dt>Date</dt> <dd>2014-11-20 15:58:01 +0000 (Thu, 20 Nov 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>chica person address error * update to set uuid for name, address, \
attributes</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#openmrsmoduleschicabranchesPersonAddressErrorsrcorgopenmrsmodulechicahl7 \
mckessonHL7PatientHandler25java">openmrs-modules/chica/branches/PersonAddressError/src/org/openmrs/module/chica/hl7/mckesson/HL7PatientHandler25.java</a></li>
<li><a href="#openmrsmoduleschicabranchesPersonAddressErrorsrcorgopenmrsmodulechicahl \
7mckessonHL7SocketHandlerjava">openmrs-modules/chica/branches/PersonAddressError/src/org/openmrs/module/chica/hl7/mckesson/HL7SocketHandler.java</a></li>
<li><a href="#openmrsmoduleschicabranchesPersonAddressErrorwebsrcorgopenmrsmodulechic \
awebManualCheckinControllerjava">openmrs-modules/chica/branches/PersonAddressError/web/src/org/openmrs/module/chica/web/ManualCheckinController.java</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#openmrsmoduleschicabranchesPersonAddressErrorlibcommonsockethl7listener1 \
332jar">openmrs-modules/chica/branches/PersonAddressError/lib-common/sockethl7listener-1.3.32.jar</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="openmrsmoduleschicabranchesPersonAddressErrorlibcommonsockethl7listener1332jar"></a>
<div class="binary"><h4>Added: \
openmrs-modules/chica/branches/PersonAddressError/lib-common/sockethl7listener-1.3.32.jar</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Property changes on: \
openmrs-modules/chica/branches/PersonAddressError/lib-common/sockethl7listener-1.3.32.jar
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="openmrsmoduleschicabranchesPersonAddressErrorsrcorgopenmrsmodulechicahl7mckessonHL7PatientHandler25java"></a>
<div class="modfile"><h4>Modified: \
openmrs-modules/chica/branches/PersonAddressError/src/org/openmrs/module/chica/hl7/mckesson/HL7PatientHandler25.java \
(31004 => 31005)</h4> <pre class="diff"><span>
<span class="info">--- \
openmrs-modules/chica/branches/PersonAddressError/src/org/openmrs/module/chica/hl7/mckesson/HL7PatientHandler25.java 2014-11-19 \
20:22:27 UTC (rev 31004)
+++ openmrs-modules/chica/branches/PersonAddressError/src/org/openmrs/module/chica/hl7/mckesson/HL7PatientHandler25.java 2014-11-20 \
15:58:01 UTC (rev 31005) </span><span class="lines">@@ -5,9 +5,10 @@
</span><span class="cx">
</span><span class="cx"> import java.util.ArrayList;
</span><span class="cx"> import java.util.List;
</span><ins>+import java.util.UUID;
+
</ins><span class="cx"> import org.openmrs.PersonAddress;
</span><span class="cx"> import org.openmrs.module.chirdlutil.util.Util;
</span><del>-import org.openmrs.util.OpenmrsUtil;
</del><span class="cx">
</span><span class="cx"> import ca.uhn.hl7v2.HL7Exception;
</span><span class="cx"> import ca.uhn.hl7v2.model.Message;
</span><span class="lines">@@ -198,6 +199,8 @@
</span><span class="cx"> address.setStateProvince(stateProvince);
</span><span class="cx"> address.setCountry(country);
</span><span class="cx"> address.setPostalCode(postalCode);
</span><ins>+ UUID uuid = UUID.randomUUID();
+ address.setUuid(uuid.toString());
</ins><span class="cx"> address.setPreferred(true);
</span><span class="cx">
</span><span class="cx"> return address;
</span></span></pre></div>
<a id="openmrsmoduleschicabranchesPersonAddressErrorsrcorgopenmrsmodulechicahl7mckessonHL7SocketHandlerjava"></a>
<div class="modfile"><h4>Modified: \
openmrs-modules/chica/branches/PersonAddressError/src/org/openmrs/module/chica/hl7/mckesson/HL7SocketHandler.java \
(31004 => 31005)</h4> <pre class="diff"><span>
<span class="info">--- \
openmrs-modules/chica/branches/PersonAddressError/src/org/openmrs/module/chica/hl7/mckesson/HL7SocketHandler.java 2014-11-19 \
20:22:27 UTC (rev 31004)
+++ openmrs-modules/chica/branches/PersonAddressError/src/org/openmrs/module/chica/hl7/mckesson/HL7SocketHandler.java 2014-11-20 \
15:58:01 UTC (rev 31005) </span><span class="lines">@@ -38,6 +38,7 @@
</span><span class="cx"> import org.openmrs.api.ConceptService;
</span><span class="cx"> import org.openmrs.api.LocationService;
</span><span class="cx"> import org.openmrs.api.PatientService;
</span><ins>+import org.openmrs.api.PersonService;
</ins><span class="cx"> import org.openmrs.api.context.Context;
</span><span class="cx"> import org.openmrs.module.chica.QueryKite;
</span><span class="cx"> import org.openmrs.module.chica.QueryKiteException;
</span><span class="lines">@@ -58,20 +59,14 @@
</span><span class="cx"> import org.openmrs.module.sockethl7listener.PatientHandler;
</span><span class="cx"> import org.openmrs.module.sockethl7listener.Provider;
</span><span class="cx"> import org.openmrs.util.OpenmrsUtil;
</span><del>-import org.openmrs.module.chirdlutil.util.ChirdlUtilConstants;
</del><span class="cx">
</span><span class="cx"> import ca.uhn.hl7v2.HL7Exception;
</span><span class="cx"> import ca.uhn.hl7v2.app.ApplicationException;
</span><span class="cx"> import ca.uhn.hl7v2.model.Message;
</span><span class="cx"> import ca.uhn.hl7v2.model.Segment;
</span><del>-import ca.uhn.hl7v2.model.v25.datatype.CX;
-import ca.uhn.hl7v2.model.v25.message.ADT_A01;
-import ca.uhn.hl7v2.model.v25.segment.PID;
</del><span class="cx"> import ca.uhn.hl7v2.parser.EncodingNotSupportedException;
</span><span class="cx"> import ca.uhn.hl7v2.parser.PipeParser;
</span><span class="cx">
</span><del>-import org.apache.commons.lang.time.DateUtils;
-
</del><span class="cx"> /**
</span><span class="cx"> * @author tmdugan
</span><span class="cx"> *
</span><span class="lines">@@ -717,7 +712,7 @@
</span><span class="cx"> * @param encounterDate
</span><span class="cx"> * @should update date created if name already exists
</span><span class="cx"> */
</span><del>- void addName(Patient currentPatient, Patient hl7Patient, Date \
encounterDate) { </del><ins>+ void addName(Patient currentPatient, Patient \
newPatient, Date encounterDate) { </ins><span class="cx">
</span><span class="cx"> /*
</span><span class="cx"> * Condition where newest hl7 name matches an older \
existing name ( not </span><span class="lines">@@ -726,56 +721,70 @@
</span><span class="cx"> * have an updated date, and will not get set as the \
preferred name. </span><span class="cx"> * Then, the wrong name will be displayed \
on the form. </span><span class="cx"> */
</span><del>-
- for (PersonName pn : currentPatient.getNames()) {
- if (pn != null
- && OpenmrsUtil.nullSafeEquals(pn.getFamilyName()
- , hl7Patient.getFamilyName())
- && OpenmrsUtil.nullSafeEquals(pn.getGivenName()
- ,hl7Patient.getGivenName())
- && OpenmrsUtil.nullSafeEquals(pn.getMiddleName()
- , hl7Patient.getMiddleName())) {
- pn.setDateCreated(encounterDate);
</del><ins>+ try{
+ PersonName newName = newPatient.getPersonName();
+ if (newName == null
+ || (StringUtils.isBlank(newName.getFamilyName())
+ && StringUtils.isBlank(newName.getMiddleName())
+ && StringUtils.isBlank(newName.getGivenName())
+ && StringUtils.isBlank(newName.getFamilyName2())
+ && StringUtils.isBlank(newName.getFullName())
+ && StringUtils.isBlank(newName.getPrefix())
+ && StringUtils.isBlank(newName.getFamilyNamePrefix())
+ && StringUtils.isBlank(newName.getFamilyNameSuffix()))) {
+ return;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- }
</del><ins>+ boolean found = false;
</ins><span class="cx">
</span><del>- currentPatient.addName(hl7Patient.getPersonName());
- Set<PersonName> names = currentPatient.getNames();
</del><ins>+ for (PersonName pn : currentPatient.getNames()) {
+ if (!found && pn.equalsContent(newName)) {
+ pn.setDateCreated(encounterDate);
+ found = true;
+ break;
+ }
</ins><span class="cx">
</span><del>- // reset all addresses preferred status
- for (PersonName name : names) {
- name.setPreferred(false);
- }
</del><ins>+ }
</ins><span class="cx">
</span><del>- // Sort the list of names based on date
- List<PersonName> nameList = new ArrayList<PersonName>(names);
</del><ins>+ if (newName.getUuid() == null) {
+ UUID uuid = UUID.randomUUID();
+ newName.setUuid(uuid.toString());
+ }
</ins><span class="cx">
</span><del>- Collections.sort(nameList, new Comparator<PersonName>() {
- public int compare(PersonName n1, PersonName n2) {
- Date date1 = n1.getDateCreated();
- Date date2 = n2.getDateCreated();
- return date1.compareTo(date2) > 0 ? 0 : 1;
</del><ins>+ currentPatient.addName(newName);
+ Set<PersonName> names = currentPatient.getNames();
+
+ // reset all addresses preferred status
+ for (PersonName name : names) {
+ name.setPreferred(false);
</ins><span class="cx"> }
</span><del>- });
</del><span class="cx">
</span><del>- try {
- // Latest to preferred
</del><ins>+ // Sort the list of names based on date
+ List<PersonName> nameList = new ArrayList<PersonName>(names);
+
+ Collections.sort(nameList, new Comparator<PersonName>() {
+ public int compare(PersonName n1, PersonName n2) {
+ Date date1 = n1.getDateCreated();
+ Date date2 = n2.getDateCreated();
+ return date1.compareTo(date2) > 0 ? 0 : 1;
+ }
+ });
+
+
</ins><span class="cx"> if (nameList.size() > 0 && nameList.get(0) != \
null) { </span><ins>+ // set latest to preferred
</ins><span class="cx"> nameList.get(0).setPreferred(true);
</span><span class="cx"> Set<PersonName> nameSet = new \
TreeSet<PersonName>(nameList); </span><del>- if (nameSet.size()> 0){
</del><ins>+ if (nameSet.size() > 0) {
</ins><span class="cx"> currentPatient.getNames().clear();
</span><span class="cx"> currentPatient.getNames().addAll(nameSet);
</span><del>- }else{
- //Safety check. If nameSet is empty, don't clear. There should
- //at least be the new name from the hl7 message
- log.error("Name set is empty, do not clear."
- + "Name will not be updated.");
</del><span class="cx"> }
</span><span class="cx"> }
</span><ins>+
+
</ins><span class="cx"> } catch (Exception e) {
</span><del>- log.error("Error setting preferred status to the updated patient \
name.",e); </del><ins>+ log.error("Error updating patient name. MRN: \
" + + newPatient.getPatientIdentifier(), e);
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -790,53 +799,53 @@
</span><span class="cx"> */
</span><span class="cx"> public void addAddress(Patient currentPatient, Patient \
newPatient, </span><span class="cx"> Date encounterDate) {
</span><del>-
</del><ins>+
</ins><span class="cx"> PersonAddress newAddress = newPatient.getPersonAddress();
</span><del>-
- if (newAddress == null) {
- return;
- }
-
- if (newAddress == null ||
- (StringUtils.isBlank(newAddress.getAddress1())
- && StringUtils.isBlank(newAddress.getAddress2())
- && StringUtils.isBlank(newAddress.getCityVillage())
- && StringUtils.isBlank(newAddress.getStateProvince())
- && StringUtils.isBlank(newAddress.getCountry())
- && StringUtils.isBlank(newAddress.getPostalCode())
- && StringUtils.isBlank(newAddress.getCountyDistrict())
- && StringUtils.isBlank(newAddress.getStateProvince())
- )){
- return;
- }
-
- boolean found = false;
</del><span class="cx">
</span><del>-
- for (PersonAddress pa : currentPatient.getAddresses()) {
- if (!found && pa.equalsContent(newAddress)) {
- pa.setDateCreated(encounterDate);
- found = true;
- break;
</del><ins>+ try {
+ if (newAddress == null
+ || (StringUtils.isBlank(newAddress.getAddress1())
+ && StringUtils.isBlank(newAddress.getAddress2())
+ && StringUtils.isBlank(newAddress.getCityVillage())
+ && StringUtils.isBlank(newAddress
+ .getStateProvince())
+ && StringUtils.isBlank(newAddress.getCountry())
+ && StringUtils.isBlank(newAddress.getPostalCode())
+ && StringUtils.isBlank(newAddress.getCountyDistrict())
+ && StringUtils.isBlank(newAddress.getStateProvince()))) {
+ return;
</ins><span class="cx"> }
</span><del>- }
</del><span class="cx">
</span><del>- if (!found) {
- newPatient.getPersonAddress().setDateCreated(encounterDate);
- currentPatient.addAddress(newPatient.getPersonAddress());
- }
</del><ins>+ boolean found = false;
</ins><span class="cx">
</span><del>- // reset all addresses preferred status
- Set<PersonAddress> addresses = currentPatient.getAddresses();
- for (PersonAddress address : addresses) {
- address.setPreferred(false);
- }
</del><ins>+ for (PersonAddress pa : currentPatient.getAddresses()) {
+ if (!found && pa.equalsContent(newAddress)) {
+ pa.setDateCreated(encounterDate);
+ found = true;
+ break;
+ }
+ }
</ins><span class="cx">
</span><del>- // Sort the list of names based on date
- List<PersonAddress> addressList = new ArrayList<PersonAddress>(
- addresses);
</del><ins>+ if (!found) {
+ PersonAddress address = newPatient.getPersonAddress();
+ if (address.getUuid() == null) {
+ UUID uuid = UUID.randomUUID();
+ address.setUuid(uuid.toString());
+ }
+ address.setDateCreated(encounterDate);
+ currentPatient.addAddress(address);
+ }
</ins><span class="cx">
</span><del>- try {
</del><ins>+ // reset all addresses preferred status
+ Set<PersonAddress> addresses = currentPatient.getAddresses();
+ for (PersonAddress address : addresses) {
+ address.setPreferred(false);
+ }
+
+ // Sort the list of names based on date
+ List<PersonAddress> addressList = new ArrayList<PersonAddress>(
+ addresses);
+
</ins><span class="cx"> Collections.sort(addressList, new \
Comparator<PersonAddress>() { </span><span class="cx"> public int \
compare(PersonAddress a1, PersonAddress a2) { </span><span class="cx"> Date \
date1 = a1.getDateCreated(); </span><span class="lines">@@ -844,25 +853,19 @@
</span><span class="cx"> return date1.compareTo(date2) > 0 ? 0 : 1;
</span><span class="cx"> }
</span><span class="cx"> });
</span><del>- } catch (Exception e) {
- log.error("Sort exception for address list", e);
- return;
- }
</del><span class="cx">
</span><del>- try {
</del><span class="cx"> if (addressList.size() > 0 && \
addressList.get(0) != null) { </span><span class="cx"> // set latest to preferred
</span><span class="cx"> addressList.get(0).setPreferred(true);
</span><del>- Set<PersonAddress> addressSet = new \
TreeSet<PersonAddress>(
- addressList);
- if (addressSet.size()> 0){
</del><ins>+ Set<PersonAddress> addressSet = new \
TreeSet<PersonAddress>(addressList); + if (addressSet.size() > 0) {
</ins><span class="cx"> currentPatient.getAddresses().clear();
</span><span class="cx"> currentPatient.getAddresses().addAll(addressSet);
</span><span class="cx"> }
</span><del>-
</del><ins>+
</ins><span class="cx"> }
</span><span class="cx"> } catch (Exception e) {
</span><del>- log.error("Error adding addresses to patient", e);
</del><ins>+ log.error("Error adding addresses to patient MRN: " + \
newPatient.getPatientIdentifier(), e); </ins><span class="cx">
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="openmrsmoduleschicabranchesPersonAddressErrorwebsrcorgopenmrsmodulechicawebManualCheckinControllerjava"></a>
<div class="modfile"><h4>Modified: \
openmrs-modules/chica/branches/PersonAddressError/web/src/org/openmrs/module/chica/web/ManualCheckinController.java \
(31004 => 31005)</h4> <pre class="diff"><span>
<span class="info">--- \
openmrs-modules/chica/branches/PersonAddressError/web/src/org/openmrs/module/chica/web/ManualCheckinController.java 2014-11-19 \
20:22:27 UTC (rev 31004)
+++ openmrs-modules/chica/branches/PersonAddressError/web/src/org/openmrs/module/chica/web/ManualCheckinController.java 2014-11-20 \
15:58:01 UTC (rev 31005) </span><span class="lines">@@ -10,9 +10,11 @@
</span><span class="cx"> import java.util.Map;
</span><span class="cx"> import java.util.StringTokenizer;
</span><span class="cx"> import java.util.TreeMap;
</span><ins>+import java.util.UUID;
</ins><span class="cx">
</span><span class="cx"> import javax.servlet.http.HttpServletRequest;
</span><span class="cx">
</span><ins>+import org.apache.commons.lang.StringUtils;
</ins><span class="cx"> import org.apache.commons.logging.Log;
</span><span class="cx"> import org.apache.commons.logging.LogFactory;
</span><span class="cx"> import org.openmrs.Concept;
</span><span class="lines">@@ -319,6 +321,7 @@
</span><span class="cx"> \
name.setMiddleName(request.getParameter("middleName")); </span><span \
class="cx"> name.setFamilyName(request.getParameter("lastName")); \
</span><span class="cx"> name.setDateCreated(new Date()); \
</span><ins>+ name.setCreator(Context.getAuthenticatedUser()); </ins><span \
class="cx"> checkinPatient.addName(name); </span><span class="cx">
</span><span class="cx"> PersonAddress address = new PersonAddress();
</span><span class="lines">@@ -331,7 +334,16 @@
</span><span class="cx"> address.setDateCreated(encounterDate);
</span><span class="cx"> address.setCreator(Context.getAuthenticatedUser());
</span><span class="cx">
</span><del>- if (!address.isBlank()){
</del><ins>+ if (address != null &&
+ (!StringUtils.isBlank(address.getAddress1())
+ || !StringUtils.isBlank(address.getAddress2())
+ || !StringUtils.isBlank(address.getCityVillage())
+ || !StringUtils.isBlank(address.getStateProvince())
+ || !StringUtils.isBlank(address.getCountry())
+ || !StringUtils.isBlank(address.getPostalCode())
+ || !StringUtils.isBlank(address.getCountyDistrict())
+ || !StringUtils.isBlank(address.getStateProvince())
+ )){
</ins><span class="cx"> checkinPatient.addAddress(address);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -345,6 +357,10 @@
</span><span class="cx"> .getPersonAttributeTypeByName("Race");
</span><span class="cx"> attribute.setAttributeType(attributeType);
</span><span class="cx"> attribute.setValue(race);
</span><ins>+ attribute.setCreator(Context.getAuthenticatedUser());
+ attribute.setDateCreated(encounterDate);
+ UUID uuid = UUID.randomUUID();
+ attribute.setUuid(uuid.toString());
</ins><span class="cx"> checkinPatient.addAttribute(attribute);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -359,6 +375,7 @@
</span><span class="cx"> if (attributeType == null) {
</span><span class="cx"> attributeType = new PersonAttributeType();
</span><span class="cx"> attributeType.setDateCreated(new Date());
</span><ins>+ attributeType.setCreator(Context.getAuthenticatedUser());
</ins><span class="cx"> attributeType.setName("Next of Kin");
</span><span class="cx"> attributeType.setDescription("Next of Kin");
</span><span class="cx"> attributeType = \
personService.savePersonAttributeType(attributeType); </span><span class="lines">@@ \
-366,6 +383,10 @@ </span><span class="cx">
</span><span class="cx"> attribute.setAttributeType(attributeType);
</span><span class="cx"> attribute.setValue(nextOfKinFirstName + "|" + \
nextOfKinLastName); </span><ins>+ attribute.setCreator(Context.getAuthenticatedUser());
+ attribute.setDateCreated(encounterDate);
+ UUID uuid = UUID.randomUUID();
+ attribute.setUuid(uuid.toString());
</ins><span class="cx"> checkinPatient.addAttribute(attribute);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -377,6 +398,10 @@
</span><span class="cx"> .getPersonAttributeTypeByName("Telephone \
Number"); </span><span class="cx"> attribute.setAttributeType(attributeType);
</span><span class="cx"> attribute.setValue(dayPhone);
</span><ins>+ attribute.setCreator(Context.getAuthenticatedUser());
+ attribute.setDateCreated(encounterDate);
+ UUID uuid = UUID.randomUUID();
+ attribute.setUuid(uuid.toString());
</ins><span class="cx"> checkinPatient.addAttribute(attribute);
</span><span class="cx"> }
</span><span class="cx"> LocationService locationService = \
Context.getLocationService(); </span></span></pre>
</div>
</div>
</body>
</html>
<p></p>
-- <br />
-- OpenMRS Subversion Commits: <a \
href="http://go.openmrs.org/svn">http://go.openmrs.org/svn</a><br /> Posting is not \
allowed - please join dev@openmrs.org for discussion.<br />
Unsubscribe: svn+unsubscribe@openmrs.org<br />
<p></p>
To unsubscribe from this group and stop receiving emails from it, send an email to <a \
href="mailto:svn+unsubscribe@openmrs.org">svn+unsubscribe@openmrs.org</a>.<br />
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic