Produced by Araxis Merge on 12/14/2017 1:27:55 PM Eastern Standard 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 | CUI-CPP-v2.3.2-source.zip\app\models | exam_response_generation_framework.rb | Mon Nov 20 23:19:07 2017 UTC |
| 2 | CUI-CPP-v2.3.2-source.zip\app\models | exam_response_generation_framework.rb | Wed Dec 13 22:31:19 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 1092 |
| Changed | 1 | 70 |
| 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 | class Exam ResponseGe nerationFr amework | |
| 2 | ||
| 3 | def init ialize(the _set_of_vb ms_r_fact_ groups) | |
| 4 | @the_i nternal_fr amework = Array.new | |
| 5 | the_se t_of_vbms_ r_fact_gro ups.each d o |the_fac t_group_to _use| | |
| 6 | the_ framework_ entry = { :fact_grou p => the_f act_group_ to_use, :d iagnoses = > Array.ne w, :unatta ched_sympt oms => Arr ay.new, :u nattached_ diagnosis_ modifiers => Array.n ew } | |
| 7 | @the _internal_ framework << the_fra mework_ent ry | |
| 8 | end | |
| 9 | #binding.p ry #cs | |
| 10 | end | |
| 11 | ||
| 12 | def acce pts(the_ht ml_node_to _add) | |
| 13 | if( !t he_html_no de_to_add. nil? && !t he_html_no de_to_add[ 'id'].nil? ) | |
| 14 | #binding.p ry #cs | |
| 15 | the_ id = the_h tml_node_t o_add['id' ] | |
| 16 | # cas e the_html _node_to_a dd['id'] | |
| 17 | # w hen -> (th e_id) { th e_id.start s_with?('s ymptom-') } | |
| 18 | # | |
| 19 | #binding.p ry #cs | |
| 20 | cas e | |
| 21 | w hen the_id .starts_wi th?('sympt om-') | |
| 22 | the_sympto m_name = t he_html_no de_to_add[ 'name'].pa rtition('- ').last | |
| 23 | the_sympto m_name = t he_symptom _name.part ition('-') .first | |
| 24 | the_associ ated_diagn oses = the _html_node _to_add['v alue'] | |
| 25 | @the_inter nal_framew ork.each d o |the_fra mework_to_ check| | |
| 26 | the_matc hing_diagn oses = the _framework _to_check[ :fact_grou p].diagnos es_which_m atch(the_a ssociated_ diagnoses) | |
| 27 | #binding.p ry #cs | |
| 28 | if( not the_matchi ng_diagnos es.empty? ) | |
| 29 | #binding.p ry #cs | |
| 30 | the_sy mptom_stri ng = the_f ramework_t o_check[:f act_group] .symptom_s tring_for( the_sympto m_name) | |
| 31 | the_sy mptom_elem ent = { :s ymptom_str ing => the _symptom_s tring, :as sociated_d iagnostic_ codes => t he_matchin g_diagnose s } | |
| 32 | the_fr amework_to _check[:un attached_s ymptoms] < < the_symp tom_elemen t | |
| 33 | end | |
| 34 | end | |
| 35 | #binding.p ry #cs | |
| 36 | #w hen -> (th e_id) { th e_id.start s_with?('d iagnosis-' ) } | |
| 37 | wh en the_id. starts_wit h?('diagno sis-') | |
| 38 | #binding.p ry #cs | |
| 39 | # the_diagn osis_name = the_html _node_to_a dd['name'] .partition ('-').last | |
| 40 | the_diagno stic_code = the_html _node_to_a dd['value' ] | |
| 41 | @the_inter nal_framew ork.each d o |the_fra mework_to_ check| | |
| 42 | if( the_ framework_ to_check[: fact_group ].contains (the_diagn ostic_code ) ) | |
| 43 | the_di agnosis_st ring = the _framework _to_check[ :fact_grou p].diagnos is_string_ for(the_di agnostic_c ode) | |
| 44 | the_di agnosis_el ement = { :diagnosis _string => the_diagn osis_strin g, :diagno stic_code => the_dia gnostic_co de, :assoc iated_symp toms => Ar ray.new, : diagnosis_ modifiers => Array.n ew } | |
| 45 | the_fr amework_to _check[:di agnoses] < < the_diag nosis_elem ent | |
| 46 | end | |
| 47 | end | |
| 48 | #binding.p ry #cs | |
| 49 | # when -> (t he_id) { t he_id.star ts_with?(' diagnosis_ modifier-' ) } | |
| 50 | wh en the_id. starts_wit h?('diagno sis_modifi er-') | |
| 51 | the_diag nostic_cod e = the_di agnosis_mo difier_dia gnosis_cod e_based_on ( the_html _node_to_a dd['id']) | |
| 52 | the_diag nosis_modi fier_name = the_diag nosis_modi fier_name_ based_on( the_html_n ode_to_add ['id']) | |
| 53 | #cs DEAP-1 592 the_d iagnosis_m odifier_va lue = the_ diagnosis_ modifier_v alue_from( the_html_n ode_to_add ) | |
| 54 | the_diag nosis_modi fier_value s = the_di agnosis_mo difier_val ues_from(t he_html_no de_to_add) | |
| 55 | @the_inter nal_framew ork.each d o |the_fra mework_to_ check| | |
| 56 | if( the_ framework_ to_check[: fact_group ].contains (the_diagn ostic_code ) ) | |
| 57 | the_di agnosis_mo difier_val ues.each d o |the_dia gnosis_mod ifier_valu e| #cs D EAP-1592 | |
| 58 | the_ diagnosis_ modifier_s tring = th e_framewor k_to_check [:fact_gro up].diagno sis_modifi er_string_ for(the_di agnostic_c ode, the_d iagnosis_m odifier_na me, the_di agnosis_mo difier_val ue) | |
| 59 | the_ diagnosis_ modifier_f ields = th e_framewor k_to_check [:fact_gro up].diagno sis_modifi er_fields_ for(the_di agnostic_c ode ,the_d iagnosis_m odifier_na me) | |
| 60 | the_ diagnosis_ modifier_e lement = { :diagnosis _modifier_ string => the_diagno sis_modifi er_string, :diagnosi s_modifier _fields => the_diagn osis_modif ier_fields , :diagnos tic_code = > the_diag nostic_cod e} | |
| 61 | the_ framework_ to_check[: unattached _diagnosis _modifiers ] << the_d iagnosis_m odifier_el ement | |
| 62 | end # cs DEAP-15 92 | |
| 63 | #binding.p ry #cs | |
| 64 | end | |
| 65 | end | |
| 66 | end | |
| 67 | end | |
| 68 | end | |
| 69 | ||
| 70 | def the_ diagnosis_ modifier_v alues_from (the_field ) | |
| 71 | case t he_field.n ame | |
| 72 | when 'select' | |
| 73 | #binding.p ry #cs | |
| 74 | th e_value_ar ray = [] | |
| 75 | th e_field.ch ildren.eac h do |the_ option_to_ check| | |
| 76 | if( the_op tion_to_ch eck['selec ted'] == ' selected' ) | |
| 77 | #binding.p ry #cs | |
| 78 | the_valu e_array << the_optio n_to_check ['value'] | |
| 79 | end | |
| 80 | en d | |
| 81 | #binding.p ry #cs | |
| 82 | re turn the_v alue_array # raise an excepti on | |
| 83 | else | |
| 84 | re turn [""] # raise a n exceptio n | |
| 85 | end | |
| 86 | end | |
| 87 | ||
| 88 | def the_ diagnosis_ modifier_v alue_from( the_field) | |
| 89 | case t he_field.n ame | |
| 90 | # whe n 'input' | |
| 91 | # t he_field_t ype = the_ field_to_c heck['type '] | |
| 92 | # c ase the_fi eld_type | |
| 93 | # when 'che ckbox' | |
| 94 | # return( the_field _to_check[ 'checked'] == 'check ed' ) | |
| 95 | # when 'rad io' | |
| 96 | ##binding. pry #cs | |
| 97 | # return( the_field _to_check[ 'checked'] == 'check ed' ) | |
| 98 | # else | |
| 99 | # return false | |
| 100 | # e nd | |
| 101 | when 'select' | |
| 102 | #binding.p ry #cs | |
| 103 | th e_field.ch ildren.eac h do |the_ option_to_ check| | |
| 104 | if( the_op tion_to_ch eck['selec ted'] == ' selected' ) | |
| 105 | #binding.p ry #cs | |
| 106 | return t he_option_ to_check[' value'] | |
| 107 | end | |
| 108 | en d | |
| 109 | #binding.p ry #cs | |
| 110 | re turn '' # raise an exception | |
| 111 | # whe n 'option' | |
| 112 | #binding.p ry #cs | |
| 113 | # r eturn ( th e_field_to _check['se lected'] = = 'selecte d' ) | |
| 114 | else | |
| 115 | re turn '' # raise an e xception | |
| 116 | end | |
| 117 | end | |
| 118 | ||
| 119 | def the_ diagnosis_ modifier_n ame_based_ on( the_di agnosis_mo difier_id ) | |
| 120 | the_st ripped_id = the_diag nosis_modi fier_id.sp lit('-sele ct').first | |
| 121 | the_na me = the_s tripped_id .split('-' ).second | |
| 122 | return the_name | |
| 123 | end | |
| 124 | ||
| 125 | def the_ diagnosis_ modifier_d iagnosis_c ode_based_ on( the_di agnosis_mo difier_id ) | |
| 126 | the_st ripped_id = the_diag nosis_modi fier_id.sp lit('-sele ct').first | |
| 127 | the_di agnostic_c ode = the_ stripped_i d.split('- ').last | |
| 128 | #binding.p ry #cs | |
| 129 | return the_diagn ostic_code | |
| 130 | end | |
| 131 | ||
| 132 | def cons olidates_i ts_element s | |
| 133 | @the_i nternal_fr amework.ea ch do |the _framework _to_consol idate| | |
| 134 | ||
| 135 | the_ framework_ to_consoli date[:unat tached_sym ptoms].eac h do |the_ symptom_to _move| | |
| 136 | th e_symptom_ has_been_a ttached = false | |
| 137 | th e_framewor k_to_conso lidate[:di agnoses].e ach do |th e_diagnosi s_to_check | | |
| 138 | if(the_sym ptom_to_mo ve[:associ ated_diagn ostic_code s].include ?(the_diag nosis_to_c heck[:diag nostic_cod e]) ) | |
| 139 | the_diag nosis_to_c heck[:asso ciated_sym ptoms] << the_sympto m_to_move | |
| 140 | the_symp tom_has_be en_attache d = true | |
| 141 | break | |
| 142 | end | |
| 143 | break if t he_symptom _has_been_ attached | |
| 144 | en d | |
| 145 | if ( !the_sym ptom_has_b een_attach ed ) | |
| 146 | #binding.p ry #cs | |
| 147 | the_framew ork_to_con solidate[: diagnoses] .first[:as sociated_s ymptoms] < < the_symp tom_to_mov e | |
| 148 | en d | |
| 149 | end | |
| 150 | the_ framework_ to_consoli date[:unat tached_sym ptoms] = A rray.new | |
| 151 | ||
| 152 | the_ framework_ to_consoli date[:unat tached_dia gnosis_mod ifiers].ea ch do |the _diagnosis _modifier_ to_move| | |
| 153 | #binding.p ry #cs | |
| 154 | th e_diagnosi s_modifier _has_been_ attached = false | |
| 155 | th e_framewor k_to_conso lidate[:di agnoses].e ach do |th e_diagnosi s_to_check | | |
| 156 | if(the_dia gnosis_mod ifier_to_m ove[:diagn ostic_code ] == the_d iagnosis_t o_check[:d iagnostic_ code]) | |
| 157 | the_diag nosis_to_c heck[:diag nosis_modi fiers] << the_diagno sis_modifi er_to_move | |
| 158 | the_diag nosis_modi fier_has_b een_attach ed = true | |
| 159 | break | |
| 160 | end | |
| 161 | break if t he_diagnos is_modifie r_has_been _attached | |
| 162 | en d | |
| 163 | end | |
| 164 | the_ framework_ to_consoli date[:unat tached_dia gnosis_mod ifiers] = Array.new | |
| 165 | end | |
| 166 | end | |
| 167 | ||
| 168 | def xml_ string(the _evaluatio n) | |
| 169 | the_co ncatenated _documents = '<ExamR esponses>' | |
| 170 | self.e xam_respon se_xml_doc uments(the _evaluatio n).each do |the_exam _response_ to_add| | |
| 171 | the_ concatenat ed_documen ts = the_c oncatenate d_document s + the_ex am_respons e_to_add | |
| 172 | end | |
| 173 | the_co ncatenated _documents = the_con catenated_ documents + '</ExamR esponses>' | |
| 174 | return the_conca tenated_do cuments | |
| 175 | end | |
| 176 | ||
| 177 | ||
| 178 | def exam _response_ xml_docume nts(the_ev aluation) | |
| 179 | # retur n '<bogus> bogus</bog us>' | |
| 180 | #binding.p ry #cs | |
| 181 | the_li st_of_exam _response_ elements = Array.new | |
| 182 | # go t hrough the internal_ framework | |
| 183 | @the_i nternal_fr amework.ea ch do |the _framework _to_use| | |
| 184 | # if the curre nt fact gr oup contai ns diagnos es | |
| 185 | if( not the_fr amework_to _use[:diag noses].emp ty?) | |
| 186 | # create an exam-respo nse elemen t | |
| 187 | th e_exam_res ponse_elem ent = a_ne w_exam_res ponse_elem ent | |
| 188 | th e_exam_res ponse_elem ent << a_n ew_documen t_type_ver sion_eleme nt('4.0') | |
| 189 | th e_exam_res ponse_elem ent << a_n ew_claim_i d_element( the_evalua tion.claim . vbms_cla im_id) | |
| 190 | # create a c ommon-data element f or the cur rent fact group and add it to the exam-r esponse el ement | |
| 191 | th e_exam_res ponse_elem ent << a_n ew_common_ data_eleme nt( the_fr amework_to _use ) | |
| 192 | # create a f act block for the cu rrent fact group | |
| 193 | th e_fact_blo ck = a_new _evaluatio n_data_ele ment() | |
| 194 | # for each d iagnoses i n the curr ent fact g roup | |
| 195 | th e_framewor k_to_use[: diagnoses] .each do | the_diagno sis_to_use | | |
| 196 | ||
| 197 | # create a fact el ement | |
| 198 | the_fact_e lement = a _new_fact_ element(th e_framewor k_to_use[: fact_group ].namespac e, the_fra mework_to_ use[:fact_ group].fac t_block_ta g_name) | |
| 199 | # create a diagnos is element and add i t to the f act elemen t | |
| 200 | the_fact_e lement << a_new_diag nosis_elem ent(the_fr amework_to _use[:fact _group].na mespace, | |
| 201 | the_fr amework_to _use[:fact _group].di agnosis_ta g_name, | |
| 202 | the_fr amework_to _use[:fact _group].di agnosis_st ring_for(t he_diagnos is_to_use[ :diagnosti c_code]) ) | |
| 203 | # create the sympt om element s and add them to th e fact ele ment | |
| 204 | the_diagno sis_to_use [:associat ed_symptom s].each do |the_symp tom_to_use | | |
| 205 | #binding.p ry #cs | |
| 206 | the_fact _element < < a_new_sy mptom_elem ent(the_fr amework_to _use[:fact _group].na mespace, | |
| 207 | the_fr amework_to _use[:fact _group].sy mptom_tag_ name, | |
| 208 | the_fr amework_to _use[:fact _group].sy mptom_stri ng_for(the _symptom_t o_use[:sym ptom_strin g]) ) | |
| 209 | end | |
| 210 | # create the diagn osis-modif ier elemen ts and add them to t he fact el ement TBD | |
| 211 | #binding.p ry #cs | |
| 212 | the_diagno sis_to_use [:diagnosi s_modifier s].each do |the_diag nosis_modi fier_to_us e| | |
| 213 | the_fact _element < < a_new_di agnosis_mo difier_ele ment( the_ framework_ to_use[:fa ct_group]. namespace, | |
| 214 | the_ diagnosis_ modifier_t o_use ) | |
| 215 | end | |
| 216 | # add th e addition al fields for the fa ct group t o the fact element | |
| 217 | the_additi onal_field s_hash = e val(the_fr amework_to _use[:fact _group].ad ditional_f ields) | |
| 218 | the_additi onal_field s_hash.eac h do |the_ field_name , the_fiel d_value| | |
| 219 | #binding.p ry #cs | |
| 220 | the_fact _element < < XmlGener ationUtili ties.new_n ode_with_a _value( th e_framewor k_to_use[: fact_group ].namespac e, | |
| 221 | th e_field_na me, | |
| 222 | th e_field_va lue ) | |
| 223 | end | |
| 224 | ||
| 225 | # add th e fact ele ment to th e fact blo ck for the fact grou p | |
| 226 | the_fact_b lock << th e_fact_ele ment | |
| 227 | # end for | |
| 228 | en d | |
| 229 | # add the fa ct block f or the cur rent fact group to t he exam-re sponse ele ment | |
| 230 | th e_exam_res ponse_elem ent << the _fact_bloc k | |
| 231 | # create an attachment element f or the cur rent fact group and add it to the exam-r esponse el ement | |
| 232 | th e_exam_res ponse_elem ent << a_n ew_attachm ents_eleme nt(the_eva luation) | |
| 233 | # add the ex am-respons e element to the lis t of exam- response e lements | |
| 234 | th e_list_of_ exam_respo nse_elemen ts << the_ exam_respo nse_elemen t | |
| 235 | # en d if | |
| 236 | end | |
| 237 | # end go | |
| 238 | end | |
| 239 | ||
| 240 | # the_a ggregate_x ml_string = '<bogus> bogus</bog us>' | |
| 241 | ||
| 242 | #the_a ggregate_x ml_array = Array.new | |
| 243 | # the_a ggregate_x ml_string = "" | |
| 244 | ||
| 245 | the_ag gregate_ex am_respons e_document s = Array. new | |
| 246 | ||
| 247 | the_li st_of_exam _response_ elements.e ach do |en try| | |
| 248 | the_ aggregate_ exam_respo nse_docume nts << ent ry.to_xml | |
| 249 | # th e_aggregat e_xml_stri ng = the_a ggregate_x ml_string + entry.to _xml | |
| 250 | ||
| 251 | end | |
| 252 | ||
| 253 | # FIX_ ME : TBD: Find requi rements fo r actual E xamRespons e envelope : cs 2016 -12-12 The re are non e; they sh ould be se nt separat ely | |
| 254 | # the_a ggregate_x ml_string = "<ExamRe sponses>" + the_aggr egate_xml_ string + " </ExamResp onses>" | |
| 255 | ||
| 256 | #the_a ggregate_x ml_string = the_list _of_exam_r esponse_el ements.fir st.to_xml #cs TEMP | |
| 257 | # go t hrough the list of e xam-respon se element s, collect ing | |
| 258 | # ad d the xml string fro m the curr ent exam-r esponse el ement to t he collect ion | |
| 259 | # end go | |
| 260 | # retu rn the agg regate xml string | |
| 261 | #binding.p ry #cs | |
| 262 | ||
| 263 | return the_aggre gate_exam_ response_d ocuments | |
| 264 | ||
| 265 | # retur n the_aggr egate_xml_ string | |
| 266 | end | |
| 267 | ||
| 268 | ||
| 269 | private | |
| 270 | ||
| 271 | THE_LIST _OF_NAMESP ACE_ATTRIB UTES = { 'xmlns:xsi ' => 'http://ww w.w3.org/2 001/XMLSch ema-instan ce', | |
| 272 | 'xmlns:vle r' => 'http://va .gov/vler/ schemas/vl erSuperset Schema/0.9 /vler', | |
| 273 | 'xmlns:s' => 'http://ni em.gov/nie m/structur es/2.0', | |
| 274 | 'xmlns:nc' => 'http://ni em.gov/nie m/niem-cor e/2.0', | |
| 275 | 'xmlns:cld ' => 'http:// URL /vler/sche mas/benefi ts/ExamRes ponse/4.0' , | |
| 276 | 'xmlns:bsf ' => 'http:// URL /vler/sche mas/benefi ts/evaluat ion/facts/ BodySystem sFacts/1.1 ', | |
| 277 | 'xmlns:amp f' => 'http:// URL /vler/sche mas/benefi ts/evaluat ion/facts/ Amputation Facts/1.2' , | |
| 278 | 'xmlns:ank f' => 'http:// URL /vler/sche mas/benefi ts/evaluat ion/facts/ AnkleFacts /1.2', | |
| 279 | 'xmlns:aca lcf' => 'http:// URL /vler/sche mas/benefi ts/evaluat ion/facts/ Audiometri csCalcForm /1.1', | |
| 280 | 'xmlns:aaf ' => 'http:// URL /vler/sche mas/benefi ts/evaluat ion/facts/ AuditoryAc uityFacts/ 1.1', | |
| 281 | 'xmlns:cvf ' => 'http:// URL /vler/sche mas/benefi ts/evaluat ion/facts/ Cardiovasc ularFacts/ 1.2', | |
| 282 | 'xmlns:cbs f' => 'http:// URL /vler/sche mas/benefi ts/evaluat ion/facts/ CommonBody SystemFact s/2.0', | |
| 283 | 'xmlns:den tf' => 'http:// URL /vler/sche mas/benefi ts/evaluat ion/facts/ DentalFact s/1.1', | |
| 284 | 'xmlns:dig f' => 'http:// URL /vler/sche mas/benefi ts/evaluat ion/facts/ DigestiveF acts/1.2', | |
| 285 | 'xmlns:eat df' => 'http:// URL /vler/sche mas/benefi ts/evaluat ion/facts/ EatingDiso rderFacts/ 1.1', | |
| 286 | 'xmlns:elb f' => 'http:// URL /vler/sche mas/benefi ts/evaluat ion/facts/ ElbowFacts /1.3', | |
| 287 | 'xmlns:end f' => 'http:// URL /vler/sche mas/benefi ts/evaluat ion/facts/ EndocrineF acts/1.2', | |
| 288 | 'xmlns:eye f' => 'http:// URL /vler/sche mas/benefi ts/evaluat ion/facts/ EyeFacts/1 .1', | |
| 289 | 'xmlns:guf ' => 'http:// URL /vler/sche mas/benefi ts/evaluat ion/facts/ Genitourin aryFacts/1 .2', | |
| 290 | 'xmlns:gyf ' => 'http:// URL /vler/sche mas/benefi ts/evaluat ion/facts/ Gynecologi calFacts/1 .1', | |
| 291 | 'xmlns:hf' => 'http:// URL /vler/sche mas/benefi ts/evaluat ion/facts/ HandFacts/ 1.1', | |
| 292 | 'xmlns:hfn sfl' => 'http:// URL /vler/sche mas/benefi ts/evaluat ion/facts/ HeadFaceNe ckScarFact sList/1.2' , | |
| 293 | 'xmlns:hl' => 'http:// URL /vler/sche mas/benefi ts/evaluat ion/facts/ HearingLos s/1.2', | |
| 294 | 'xmlns:hlf ' => 'http:// URL /vler/sche mas/benefi ts/evaluat ion/facts/ HemicLymph aticFacts/ 1.1', | |
| 295 | 'xmlns:hif ' => 'http:// URL /vler/sche mas/benefi ts/evaluat ion/facts/ HipFacts/1 .3', | |
| 296 | 'xmlns:kf' => 'http:// URL /vler/sche mas/benefi ts/evaluat ion/facts/ KneeFacts/ 1.2', | |
| 297 | 'xmlns:mdf ' => 'http:// URL /vler/sche mas/benefi ts/evaluat ion/facts/ MentalDiso rderFacts/ 1.1.1', | |
| 298 | 'xmlns:mf' => 'http:// URL /vler/sche mas/benefi ts/evaluat ion/facts/ MuscleFact s/1.1', | |
| 299 | 'xmlns:mso f' => 'http:// URL /vler/sche mas/benefi ts/evaluat ion/facts/ Musculoske letalOther Facts/1.3' , | |
| 300 | 'xmlns:nnf l' => 'http:// URL /vler/sche mas/benefi ts/evaluat ion/facts/ Neurologic alNervesFa ctsList/1. 1', | |
| 301 | 'xmlns:nof ' => 'http:// URL /vler/sche mas/benefi ts/evaluat ion/facts/ Neurologic alOtherFac ts/1.1', | |
| 302 | 'xmlns:ntb if' => 'http:// URL /vler/sche mas/benefi ts/evaluat ion/facts/ Neurologic alTBIFacts /1.1', | |
| 303 | 'xmlns:rf' => 'http:// URL /vler/sche mas/benefi ts/evaluat ion/facts/ Respirator yFacts/1.1 ', | |
| 304 | 'xmlns:set fl' => 'http:// URL /vler/sche mas/benefi ts/evaluat ion/facts/ ScarExtrem itiesTrunk FactsList/ 1.2', | |
| 305 | 'xmlns:shf ' => 'http:// URL /vler/sche mas/benefi ts/evaluat ion/facts/ ShoulderFa cts/1.3', | |
| 306 | 'xmlns:skf ' => 'http:// URL /vler/sche mas/benefi ts/evaluat ion/facts/ SkinFacts/ 1.1', | |
| 307 | 'xmlns:spf ' => 'http:// URL /vler/sche mas/benefi ts/evaluat ion/facts/ SpineFacts /1.3', | |
| 308 | 'xmlns:tbi f' => 'http:// URL /vler/sche mas/benefi ts/evaluat ion/facts/ TBIFacets/ 1.0', | |
| 309 | 'xmlns:wf' => 'http:// URL /vler/sche mas/benefi ts/evaluat ion/facts/ WristFacts /1.3' } | |
| 310 | ||
| 311 | def a_ne w_diagnosi s_modifier _element(t he_namespa ce,the_dia gnosis_mod ifier_fiel d_info) | |
| 312 | #binding.p ry #cs | |
| 313 | the_ou ter_node = nil | |
| 314 | the_in nermost_no de = nil | |
| 315 | the_di agnosis_mo difier_fie ld_info[:d iagnosis_m odifier_fi elds].each do |the_f ield_to_ad d| | |
| 316 | the_ innermost_ node = Xml Generation Utilities. new_node(t he_namespa ce, the_fi eld_to_add ) | |
| 317 | if ( the_outer_ node.nil?) | |
| 318 | th e_outer_no de = the_i nnermost_n ode | |
| 319 | else | |
| 320 | th e_outer_no de << the_ innermost_ node | |
| 321 | end | |
| 322 | end | |
| 323 | the_in nermost_no de.content =the_diag nosis_modi fier_field _info[:dia gnosis_mod ifier_stri ng] | |
| 324 | #binding. pry #cs | |
| 325 | return the_outer _node | |
| 326 | # retur n XmlGener ationUtili ties.new_n ode_with_a _value(the _namespace , the_diag nosis_modi fier_field _info[:dia gnosis_mod ifier_fiel d], the_di agnosis_mo difier_fie ld_info[:d iagnosis_m odifier_st ring] ) | |
| 327 | end | |
| 328 | ||
| 329 | def a_ne w_symptom_ element(th e_namespac e, the_tag _name, the _value) | |
| 330 | the_ne w_symptom_ element = XmlGenerat ionUtiliti es.new_nod e(the_name space, the _tag_name) | |
| 331 | the_ne w_value_el ement = Xm lGeneratio nUtilities .new_node( the_namesp ace, 'valu e') | |
| 332 | the_ne w_value_el ement.cont ent=the_va lue | |
| 333 | the_ne w_symptom_ element << the_new_v alue_eleme nt | |
| 334 | return the_new_s ymptom_ele ment | |
| 335 | end | |
| 336 | ||
| 337 | def a_ne w_diagnosi s_element( the_namesp ace, the_t ag_name, t he_value) | |
| 338 | the_ne w_diagnosi s_element = XmlGener ationUtili ties.new_n ode(the_na mespace, t he_tag_nam e) | |
| 339 | the_ne w_value_el ement = Xm lGeneratio nUtilities .new_node( the_namesp ace, 'valu e') | |
| 340 | the_ne w_value_el ement.cont ent=the_va lue | |
| 341 | the_ne w_diagnosi s_element << the_new _value_ele ment | |
| 342 | return the_new_d iagnosis_e lement | |
| 343 | end | |
| 344 | ||
| 345 | def a_ne w_fact_ele ment(the_n amespace, the_tag_na me) | |
| 346 | the_ne w_element = XmlGener ationUtili ties.new_n ode(the_na mespace, t he_tag_nam e) | |
| 347 | return the_new_e lement | |
| 348 | end | |
| 349 | ||
| 350 | ||
| 351 | ||
| 352 | def a_ne w_common_d ata_elemen t( the_fra mework ) | |
| 353 | the_do cument_typ e_element_ values = | |
| 354 | { | |
| 355 | crea tion_date: {date: ' 2016-10-26 ', margin_ of_error: 'P0Y0M0DT0 H0M0S'}, | |
| 356 | desc ription: {string: 'Full-Bod y Examinat ion', part ial_indica tor: false }, # trunc ation_indi cator(o): <Ruby bool ean>} | |
| 357 | effe ctive_date : {date: ' 2016-10-31 ', margin_ of_error: 'P0Y0M2DT0 H0M0S'}, | |
| 358 | iden tification : {id: 'bi g incompre hensible n umber', ju risdiction : {string: 'all'}}, # partial_ indicator( o): <Ruby boolean>, truncation _indicator (o): <Ruby boolean>} , | |
| 359 | rece ived_date: {date:'2 016-10-29' }, #margin _of_error( o): <strin g, PnYnMnD TnHnMnS>}, | |
| 360 | stat us: | |
| 361 | { | |
| 362 | st atus: {string: 'active'}, # partial _indicator (o): <Ruby boolean>, truncatio n_indicato r(o): <Rub y boolean> }, | |
| 363 | da te: {date: '2 016-10-31' }, # margi n_of_error (o): <stri ng, PnYnMn DTnHnMnS>} , | |
| 364 | de scription: {string: 'Initial s ubmission' }, # parti al_indicat or(o): <Ru by boolean >, truncat ion_indica tor(o): <R uby boolea n>}, | |
| 365 | is suer: {string: 'CUI Appli cation'}, # partial_ indicator( o): <Ruby boolean>, truncation _indicator (o): <Ruby boolean>} | |
| 366 | }, | |
| 367 | ||
| 368 | titl e: {string: the_frame work[:fact _group].do cument_tit le}, | |
| 369 | } | |
| 370 | ||
| 371 | the_fa cility_typ e_element_ values = | |
| 372 | { | |
| 373 | cont act_info: | |
| 374 | { | |
| 375 | me ans: 'TBD11' , | |
| 376 | en tity: 'TBD12' , | |
| 377 | en tity_descr iption: { strin g:'TBD13', partial_i ndicator: false, tru ncation_in dicator: f alse}, | |
| 378 | in formation_ descriptio n: { strin g:'TBD14', partial_i ndicator: true}, | |
| 379 | re sponder: | |
| 380 | { | |
| 381 | name: | |
| 382 | { | |
| 383 | first: {name: {te xt_info: { string: 'J ohn'}}}, | |
| 384 | middle: {name: {te xt_info: { string: 'J '}}, is_an _initial: true}, | |
| 385 | last: {name: {te xt_info: { string: 'J ingleheime r-Schmidt' }}, is_an_ initial: f alse}, | |
| 386 | suffix: {string: ' III'} | |
| 387 | } | |
| 388 | } | |
| 389 | }, | |
| 390 | loca tion: '123 Fou rth Street , Anytown, Somestate , USA, 975 31', | |
| 391 | is_c ommercial: true, | |
| 392 | cate gory: {string: 'TBD7', t runcation_ indicator: false}, | |
| 393 | name : {text_in fo: {strin g: 'TBD9'} , form_cod e: 'TBD8'} , | |
| 394 | iden tification : {id: 'TB D1', juris diction: { string: 'T BD2', part ial_indica tor: false , truncati on_indicat or: true} } | |
| 395 | } | |
| 396 | ||
| 397 | ||
| 398 | the_se rvice_prov ider_clien t_associat ion_type_e lement_val ues = | |
| 399 | { | |
| 400 | date _range: { starting : {date: ' 1212-12-12 '}, # marg in_of_erro r(o): <str ing, PnYnM nDTnHnMnS> }, | |
| 401 | ending: {date: ' 1960-03-15 '} }, # ma rgin_of_er ror(o): <s tring, PnY nMnDTnHnMn S>} }, | |
| 402 | prov ider: {id: 'The Provider I D', ref: ' The Provid er Referen ce', metad ata: 'The Provider M etadata'}, | |
| 403 | clie nt: {id: 'The Client ID' , ref: 'Th e Client R eference', metadata: 'The Clie nt Metadat a'}, | |
| 404 | is_a ctive: true | |
| 405 | } | |
| 406 | ||
| 407 | ||
| 408 | ||
| 409 | ||
| 410 | the_ne w_element = XmlGener ationUtili ties.new_n ode('cld', 'CommonDa ta') | |
| 411 | the_ne w_element << TheDocu mentTypeEl ementGener ator.new_d ocument_ty pe_element ('nc', 'Do cument', t he_documen t_type_ele ment_value s) | |
| 412 | the_ne w_element << a_new_e xam_detail _element(' vler', 'Ex amDetail') | |
| 413 | the_ne w_element << a_new_c lient_type _element(' vler', 'Cl ient') | |
| 414 | the_ne w_element << a_new_s ervice_pro vider_type _element(' vler', 'Se rviceProvi der') | |
| 415 | the_ne w_element << a_new_a pprover_ty pe_element ('vler', ' Approver') | |
| 416 | the_ne w_element << TheNiem CoreXmlEle mentGenera tor.new_pe rson_type_ element('n c', 'Perso n', { name : { last: {name: {te xt_info: { string: 'T BD CLINICI AN'}}}, su ffix: {str ing: 'MD'} }} ) #clin ician | |
| 417 | the_ne w_element << TheNiem CoreXmlEle mentGenera tor.new_pe rson_type_ element('n c', 'Perso n', { name : { last: {name: {te xt_info: { string: 'T BD VETERAN '}}}}} ) #vet eran | |
| 418 | the_ne w_element << TheFaci lityTypeEl ementGener ator.new_f acility_ty pe_element ('nc', 'Fa cility', t he_facilit y_type_ele ment_value s) | |
| 419 | the_ne w_element << TheVler XmlElement Generator. new_servic e_provider _client_as sociation_ type_eleme nt('vler', 'ServiceP roviderCli entAssocia tion', the _service_p rovider_cl ient_assoc iation_typ e_element_ values) | |
| 420 | return the_new_e lement | |
| 421 | end | |
| 422 | ||
| 423 | def a_ne w_service_ provider_c lient_asso ciation_ty pe_element (the_names pace, the_ tag_name, the_hash_o f_values=n il) #vler | |
| 424 | the_ne w_element = XmlGener ationUtili ties.new_n ode(the_na mespace, t he_tag_nam e) | |
| 425 | ||
| 426 | return the_new_e lement | |
| 427 | end | |
| 428 | ||
| 429 | ||
| 430 | ||
| 431 | def a_ne w_approver _type_elem ent(the_na mespace, t he_tag_nam e, the_has h_of_value s=nil) #vler | |
| 432 | the_ne w_element = XmlGener ationUtili ties.new_n ode(the_na mespace, t he_tag_nam e) | |
| 433 | ||
| 434 | return the_new_e lement | |
| 435 | end | |
| 436 | ||
| 437 | ||
| 438 | ||
| 439 | def a_ne w_service_ provider_t ype_elemen t(the_name space, the _tag_name, the_hash_ of_values= nil) #vler | |
| 440 | the_ne w_element = XmlGener ationUtili ties.new_n ode(the_na mespace, t he_tag_nam e) | |
| 441 | ||
| 442 | return the_new_e lement | |
| 443 | end | |
| 444 | ||
| 445 | ||
| 446 | ||
| 447 | def a_ne w_client_t ype_elemen t(the_name space, the _tag_name, the_hash_ of_values= nil) #vler | |
| 448 | the_ne w_element = XmlGener ationUtili ties.new_n ode(the_na mespace, t he_tag_nam e) | |
| 449 | ||
| 450 | return the_new_e lement | |
| 451 | end | |
| 452 | ||
| 453 | ||
| 454 | ||
| 455 | def a_ne w_exam_det ail_elemen t(the_name space, the _tag_name, the_hash_ of_values= nil) #vler | |
| 456 | the_ne w_element = XmlGener ationUtili ties.new_n ode(the_na mespace, t he_tag_nam e) | |
| 457 | ||
| 458 | return the_new_e lement | |
| 459 | end | |
| 460 | ||
| 461 | ||
| 462 | ||
| 463 | ||
| 464 | def a_ne w_person_t ype_elemen t(the_name space, the _tag_name, the_hash_ of_values= nil) #nc | |
| 465 | the_ne w_element = XmlGener ationUtili ties.new_n ode(the_na mespace, t he_tag_nam e) | |
| 466 | #cs = TheN iemCoreXml ElementGen erator.new _person_ty pe_element | |
| 467 | ||
| 468 | return the_new_e lement | |
| 469 | end | |
| 470 | ||
| 471 | def a_ne w_clinicia n_element( the_namesp ace, the_t ag_name) | |
| 472 | the_cl inician_va lues = {na me_info: { first_name : 'TBD1', last_name: 'TBD2'}} | |
| 473 | the_ne w_element = a_new_pe rson_type_ element(th e_namespac e, the_tag _name, the _clinician _values) | |
| 474 | return the_new_e lement | |
| 475 | end | |
| 476 | ||
| 477 | def a_ne w_veteran_ element(th e_namespac e, the_tag _name) | |
| 478 | the_cl inician_va lues = {na me_info: { first_name : 'TBD1', last_name: 'TBD2'}, date_of_bi rth: 'TBD3 ', social_ security_n umber: 'TB D4'} | |
| 479 | the_ne w_element = a_new_pe rson_type_ element(th e_namespac e, the_tag _name, the _clinician _values) | |
| 480 | return the_new_e lement | |
| 481 | end | |
| 482 | ||
| 483 | ||
| 484 | ||
| 485 | def a_ne w_document _type_elem ent(the_na mespace, t he_tag_nam e) #nc | |
| 486 | the_ne w_element = XmlGener ationUtili ties.new_n ode(the_na mespace, t he_tag_nam e) | |
| 487 | # <xsd:elem ent ref="n c:Document CreationDa te" minOcc urs="0" ma xOccurs="5 000"/> | |
| 488 | # <xsd:elem ent ref="n c:Document Descriptio nText" min Occurs="0" maxOccurs ="5000"/> | |
| 489 | # <xsd:elem ent ref="n c:Document EffectiveD ate" minOc curs="0" m axOccurs=" 5000"/> | |
| 490 | # <xsd:elem ent ref="n c:Document Identifica tion" minO ccurs="0" maxOccurs= "5000"/> | |
| 491 | # <xsd:elem ent ref="n c:Document ReceivedDa te" minOcc urs="0" ma xOccurs="5 000"/> | |
| 492 | # <xsd:elem ent ref="n c:Document Status" mi nOccurs="0 " maxOccur s="5000"/> | |
| 493 | # <xsd:elem ent ref="n c:Document TitleText" minOccurs ="0" maxOc curs="5000 "/> | |
| 494 | return the_new_e lement | |
| 495 | end | |
| 496 | ||
| 497 | def a_ne w_evaluati on_data_el ement() | |
| 498 | the_ne w_element = XmlGener ationUtili ties.new_n ode('cld', 'Evaluati onData') | |
| 499 | return the_new_e lement | |
| 500 | end | |
| 501 | ||
| 502 | def a_ne w_attachme nts_elemen t(the_eval uation_to_ use) | |
| 503 | the_ne w_element = XmlGener ationUtili ties.new_n ode('cld', 'Attachme nts') | |
| 504 | the_ne w_element << a_new_p df_attache d_document _node_cont aining(the _evaluatio n_to_use) | |
| 505 | the_ne w_element << a_new_t ext_attach ed_documen t_node_con taining(th e_evaluati on_to_use) | |
| 506 | return the_new_e lement | |
| 507 | end | |
| 508 | ||
| 509 | def a_ne w_pdf_atta ched_docum ent_node_c ontaining( the_evalua tion_to_us e) | |
| 510 | return a_new_att ached_docu ment_node_ based_on(' nc', 'Atta chment', t he_evaluat ion_to_use .to_pdf, t he_evaluat ion_to_use .pdf_file_ name, "app lication/p df" ) # the_new_e lement << create_att achment(th e_evaluati on_to_use. to_pdf, th e_evalauti on_to_use. pdf_path, "applicat ion/pdf") | |
| 511 | end | |
| 512 | ||
| 513 | def a_ne w_text_att ached_docu ment_node_ containing (the_evalu ation_to_u se) | |
| 514 | return a_new_att ached_docu ment_node_ based_on(' nc', 'Atta chment', t he_evaluat ion_to_use .to_text, the_evalua tion_to_us e.text_fil e_name, "t ext/plain" ) | |
| 515 | end | |
| 516 | ||
| 517 | def a_ne w_attached _document_ node_based _on(the_na mespace, t he_tag_nam e, the_con tent, the_ file_name, the_file_ format) | |
| 518 | the_at tached_doc ument_elem ent = XmlG enerationU tilities.n ew_node(th e_namespac e, the_tag _name) | |
| 519 | #binding.p ry #cs | |
| 520 | the_at tached_doc ument_elem ent << a_n ew_binary_ base64_obj ect_node(t he_namespa ce, 'Binar yBase64Obj ect', the_ content) | |
| 521 | the_at tached_doc ument_elem ent << a_n ew_binary_ location_u ri_node(th e_namespac e, 'Binary FormatStan dardName', the_file_ name) | |
| 522 | the_at tached_doc ument_elem ent << a_n ew_binary_ format_nod e(the_name space, 'Bi naryFormat StandardNa me', the_f ile_format ) | |
| 523 | return the_attac hed_docume nt_element | |
| 524 | end | |
| 525 | ||
| 526 | def a_ne w_binary_b ase64_obje ct_node(th e_namespac e, the_tag _name, the _content_t o_encode) | |
| 527 | the_ne w_element = XmlGener ationUtili ties.new_n ode(the_na mespace, t he_tag_nam e) | |
| 528 | the_ne w_element. content = Base64.enc ode64(the_ content_to _encode) | |
| 529 | return the_new_e lement | |
| 530 | end | |
| 531 | ||
| 532 | def a_ne w_binary_l ocation_ur i_node(the _namespace , the_tag_ name, the_ uri) | |
| 533 | the_ne w_element = XmlGener ationUtili ties.new_n ode(the_na mespace, t he_tag_nam e) | |
| 534 | the_ne w_element. content = the_uri | |
| 535 | return the_new_e lement | |
| 536 | end | |
| 537 | ||
| 538 | def a_ne w_binary_f ormat_node (the_names pace, the_ tag_name, the_format ) | |
| 539 | the_ne w_element = XmlGener ationUtili ties.new_n ode(the_na mespace, t he_tag_nam e) | |
| 540 | the_ne w_element. content = the_format | |
| 541 | return the_new_e lement | |
| 542 | end | |
| 543 | ||
| 544 | ||
| 545 | def a_ne w_claim_id _element(t he_claim_i d) | |
| 546 | the_ne w_element = XmlGener ationUtili ties.new_n ode('cld', 'ClaimID' ) | |
| 547 | the_ne w_element. content=th e_claim_id | |
| 548 | return the_new_e lement | |
| 549 | end | |
| 550 | ||
| 551 | def a_ne w_document _type_vers ion_elemen t(the_vers ion_string ) | |
| 552 | the_ne w_element = XmlGener ationUtili ties.new_n ode('cld', 'Document TypeVersio n') | |
| 553 | the_ne w_element. content=th e_version_ string | |
| 554 | return the_new_e lement | |
| 555 | end | |
| 556 | ||
| 557 | def a_ne w_exam_res ponse_elem ent | |
| 558 | the_ne w_element = XmlGener ationUtili ties.new_n ode('cld', 'ExamResp onse') | |
| 559 | THE_LI ST_OF_NAME SPACE_ATTR IBUTES.eac h do |the_ namespace_ id, the_na mespace_ur i| | |
| 560 | the_ new_elemen t.set_attr ibute(the_ namespace_ id, the_na mespace_ur i) | |
| 561 | end | |
| 562 | # the_n ew_element .set_attri bute('xmln s:xsi','"h ttp://www. w3.org/200 1/XMLSchem a-instance "') | |
| 563 | return the_new_e lement | |
| 564 | end | |
| 565 | ||
| 566 | ## def a_ new_xml_no de(the_nam espace, th e_node_nam e, the_doc ument=Noko giri::XML: :Document. new) | |
| 567 | #### th e_new_node = Nokogir i::XML::No de.new("#{ the_namesp ace}:#{the _node_name }", the_do cument) | |
| 568 | ## the_ new_node = Nokogiri: :XML::Node .new(the_n amespace + ':' + the _node_name , the_docu ment) | |
| 569 | ## retu rn the_new _node | |
| 570 | ## end | |
| 571 | ||
| 572 | def a_ne w_body_fac ts_node(th e_node_nam e, the_doc ument=docu ment) | |
| 573 | return XmlGenera tionUtilit ies.new_no de('cld', the_node_n ame, the_d ocument) | |
| 574 | end | |
| 575 | ||
| 576 | def add_ a_child_at _the_begin ning_of_a_ node(the_p arent_node , the_node _to_add) | |
| 577 | the_pa rent_node. prepend_ch ild(the_no de_to_add) | |
| 578 | end | |
| 579 | ||
| 580 | ||
| 581 | end |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.