Advertisement
Guest User

Untitled

a guest
May 26th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.21 KB | None | 0 0
  1. # Run this with script runner: script/runner script/fake_concept [name] [id]
  2. User.current_user = User.find_by_username("admin")
  3. Location.current_location = Location.current_health_center
  4.  
  5. names = ["YES",
  6. "NO",
  7. "UNKNOWN",
  8. "CD4 COUNT",
  9. "CD4 COUNT DATETIME",
  10. "CD4 COUNT LOCATION",
  11. "CD4 COUNT LESS THAN 250",
  12. "CD4 COUNT LESS THAN 350",
  13. "CD4 PERCENT",
  14. "CD4 PERCENT LOCATION",
  15. "CD4 PERCENT DATETIME",
  16. "CD4 PERCENT LESS THAN 25",
  17. "WHO STAGE I ADULT AND PEDS",
  18. "WHO STAGE II ADULT AND PEDS",
  19. "WHO STAGE III ADULT AND PEDS",
  20. "WHO STAGE IV ADULT AND PEDS",
  21. "WHO STAGE I ADULT",
  22. "WHO STAGE II ADULT",
  23. "WHO STAGE III ADULT",
  24. "WHO STAGE IV ADULT",
  25. "WHO STAGE I PEDS",
  26. "WHO STAGE II PEDS",
  27. "WHO STAGE III PEDS",
  28. "WHO STAGE IV PEDS",
  29. "PNEUMOCYSTIS PNEUMONIA",
  30. "CANDIDIASIS, ESOPHAGEAL",
  31. "CRYPTOCOCCAL MENINGITIS",
  32. "SEVERE UNEXPLAINED WASTING OR MALNUTRITION NOT RESPONDING TO TREATMENT",
  33. "INFANT TOXOPLASMOSIS",
  34. "ORAL THRUSH",
  35. "SEPSIS, SEVERE",
  36. "PNEUMONIA, SEVERE",
  37. "FIRST POSITIVE HIV TEST TYPE",
  38. "HIV RAPID TEST, QUALITATIVE",
  39. "HIV DNA POLYMERASE CHAIN REACTION",
  40. "LYMPHOCYTE COUNT",
  41. "LYMPHOCYTE COUNT LOCATION",
  42. "LYMPHOCYTE COUNT DATETIME",
  43. "LYMPHOCYTE COUNT BELOW THRESHOLD WITH WHO STAGE 2",
  44. "WHO STAGES CRITERIA PRESENT",
  45. "PRESUMED SEVERE HIV CRITERIA PRESENT",
  46. "PRESUMED SEVERE HIV CRITERIA",
  47. "PRESUMED SEVERE HIV",
  48. "WHO STAGE",
  49. "REASON FOR ART ELIGIBILITY"]
  50.  
  51. names.each do |name|
  52. rec = ConceptName.find_by_name(name)
  53. unless rec
  54. puts "Creating concept '#{name}'"
  55. concept = Concept.create(:class_id => 1, :datatype_id => 2)
  56. concept_name = ConceptName.create(:name => name, :concept_id => concept.concept_id)
  57. end
  58. end
  59.  
  60.  
  61. concept = ConceptName.find_by_name("PRESUMED SEVERE HIV CRITERIA").concept
  62.  
  63. names = ["PNEUMOCYSTIS PNEUMONIA",
  64. "CANDIDIASIS, ESOPHAGEAL",
  65. "CRYPTOCOCCAL MENINGITIS",
  66. "SEVERE UNEXPLAINED WASTING OR MALNUTRITION NOT RESPONDING TO TREATMENT",
  67. "INFANT TOXOPLASMOSIS",
  68. "ORAL THRUSH",
  69. "SEPSIS, SEVERE",
  70. "PNEUMONIA, SEVERE"]
  71.  
  72. names.each do |name|
  73. concept_name = ConceptName.find_by_name(name)
  74. ConceptSet.create(:concept_set => concept.concept_id, :concept_id => concept_name.concept_id)
  75. end
  76.  
  77.  
  78. =begin
  79. STAGE 1
  80. ADULTS AND CHILDREN
  81. Asymptomatic
  82. Persistent generalized lymphadenopathy
  83. ADULTS ONLY (15 years or older)
  84. CHILDREN ONLY (14 years or younger)
  85.  
  86. STAGE 2
  87. ADULTS AND CHILDREN
  88. Respiratory tract infections, recurrent (sinusitis, tonsillitis, otitis media, pharyngitis)
  89. Herpes zoster
  90. Angular cheilitis
  91. Oral ulcerations, recurrent
  92. Papular pruritic eruptions/fungal nail infections
  93. ADULTS ONLY (15 years or older)
  94. Moderate weight loss <10%, unexplained
  95. Seborrhoeic dermatitis
  96. CHILDREN ONLY (14 years or younger)
  97. Hepatosplenomegaly, persistent unexplained
  98. Lineal gingival erythema
  99. Wart virus infection, extensive
  100. Molluscum contagiosum, extensive
  101. Parotid enlargement, persistent unexplained
  102.  
  103. STAGE 3
  104. ADULTS AND CHILDREN
  105. Fever, persistent unexplained (intermittent or constant, >1 month)
  106. Oral hairy leukoplakia
  107. Pulmonary tuberculosis (current)
  108. Pulmonary tuberculosis within the last 2 years
  109. Anaemia, unexplained < 8 g/dl
  110. Neutropaenia, unexplained < 500/mm3
  111. Thrombocytopaenia, chronic < 50,000/mm3
  112. ADULTS ONLY (15 years or older)
  113. Severe weight loss >10% and/or BMI <18.5kg/m2, unexplained
  114. Diarrhoea, chronic (>1 month) unexplained
  115. Oral candidiasis
  116. Severe bacterial infections (pneumonia, empyema, pyomyositis, bone/joint, meningitis, bacteraemia)
  117. Acute necrotizing ulcerative stomatitis, gingivitis or periodontitis
  118. CHILDREN ONLY (14 years or younger)
  119. Moderate unexplained wasting/malnutrition not responding to treatment (weight-for-height/weight-for-age 70-79% or MUAC 11-12cm)
  120. Diarrhoea, persistent unexplained (14 days or more)
  121. Oral candidiasis (from age 2 months)
  122. Acute necrotizing ulcerative gingivitis or periodontitis
  123. Lymph node tuberculosis
  124. Bacterial pneumonia, severe recurrent
  125. Symptomatic lymphoid interstitial pneumonitis
  126. Chronic HIV-associated lung disease including brochiectasis
  127.  
  128. STAGE 4
  129. ADULTS AND CHILDREN
  130. Pneumocystis pneumonia
  131. Candidiasis of oesophagus, trachea, bronchi or lungs
  132. Extrapulmonary tuberculosis
  133. Kaposi’s sarcoma
  134. HIV encephalopathy
  135. Cryptococcal meningitis or other Extrapulmonary cryptococcosis
  136. Disseminated non-tuberculous mycobacterial infection
  137. Cryptosporidiosis, chronic with diarrhoea
  138. Isosporiasis >1 month
  139. Disseminated mycosis (coccidiomycosis or histoplasmosis)
  140. Symptomatic HIV-associated nephropathy or cardiomyopathy
  141. Progressive multifocal leukoencephalopathy
  142. Cerebral or B-cell non-Hodgkin lymphoma
  143. ADULTS ONLY (15 years or older)
  144. HIV wasting syndrome (severe weight loss + persistent fever or severe loss + chronic diarrhoea)
  145. Bacterial pneumonia, recurrent severe
  146. Chronic herpes simplex infection (orolabial, genital/anorectal >1 month or visceral at any site)
  147. Cytomegalovirus infection (retinitis or infection of other organs)
  148. Toxoplasmosis of the brain
  149. Non-typhoidal Salmonella bacteraemia, recurrent
  150. Invasive cancer of cervix
  151. Leishmaniasis, atypical disseminated
  152. CHILDREN ONLY (14 years or younger)
  153. Severe unexplained wasting/malnutrition not responding to treatment (weight-for-height/weight-for-age <70% or MUAC <11cm or oedema)
  154. Bacterial infections, severe recurrent (empyema, pyomyositis, bone/joint, meningitis, but excluding pneumonia)
  155. Chronic herpes simplex infection (orolabial or cutaneous >1 month or visceral at any site)
  156. Cytomegalovirus infection: retinitis or other organ (from age 1 month)
  157. Toxoplasmosis of the brain (from age 1 month)
  158. Recto-vaginal fistula, HIV-associated
  159.  
  160.  
  161. PRESUMED SEVERE HIV IN INFANTS 0-17 MONTHS
  162. Positive antibody (rapid) test plus one or several of the following clinical conditions from the WHO staging list:
  163. Pneumocystis pneumonia
  164. Candidiasis of oesophagus
  165. Cryptococcal meningitis
  166. Severe unexplained wasting/malnutrition not responding to treatment (weight-for-height/weight-for-age <70% or MUAC <11cm or oedema)
  167. Toxoplasmosis of the brain (from age 1 month)
  168.  
  169. Positive antibody (rapid) test plus combination of at least 2 of the following:
  170. Oral thrush
  171. Sepsis, severe
  172. Pneumonia, severe
  173. =end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement