Produced by Araxis Merge on 4/5/2017 4:22:06 PM Central Daylight Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | C:\working_scrub\Unredacted\eHX Code Base\eHX_Bld2_Source Code_CIF_2017-02-14\NHIN_adapter\SpecProcessor\src\main\java\gov\va\ccd\components\impl | ConditionProblemsComponent.java | Fri Feb 10 15:41:44 2017 UTC |
| 2 | eHX-CIF.zip\eHX-CIF\eHX Code Base\eHX_Bld2_Source Code_CIF_2017-02-14\NHIN_adapter\SpecProcessor\src\main\java\gov\va\ccd\components\impl | ConditionProblemsComponent.java | Mon Apr 3 14:39:02 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 1284 |
| Changed | 1 | 2 |
| Inserted | 0 | 0 |
| Removed | 0 | 0 |
| Whitespace | |
|---|---|
| Character case | Differences in character case are significant |
| Line endings | Differences in line endings (CR and LF characters) are ignored |
| CR/LF characters | Not shown in the comparison detail |
No regular expressions were active.
| 1 | package go v.va.ccd.c omponents. impl; | |
| 2 | ||
| 3 | import gov .va.ccd.co mponents.t ransform.T ransformer ; | |
| 4 | import gov .va.ccd.se rvice.util .EffTimeUt ils; | |
| 5 | import gov .va.ccd.se rvice.util .Utils; | |
| 6 | import gov .va.ccd.se rvice.valu e.objects. impl.Condi tionProble msVO; | |
| 7 | ||
| 8 | import jav a.util.Arr ayList; | |
| 9 | import jav a.util.Has hMap; | |
| 10 | import jav a.util.Lis t; | |
| 11 | import jav a.util.Map ; | |
| 12 | ||
| 13 | import org .apache.co mmons.coll ections.Co llectionUt ils; | |
| 14 | import org .apache.co mmons.lang 3.StringUt ils; | |
| 15 | import org .eclipse.e mf.common. util.EList ; | |
| 16 | import org .joda.time .DateTime; | |
| 17 | import org .joda.time .Years; | |
| 18 | import org .openhealt htools.mdh t.uml.cda. Act; | |
| 19 | import org .openhealt htools.mdh t.uml.cda. AssignedEn tity; | |
| 20 | import org .openhealt htools.mdh t.uml.cda. Documentat ionOf; | |
| 21 | import org .openhealt htools.mdh t.uml.cda. Entry; | |
| 22 | import org .openhealt htools.mdh t.uml.cda. EntryRelat ionship; | |
| 23 | import org .openhealt htools.mdh t.uml.cda. Observatio n; | |
| 24 | import org .openhealt htools.mdh t.uml.cda. Performer1 ; | |
| 25 | import org .openhealt htools.mdh t.uml.cda. Performer2 ; | |
| 26 | import org .openhealt htools.mdh t.uml.cda. RecordTarg et; | |
| 27 | import org .openhealt htools.mdh t.uml.cda. StrucDocTe xt; | |
| 28 | import org .openhealt htools.mdh t.uml.cda. ccd.Contin uityOfCare Document; | |
| 29 | import org .openhealt htools.mdh t.uml.cda. ccd.Proble mSection; | |
| 30 | import org .openhealt htools.mdh t.uml.hl7. datatypes. ANY; | |
| 31 | import org .openhealt htools.mdh t.uml.hl7. datatypes. CD; | |
| 32 | import org .openhealt htools.mdh t.uml.hl7. datatypes. EN; | |
| 33 | import org .openhealt htools.mdh t.uml.hl7. datatypes. II; | |
| 34 | import org .openhealt htools.mdh t.uml.hl7. datatypes. PQ; | |
| 35 | import org .openhealt htools.mdh t.uml.hl7. vocab.x_Ac tRelations hipEntryRe lationship ; | |
| 36 | import org .slf4j.Log ger; | |
| 37 | import org .slf4j.Log gerFactory ; | |
| 38 | ||
| 39 | /** | |
| 40 | * This cl ass is use d to gener ate the na rrative bl ock with h elp of Con ditions | |
| 41 | * and Pro blems with helper. | |
| 42 | * | |
| 43 | * @author vacokandl m | |
| 44 | * | |
| 45 | * @param <S> Proble mSection | |
| 46 | */ | |
| 47 | public cla ss Conditi onProblems Component extends Ab stractComp onent<Prob lemSection > | |
| 48 | { | |
| 49 | pr ivate stat ic final L ogger logg er = Logge rFactory.g etLogger(C onditionPr oblemsComp onent.clas s); | |
| 50 | ||
| 51 | pr ivate Date Time dateO fBirth = n ull; | |
| 52 | Ma p<String, String> pr oviderExtN ames = new HashMap<S tring, Str ing>(); | |
| 53 | ||
| 54 | /* * | |
| 55 | * Construct or | |
| 56 | * | |
| 57 | * @param pr oblemSecti on | |
| 58 | * @param cc dDocument | |
| 59 | * / | |
| 60 | pu blic Condi tionProble msComponen t(final Co ntinuityOf CareDocume nt ccdDocu ment) | |
| 61 | { | |
| 62 | supe r(ccdDocum ent.getPro blemSectio n(), ccdDo cument); | |
| 63 | // S et the dat e of birth | |
| 64 | fina l RecordTa rget targe t = ccdDoc ument.getR ecordTarge ts().get(0 ); | |
| 65 | Stri ng dob = n ull; | |
| 66 | if(t arget != n ull && tar get.getPat ientRole() != null & & target.g etPatientR ole().getP atient() ! = null && target.get PatientRol e().getPat ient().get BirthTime( ) != null && StringU tils.isNot Blank(targ et.getPati entRole(). getPatient ().getBirt hTime().ge tValue())) | |
| 67 | { | |
| 68 | dob = target.get PatientRol e().getPat ient().get BirthTime( ).getValue (); | |
| 69 | } | |
| 70 | ||
| 71 | prov iderExtNam es.putAll( getDocumen tationOfPe rfMap()); | |
| 72 | ||
| 73 | if(S tringUtils .isNotBlan k(dob)) | |
| 74 | { | |
| 75 | dateOf Birth = Ef fTimeUtils .convertDa te(dob); | |
| 76 | } | |
| 77 | } | |
| 78 | ||
| 79 | @O verride | |
| 80 | pu blic void execute() | |
| 81 | { | |
| 82 | if(s ection != null) | |
| 83 | { | |
| 84 | ||
| 85 | List<C onditionPr oblemsVO> rows = thi s.getProbl emRows(); | |
| 86 | append Narrative( this.gener ateXml(row s)); | |
| 87 | } | |
| 88 | ||
| 89 | } | |
| 90 | ||
| 91 | pr ivate Stri ng generat eXml(List< ConditionP roblemsVO> rows) | |
| 92 | { | |
| 93 | Stri ngBuffer s b = new St ringBuffer (); | |
| 94 | if(C ollectionU tils.isNot Empty(rows )) | |
| 95 | { | |
| 96 | if(Col lectionUti ls.isNotEm pty(this.g etComments ())) | |
| 97 | { | |
| 98 | sb.appen d("<table ID='_nbCon ditionProb lemsCommen ts' border ='1' width ='100%'>") ; | |
| 99 | sb.appen d("<thead> "); | |
| 100 | sb.appen d("<tr><th >Comments< /th></tr>" ); | |
| 101 | sb.appen d("</thead >"); | |
| 102 | sb.appen d("<tbody> "); | |
| 103 | ||
| 104 | for(Stri ng comment : this.ge tComments( )) | |
| 105 | { | |
| 106 | sb.append( "<tr width ='100%'>") ; | |
| 107 | sb.append( "<td width ='100%'>") ; | |
| 108 | sb.append( "<p>"); | |
| 109 | sb.append( comment); | |
| 110 | sb.append( "</p>"); | |
| 111 | sb.append( "</td></tr >"); | |
| 112 | } | |
| 113 | ||
| 114 | sb.appen d("</tbody >"); | |
| 115 | sb.appen d("</table >"); | |
| 116 | } | |
| 117 | sb.app end("<tabl e ID='_nbC onditionPr oblems' bo rder='1' w idth='100% '>"); | |
| 118 | sb.app end("<thea d>"); | |
| 119 | sb.app end("<tr>" ); | |
| 120 | sb.app end("<th>P roblem</th >"); | |
| 121 | sb.app end("<th>S tatus</th> "); | |
| 122 | sb.app end("<th>P roblem Cod e</th>"); | |
| 123 | sb.app end("<th>P roblem Typ e</th>"); | |
| 124 | sb.app end("<th>D ate of Ons et</th>"); | |
| 125 | sb.app end("<th>D ate Resolv ed</th>"); | |
| 126 | sb.app end("<th>C ause of De ath</th>") ; | |
| 127 | sb.app end("<th>A ge at Onse t</th>"); | |
| 128 | sb.app end("<th>A ge at Deat h</th>"); | |
| 129 | sb.app end("<th>T ime of Dea th</th>"); | |
| 130 | sb.app end("<th>P rovider</t h>"); | |
| 131 | sb.app end("<th>S ource</th> "); | |
| 132 | sb.app end("</tr> \n"); | |
| 133 | sb.app end("</the ad>"); | |
| 134 | sb.app end("<tbod y>"); | |
| 135 | for(Co nditionPro blemsVO he lper : row s) | |
| 136 | { | |
| 137 | sb.appen d("<tr>"); | |
| 138 | sb.appen d("<td ID= \"" + help er.getProb lemRef() + "\">" + U tils.getNo nNullValue (helper.ge tProblem() , null) + "</td>"); | |
| 139 | sb.appen d("<td>" + Utils.get NonNullVal ue(helper. getStatus( ), null) + "</td>"); | |
| 140 | sb.appen d("<td>" + Utils.get NonNullVal ue(helper. getProblem Code(), he lper.getPr oblemCodeT C()) + "</ td>"); | |
| 141 | sb.appen d("<td>" + Utils.get NonNullVal ue(helper. getProblem TypeDN(), helper.get ProblemTyp eTCDN(), h elper.getP roblemType OT()) + "< /td>"); | |
| 142 | sb.appen d("<td>" + Utils.get NonNullVal ue(helper. getDateOns et(), null ) + "</td> "); | |
| 143 | sb.appen d("<td>" + Utils.get NonNullVal ue(helper. getDateRes olved(), n ull) + "</ td>"); | |
| 144 | sb.appen d("<td>" + Utils.get NonNullVal ue(helper. getCauseOf Death(), n ull) + "</ td>"); | |
| 145 | sb.appen d("<td>" + Utils.get NonNullVal ue(helper. getAgeOnse t(), null) + "</td>" ); | |
| 146 | sb.appen d("<td>" + Utils.get NonNullVal ue(helper. getAgeAtDe ath(), nul l) + "</td >"); | |
| 147 | sb.appen d("<td>" + Utils.get NonNullVal ue(helper. getTimeOfD eath(), nu ll) + "</t d>"); | |
| 148 | sb.appen d("<td>" + Utils.get NonNullVal ue(helper. getProvide rExt(), he lper.getPr oviderName ()) + "</t d>"); | |
| 149 | sb.appen d("<td>" + Utils.get NonNullVal ue(helper. getSource( ), null) + "</td>"); | |
| 150 | ||
| 151 | sb.appen d("</tr>") ; | |
| 152 | } | |
| 153 | sb.app end("</tbo dy>"); | |
| 154 | sb.app end("</tab le>"); | |
| 155 | } | |
| 156 | retu rn sb.toSt ring(); | |
| 157 | } | |
| 158 | ||
| 159 | pr ivate List <Condition ProblemsVO > getProbl emRows() | |
| 160 | { | |
| 161 | List <Condition ProblemsVO > list = n ew ArrayLi st<Conditi onProblems VO>(); | |
| 162 | Cond itionProbl emsVO help er = null; | |
| 163 | ||
| 164 | Stru cDocText n arrativeTe xt = secti on.getText (); | |
| 165 | if(C ollectionU tils.isNot Empty(sect ion.getEnt ries())) | |
| 166 | { | |
| 167 | for(En try entry : section. getEntries ()) | |
| 168 | { | |
| 169 | Act act = entry.ge tAct(); | |
| 170 | if(act ! = null) | |
| 171 | { | |
| 172 | helper = n ew Conditi onProblems VO(); | |
| 173 | ||
| 174 | // Provide rExt/Name | |
| 175 | Map<String , String> probPerfs = new Hash Map<String , String>( ); | |
| 176 | if(Collect ionUtils.i sNotEmpty( act.getPer formers()) ) | |
| 177 | { | |
| 178 | // For provi ders witho ut an ID. | |
| 179 | in t emptyCou nt = 0; | |
| 180 | fo r(Performe r2 perform er : act.g etPerforme rs()) | |
| 181 | { | |
| 182 | if(p erformer.g etAssigned Entity() ! = null) | |
| 183 | { | |
| 184 | Assign edEntity a ssignedEnt ity = perf ormer.getA ssignedEnt ity(); | |
| 185 | String id; | |
| 186 | if(Col lectionUti ls.isNotEm pty(assign edEntity.g etIds())) | |
| 187 | { | |
| 188 | id = ass ignedEntit y.getIds() .get(0).ge tExtension (); | |
| 189 | } | |
| 190 | else | |
| 191 | { | |
| 192 | id = Str ing.valueO f(emptyCou nt++); | |
| 193 | } | |
| 194 | ||
| 195 | String names; | |
| 196 | if(ass ignedEntit y.getAssig nedPerson( ) != null && Collect ionUtils.i sNotEmpty( assignedEn tity.getAs signedPers on().getNa mes())) | |
| 197 | { | |
| 198 | names = Transforme r.createNa mes(assign edEntity.g etAssigned Person().g etNames()) ; | |
| 199 | } | |
| 200 | else | |
| 201 | { | |
| 202 | names = StringUtil s.EMPTY; | |
| 203 | } | |
| 204 | if(Str ingUtils.i sNotBlank( id)) | |
| 205 | { | |
| 206 | probPerf s.put(id, names); | |
| 207 | } | |
| 208 | } | |
| 209 | } | |
| 210 | } | |
| 211 | ||
| 212 | // Date Re solved | |
| 213 | if(act.get EffectiveT ime() != n ull && act .getEffect iveTime(). getHigh() != null) | |
| 214 | { | |
| 215 | he lper.setDa teResolved (Utils.get NonNullVal ue(act.get EffectiveT ime().getH igh().getV alue(), "- -")); | |
| 216 | } | |
| 217 | else | |
| 218 | { | |
| 219 | he lper.setDa teResolved ("--"); | |
| 220 | } | |
| 221 | ||
| 222 | // Date on set | |
| 223 | if(act.get EffectiveT ime() != n ull && act .getEffect iveTime(). getLow() ! = null) | |
| 224 | { | |
| 225 | he lper.setDa teOnset(ac t.getEffec tiveTime() .getLow(). getValue() ); | |
| 226 | } | |
| 227 | ||
| 228 | // Cause o f Death | |
| 229 | for(EntryR elationshi p er : act .getEntryR elationshi ps()) | |
| 230 | { | |
| 231 | if (er.getTyp eCode().eq uals(x_Act Relationsh ipEntryRel ationship. CAUS)) | |
| 232 | { | |
| 233 | ||
| 234 | if(e r.getObser vation() ! = null && er.getObse rvation(). getCode() != null) | |
| 235 | { | |
| 236 | final CD code = er.getObse rvation(). getCode(); | |
| 237 | if(cod e.getCode( ).equals(" 419620001" )) | |
| 238 | { | |
| 239 | if(er.ge tObservati on().getTe xt() != nu ll) | |
| 240 | { | |
| 241 | helper.set CauseOfDea th(er.getO bservation ().getText ().getText ()); | |
| 242 | } | |
| 243 | } | |
| 244 | } | |
| 245 | } | |
| 246 | ||
| 247 | } | |
| 248 | ||
| 249 | final Stri ngBuilder ageOfDeath String = n ew StringB uilder(); | |
| 250 | final Stri ngBuilder ageAtOnset = new Str ingBuilder (); | |
| 251 | ||
| 252 | for(EntryR elationshi p er : act .getEntryR elationshi ps()) | |
| 253 | { | |
| 254 | // CC Added. For getti ng Age at Death and Time of De ath. | |
| 255 | // And Cause . | |
| 256 | if (x_ActRela tionshipEn tryRelatio nship.CAUS .equals(er .getTypeCo de())) | |
| 257 | { | |
| 258 | if(e r.getObser vation() ! = null) | |
| 259 | { | |
| 260 | Observ ation obs = er.getOb servation( ); | |
| 261 | if(obs .getEffect iveTime() != null) | |
| 262 | { | |
| 263 | if(Strin gUtils.isN otBlank(ob s.getEffec tiveTime() .getValue( ))) | |
| 264 | { | |
| 265 | helper.set TimeOfDeat h(obs.getE ffectiveTi me().getVa lue()); | |
| 266 | } | |
| 267 | } | |
| 268 | for(En tryRelatio nship inne rEr : obs. getEntryRe lationship s()) | |
| 269 | { | |
| 270 | PQ age = Utils.get Age(innerE r); | |
| 271 | if(age ! = null && ageOfDeath String.len gth() < 1 && age.get Value() != null) | |
| 272 | { | |
| 273 | ageOfDeath String.app end(age.ge tValue()). append(" " ); | |
| 274 | ageOfDeath String.app end(Utils. convertPQU nit(age)); | |
| 275 | if(ageOfDe athString. length() > 1) | |
| 276 | { | |
| 277 | he lper.setAg eAtDeath(a geOfDeathS tring.toSt ring()); | |
| 278 | } | |
| 279 | } | |
| 280 | } | |
| 281 | // Cau se of deat h | |
| 282 | // Run through t he usual S uspects | |
| 283 | if(Col lectionUti ls.isNotEm pty(obs.ge tValues()) ) | |
| 284 | { | |
| 285 | for(ANY any : obs. getValues( )) | |
| 286 | { | |
| 287 | if(any ins tanceof CD ) | |
| 288 | { | |
| 289 | CD code = (C D) any; | |
| 290 | if (StringUti ls.isNotBl ank(code.g etDisplayN ame())) | |
| 291 | { | |
| 292 | help er.setCaus eOfDeath(c ode.getDis playName() ); | |
| 293 | } | |
| 294 | } | |
| 295 | } | |
| 296 | } | |
| 297 | if(Str ingUtils.i sBlank(hel per.getCau seOfDeath( )) && er.g etObservat ion().getT ext() != n ull) | |
| 298 | { | |
| 299 | helper.s etCauseOfD eath(er.ge tObservati on().getTe xt().getTe xt()); | |
| 300 | } | |
| 301 | ||
| 302 | } | |
| 303 | } | |
| 304 | el se | |
| 305 | { | |
| 306 | // F or getting age at on set | |
| 307 | PQ a ge = Utils .getAge(er ); | |
| 308 | if(a ge != null && ageAtO nset.lengt h() < 1 && age.getVa lue() != n ull) | |
| 309 | { | |
| 310 | ageAtO nset.appen d(age.getV alue()).ap pend(" "); | |
| 311 | ageAtO nset.appen d(Utils.co nvertPQUni t(age)); | |
| 312 | if(age AtOnset.le ngth() > 1 ) | |
| 313 | { | |
| 314 | helper.s etAgeOnset (ageAtOnse t.toString ()); | |
| 315 | } | |
| 316 | } | |
| 317 | } | |
| 318 | } | |
| 319 | ||
| 320 | if(StringU tils.isBla nk(helper. getAgeOnse t()) && da teOfBirth != null && StringUti ls.isNotBl ank(helper .getDateOn set())) | |
| 321 | { | |
| 322 | // Need to c alculate t he age. | |
| 323 | fi nal DateTi me dateOfO nset = Eff TimeUtils. convertDat e(helper.g etDateOnse t()); | |
| 324 | in t years = Years.year sBetween(d ateOfBirth , dateOfOn set).getYe ars(); | |
| 325 | he lper.setAg eOnset(Int eger.toStr ing(years) ); | |
| 326 | } | |
| 327 | ||
| 328 | if(StringU tils.isBla nk(helper. getAgeAtDe ath()) && dateOfBirt h != null && StringU tils.isNot Blank(help er.getTime OfDeath()) ) | |
| 329 | { | |
| 330 | fi nal DateTi me dateOfD eath = Eff TimeUtils. convertDat e(helper.g etTimeOfDe ath()); | |
| 331 | in t years = Years.year sBetween(d ateOfBirth , dateOfDe ath).getYe ars(); | |
| 332 | he lper.setAg eAtDeath(I nteger.toS tring(year s)); | |
| 333 | } | |
| 334 | ||
| 335 | String sou rce; | |
| 336 | source = U tils.getSo urceFromAc t(act); | |
| 337 | ||
| 338 | helper.set Source(sou rce); | |
| 339 | ||
| 340 | for(EntryR elationshi p entryRel ationship : act.getE ntryRelati onships()) | |
| 341 | { | |
| 342 | ||
| 343 | Ob servation problemObs ervation = entryRela tionship.g etObservat ion(); | |
| 344 | ||
| 345 | if (problemOb servation != null) | |
| 346 | { | |
| 347 | // D ouble chec k to see i f we can g et source from the | |
| 348 | // o bservation . | |
| 349 | if(S tringUtils .isBlank(s ource)) | |
| 350 | { | |
| 351 | source = Utils.g etSourceFr omObservat ion(proble mObservati on); | |
| 352 | helper .setSource (source); | |
| 353 | } | |
| 354 | ||
| 355 | // p roblem | |
| 356 | if(p roblemObse rvation.ge tText() != null && p roblemObse rvation.ge tText().ge tReference () != null ) | |
| 357 | { | |
| 358 | String problemRe f = proble mObservati on.getText ().getRefe rence().ge tValue(); | |
| 359 | if(Str ingUtils.i sNotBlank( problemRef )) | |
| 360 | { | |
| 361 | helper.s etProblem( Utils.getR eferenceVa lue(narrat iveText, p roblemRef) ); | |
| 362 | helper.s etProblemR ef(problem Ref); | |
| 363 | } | |
| 364 | } | |
| 365 | ||
| 366 | // p roblem cod e | |
| 367 | if(C ollectionU tils.isNot Empty(prob lemObserva tion.getVa lues())) | |
| 368 | { | |
| 369 | if(pro blemObserv ation.getV alues().ge t(0) insta nceof CD) | |
| 370 | { | |
| 371 | ||
| 372 | CD probl emCode = ( CD) proble mObservati on.getValu es().get(0 ); | |
| 373 | ||
| 374 | // CCR 1 77986 | |
| 375 | logger.d ebug(" obs ervation c ode values code: {}, code syst em: {}, co de system name: {}, display na me: {} ", problemCod e.getCode( ), problem Code.getCo deSystem() , problemC ode.getCod eSystemNam e(), probl emCode.get DisplayNam e()); | |
| 376 | ||
| 377 | if(probl emCode.get Code() != null) | |
| 378 | { | |
| 379 | helper.set ProblemCod e(problemC ode.getCod e()); | |
| 380 | if("V22.2" .equals(pr oblemCode. getCode()) ) | |
| 381 | { | |
| 382 | // Dealing w ith pregna ncy need t o | |
| 383 | // change | |
| 384 | // the | |
| 385 | // problenam e. | |
| 386 | he lper.setPr oblem("Pre gnancy (" + helper.g etDateReso lved() + " )"); | |
| 387 | } | |
| 388 | } | |
| 389 | else | |
| 390 | { | |
| 391 | String pro blemCodeTC = null; | |
| 392 | if(Collect ionUtils.i sNotEmpty( problemCod e.getTrans lations()) ) | |
| 393 | { | |
| 394 | pr oblemCodeT C = proble mCode.getT ranslation s().get(0) .getCode() ; | |
| 395 | he lper.setPr oblemCodeT C(problemC odeTC); | |
| 396 | if ("V22.2".e quals(prob lemCodeTC) ) | |
| 397 | { | |
| 398 | // D ealing wit h pregnanc y need | |
| 399 | // t o | |
| 400 | // c hange | |
| 401 | // t he problen ame. | |
| 402 | help er.setProb lem("Pregn ancy ( " + helper.ge tDateResol ved() + " )"); | |
| 403 | } | |
| 404 | } | |
| 405 | } | |
| 406 | } | |
| 407 | ||
| 408 | // Pro blem Type | |
| 409 | CD pro blemType = problemOb servation. getCode(); | |
| 410 | if(pro blemType ! = null) | |
| 411 | { | |
| 412 | if(probl emType.get DisplayNam e() != nul l) | |
| 413 | { | |
| 414 | helper.set ProblemTyp eDN(proble mType.getD isplayName ()); | |
| 415 | } | |
| 416 | else | |
| 417 | { | |
| 418 | String pro blemTypeTC DN = null; | |
| 419 | if(Collect ionUtils.i sNotEmpty( problemTyp e.getTrans lations()) ) | |
| 420 | { | |
| 421 | ||
| 422 | pr oblemTypeT CDN = prob lemType.ge tTranslati ons().get( 0).getDisp layName(); | |
| 423 | if (problemTy peTCDN != null) | |
| 424 | { | |
| 425 | help er.setProb lemTypeTCD N(problemT ypeTCDN); | |
| 426 | } | |
| 427 | } | |
| 428 | } | |
| 429 | // Displ ay Problem Type code originalT ext | |
| 430 | // Verif ied by Vis tA CCD Dat a Mapping Work | |
| 431 | // Group | |
| 432 | // on 12 /11/2013 a nd Dr. Don ahue on | |
| 433 | // 1/22/ 2014 | |
| 434 | if(probl emType.get OriginalTe xt() != nu ll) | |
| 435 | { | |
| 436 | // First c heck for a reference . | |
| 437 | if(problem Type.getOr iginalText ().getRefe rence() != null) | |
| 438 | { | |
| 439 | St ring ref = problemTy pe.getOrig inalText() .getRefere nce().getV alue(); | |
| 440 | if (StringUti ls.isNotBl ank(ref)) | |
| 441 | { | |
| 442 | Stri ng val = U tils.getAl lRefernceV alue(narra tiveText.g etMixed(), ref); | |
| 443 | if(S tringUtils .isNotBlan k(val)) | |
| 444 | { | |
| 445 | helper .setProble mTypeOT(va l); | |
| 446 | } | |
| 447 | } | |
| 448 | } | |
| 449 | else | |
| 450 | { | |
| 451 | if (StringUti ls.isNotBl ank(proble mType.getO riginalTex t().getTex t())) | |
| 452 | { | |
| 453 | help er.setProb lemTypeOT( problemTyp e.getOrigi nalText(). getText()) ; | |
| 454 | } | |
| 455 | } | |
| 456 | ||
| 457 | } | |
| 458 | ||
| 459 | } | |
| 460 | ||
| 461 | } | |
| 462 | ||
| 463 | // / ClinicalDo cument/com ponent/str ucturedBod y/componen t/section/ entry/act/ | |
| 464 | // e ntryRelati onship[typ eCode=SUBJ ]/observat ion/entryR elationshi p[typeCode =REFR]/obs ervation[t emplateId@ root | |
| 465 | // = | |
| 466 | // '2.16.8 40.1.11388 3. IP ']/value/@ displayNam e | |
| 467 | ||
| 468 | // S tatus | |
| 469 | for( EntryRelat ionship en tryRelatio nship1 : p roblemObse rvation.ge tEntryRela tionships( )) | |
| 470 | { | |
| 471 | ||
| 472 | if(ent ryRelation ship1.getT ypeCode() != null && entryRela tionship1. getTypeCod e().toStri ng().trim( ).equals(" REFR")) | |
| 473 | { | |
| 474 | if(entry Relationsh ip1.getObs ervation() != null & & !entryRe lationship 1.getObser vation().g etValues() .isEmpty() && entryR elationshi p1.getObse rvation(). getValues( ).get(0) i nstanceof CD) | |
| 475 | { | |
| 476 | CD statusC ode = (CD) entryRela tionship1. getObserva tion().get Values().g et(0); | |
| 477 | // CCR 177 986 | |
| 478 | logger.deb ug(" statu s code val ue {}, {}, {}, {} : " + status Code.getCo de() + ", " + status Code.getCo deSystem() + ", " + statusCode .getCodeSy stemName() + ", " + statusCode .getDispla yName()); | |
| 479 | String sta tus = stat usCode.get DisplayNam e(); | |
| 480 | helper.set Status(sta tus); | |
| 481 | } | |
| 482 | ||
| 483 | } // f or | |
| 484 | ||
| 485 | } // problem c ode | |
| 486 | ||
| 487 | } // problem observati on | |
| 488 | } | |
| 489 | ||
| 490 | if(!probPe rfs.isEmpt y()) | |
| 491 | { | |
| 492 | // Lets try to link up some name s. | |
| 493 | St ringBuilde r sb = new StringBui lder(); | |
| 494 | ||
| 495 | fo r(Map.Entr y<String, String> en try2 : pro bPerfs.ent rySet()) | |
| 496 | { | |
| 497 | // F irst if th ere is a m atch use t he Documen tation | |
| 498 | // o f name. | |
| 499 | if(p roviderExt Names.cont ainsKey(en try2.getKe y()) && St ringUtils. isNotBlank (providerE xtNames.ge t(entry2.g etValue()) )) | |
| 500 | { | |
| 501 | if(sb. length() > 0) | |
| 502 | { | |
| 503 | sb.appen d(", "); | |
| 504 | } | |
| 505 | sb.app end(provid erExtNames .get(entry 2.getValue ())); | |
| 506 | } | |
| 507 | else | |
| 508 | { | |
| 509 | if(Str ingUtils.i sNotBlank( entry2.get Value())) | |
| 510 | { | |
| 511 | if(sb.le ngth() > 0 ) | |
| 512 | { | |
| 513 | sb.append( ", "); | |
| 514 | } | |
| 515 | sb.appen d(entry2.g etValue()) ; | |
| 516 | } | |
| 517 | } | |
| 518 | } | |
| 519 | if (sb.length () > 0) | |
| 520 | { | |
| 521 | help er.setProv iderName(s b.toString ()); | |
| 522 | } | |
| 523 | } | |
| 524 | ||
| 525 | list.add(h elper); | |
| 526 | } | |
| 527 | } | |
| 528 | } | |
| 529 | retu rn list; | |
| 530 | } | |
| 531 | ||
| 532 | pr ivate Map< String, St ring> getD ocumentati onOfPerfMa p() | |
| 533 | { | |
| 534 | Map< String, St ring> ret = new Hash Map<String , String>( ); | |
| 535 | ||
| 536 | if(C ollectionU tils.isNot Empty(ccdD ocument.ge tDocumenta tionOfs()) ) | |
| 537 | { | |
| 538 | for(Do cumentatio nOf docOf : ccdDocum ent.getDoc umentation Ofs()) | |
| 539 | { | |
| 540 | if(docOf .getServic eEvent() ! = null && Collection Utils.isNo tEmpty(doc Of.getServ iceEvent() .getPerfor mers())) | |
| 541 | { | |
| 542 | for(Perfor mer1 perfo rmer : doc Of.getServ iceEvent() .getPerfor mers()) | |
| 543 | { | |
| 544 | As signedEnti ty ent = p erformer.g etAssigned Entity(); | |
| 545 | if (ent != nu ll) | |
| 546 | { | |
| 547 | Stri ng id; | |
| 548 | if(C ollectionU tils.isNot Empty(ent. getIds())) | |
| 549 | { | |
| 550 | id = e nt.getIds( ).get(0).g etExtensio n(); | |
| 551 | } | |
| 552 | else | |
| 553 | { | |
| 554 | id = S tringUtils .EMPTY; | |
| 555 | } | |
| 556 | if(e nt.getAssi gnedPerson () != null && Collec tionUtils. isNotEmpty (ent.getAs signedPers on().getNa mes())) | |
| 557 | { | |
| 558 | String names = T ransformer .createNam es(ent.get AssignedPe rson().get Names()); | |
| 559 | if(Str ingUtils.i sNotBlank( names) && StringUtil s.isNotBla nk(id)) | |
| 560 | { | |
| 561 | ret.put( id, names) ; | |
| 562 | } | |
| 563 | } | |
| 564 | } | |
| 565 | } | |
| 566 | } | |
| 567 | } | |
| 568 | } | |
| 569 | retu rn ret; | |
| 570 | } | |
| 571 | ||
| 572 | /* * | |
| 573 | * provider Name and e xtension f rom condit ions secti on. | |
| 574 | * | |
| 575 | * @param li st | |
| 576 | * @return | |
| 577 | * / | |
| 578 | ||
| 579 | pr otected Ma p<String, String> ex tractProvi derExtOrNa me2(EList< Performer2 > list) | |
| 580 | { | |
| 581 | Map< String, St ring> prov iderExtNam es1 = new HashMap<St ring, Stri ng>(); | |
| 582 | Stri ng provide rExt = nul l, provide rName = nu ll; | |
| 583 | for( Performer2 performer : list) | |
| 584 | { | |
| 585 | ||
| 586 | provid erExt = nu ll; | |
| 587 | provid erName = n ull; | |
| 588 | ||
| 589 | Assign edEntity a ssignedEnt ity = perf ormer.getA ssignedEnt ity(); | |
| 590 | EList< II> ids = assignedEn tity.getId s(); | |
| 591 | for(II id : ids) | |
| 592 | { | |
| 593 | if(id.ge tExtension () != null ) | |
| 594 | { | |
| 595 | providerEx t = id.get Extension( ); | |
| 596 | ||
| 597 | } | |
| 598 | } | |
| 599 | ||
| 600 | if(ass ignedEntit y.getAssig nedPerson( ) != null) | |
| 601 | { | |
| 602 | if(assig nedEntity. getAssigne dPerson(). getNames() != null & & !assigne dEntity.ge tAssignedP erson().ge tNames().i sEmpty()) | |
| 603 | { | |
| 604 | if(Collect ionUtils.i sNotEmpty( assignedEn tity.getAs signedPers on().getNa mes())) | |
| 605 | { | |
| 606 | St ringBuilde r sb = new StringBui lder(); | |
| 607 | EN en = assi gnedEntity .getAssign edPerson() .getNames( ).get(0); | |
| 608 | if (Collectio nUtils.isN otEmpty(en .getPrefix es())) | |
| 609 | sb.a ppend(en.g etPrefixes ().get(0). getText()) .append(" "); | |
| 610 | if (Collectio nUtils.isN otEmpty(en .getGivens ())) | |
| 611 | sb.a ppend(en.g etGivens() .get(0).ge tText()).a ppend(" ") ; | |
| 612 | if (Collectio nUtils.isN otEmpty(en .getFamili es())) | |
| 613 | sb.a ppend(en.g etFamilies ().get(0). getText()) .append(" "); | |
| 614 | pr oviderName = sb.toSt ring(); | |
| 615 | } | |
| 616 | } | |
| 617 | ||
| 618 | } | |
| 619 | } | |
| 620 | prov iderExtNam es1.put(pr oviderExt, providerN ame); | |
| 621 | ||
| 622 | retu rn provide rExtNames1 ; | |
| 623 | } | |
| 624 | ||
| 625 | /* * | |
| 626 | * No-op han dled above . | |
| 627 | * / | |
| 628 | @O verride | |
| 629 | pr otected St ring gener ateXml() | |
| 630 | { | |
| 631 | retu rn null; | |
| 632 | } | |
| 633 | ||
| 634 | /* * | |
| 635 | * No-op han dled above . | |
| 636 | * / | |
| 637 | @O verride | |
| 638 | pr otected vo id createO bjects() | |
| 639 | { | |
| 640 | ||
| 641 | } | |
| 642 | ||
| 643 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.