Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 
 
 

767 řádky
21 KiB

  1. import frappe
  2. from frappe import _
  3. from erpnext.setup.utils import insert_record
  4. data = {
  5. "desktop_icons": [
  6. "Patient",
  7. "Patient Appointment",
  8. "Patient Encounter",
  9. "Lab Test",
  10. "Healthcare",
  11. "Vital Signs",
  12. "Clinical Procedure",
  13. "Inpatient Record",
  14. "Accounts",
  15. "Buying",
  16. "Stock",
  17. "HR",
  18. "ToDo",
  19. ],
  20. "default_portal_role": "Patient",
  21. "restricted_roles": [
  22. "Healthcare Administrator",
  23. "LabTest Approver",
  24. "Laboratory User",
  25. "Nursing User",
  26. "Physician",
  27. "Patient",
  28. ],
  29. "custom_fields": {
  30. "Sales Invoice": [
  31. {
  32. "fieldname": "patient",
  33. "label": "Patient",
  34. "fieldtype": "Link",
  35. "options": "Patient",
  36. "insert_after": "naming_series",
  37. },
  38. {
  39. "fieldname": "patient_name",
  40. "label": "Patient Name",
  41. "fieldtype": "Data",
  42. "fetch_from": "patient.patient_name",
  43. "insert_after": "patient",
  44. "read_only": True,
  45. },
  46. {
  47. "fieldname": "ref_practitioner",
  48. "label": "Referring Practitioner",
  49. "fieldtype": "Link",
  50. "options": "Healthcare Practitioner",
  51. "insert_after": "customer",
  52. },
  53. ],
  54. "Sales Invoice Item": [
  55. {
  56. "fieldname": "reference_dt",
  57. "label": "Reference DocType",
  58. "fieldtype": "Link",
  59. "options": "DocType",
  60. "insert_after": "edit_references",
  61. },
  62. {
  63. "fieldname": "reference_dn",
  64. "label": "Reference Name",
  65. "fieldtype": "Dynamic Link",
  66. "options": "reference_dt",
  67. "insert_after": "reference_dt",
  68. },
  69. ],
  70. "Stock Entry": [
  71. {
  72. "fieldname": "inpatient_medication_entry",
  73. "label": "Inpatient Medication Entry",
  74. "fieldtype": "Link",
  75. "options": "Inpatient Medication Entry",
  76. "insert_after": "credit_note",
  77. "read_only": True,
  78. }
  79. ],
  80. "Stock Entry Detail": [
  81. {
  82. "fieldname": "patient",
  83. "label": "Patient",
  84. "fieldtype": "Link",
  85. "options": "Patient",
  86. "insert_after": "po_detail",
  87. "read_only": True,
  88. },
  89. {
  90. "fieldname": "inpatient_medication_entry_child",
  91. "label": "Inpatient Medication Entry Child",
  92. "fieldtype": "Data",
  93. "insert_after": "patient",
  94. "read_only": True,
  95. },
  96. ],
  97. },
  98. "on_setup": "healthcare.setup.setup_healthcare",
  99. }
  100. def setup_healthcare():
  101. if frappe.db.exists("Medical Department", "Cardiology"):
  102. # already setup
  103. return
  104. create_custom_records()
  105. create_default_root_service_units()
  106. def create_default_root_service_units():
  107. from healthcare.healthcare.utils import create_healthcare_service_unit_tree_root
  108. companies = frappe.get_all("Company")
  109. for company in companies:
  110. create_healthcare_service_unit_tree_root(company)
  111. def create_custom_records():
  112. create_medical_departments()
  113. create_antibiotics()
  114. create_lab_test_uom()
  115. create_duration()
  116. create_dosage()
  117. create_dosage_form()
  118. create_healthcare_item_groups()
  119. create_sensitivity()
  120. setup_patient_history_settings()
  121. has_domain = frappe.get_doc(
  122. {
  123. "doctype": "Has Domain",
  124. "parent": "Domain Settings",
  125. "parentfield": "active_domains",
  126. "parenttype": "Domain Settings",
  127. "domain": "Healthcare",
  128. }
  129. )
  130. has_domain.save()
  131. domain = frappe.get_doc("Domain", "Healthcare")
  132. domain.setup_domain()
  133. domain_settings = frappe.get_single("Domain Settings")
  134. domain_settings.append("active_domains", dict(domain=domain))
  135. frappe.clear_cache()
  136. def create_medical_departments():
  137. departments = [
  138. "Accident And Emergency Care",
  139. "Anaesthetics",
  140. "Biochemistry",
  141. "Cardiology",
  142. "Diabetology",
  143. "Dermatology",
  144. "Diagnostic Imaging",
  145. "ENT",
  146. "Gastroenterology",
  147. "General Surgery",
  148. "Gynaecology",
  149. "Haematology",
  150. "Maternity",
  151. "Microbiology",
  152. "Nephrology",
  153. "Neurology",
  154. "Oncology",
  155. "Orthopaedics",
  156. "Pathology",
  157. "Physiotherapy",
  158. "Rheumatology",
  159. "Serology",
  160. "Urology",
  161. ]
  162. for department in departments:
  163. mediacal_department = frappe.new_doc("Medical Department")
  164. mediacal_department.department = _(department)
  165. try:
  166. mediacal_department.save()
  167. except frappe.DuplicateEntryError:
  168. pass
  169. def create_antibiotics():
  170. abt = [
  171. "Amoxicillin",
  172. "Ampicillin",
  173. "Bacampicillin",
  174. "Carbenicillin",
  175. "Cloxacillin",
  176. "Dicloxacillin",
  177. "Flucloxacillin",
  178. "Mezlocillin",
  179. "Nafcillin",
  180. "Oxacillin",
  181. "Penicillin G",
  182. "Penicillin V",
  183. "Piperacillin",
  184. "Pivampicillin",
  185. "Pivmecillinam",
  186. "Ticarcillin",
  187. "Cefacetrile (cephacetrile)",
  188. "Cefadroxil (cefadroxyl)",
  189. "Cefalexin (cephalexin)",
  190. "Cefaloglycin (cephaloglycin)",
  191. "Cefalonium (cephalonium)",
  192. "Cefaloridine (cephaloradine)",
  193. "Cefalotin (cephalothin)",
  194. "Cefapirin (cephapirin)",
  195. "Cefatrizine",
  196. "Cefazaflur",
  197. "Cefazedone",
  198. "Cefazolin (cephazolin)",
  199. "Cefradine (cephradine)",
  200. "Cefroxadine",
  201. "Ceftezole",
  202. "Cefaclor",
  203. "Cefamandole",
  204. "Cefmetazole",
  205. "Cefonicid",
  206. "Cefotetan",
  207. "Cefoxitin",
  208. "Cefprozil (cefproxil)",
  209. "Cefuroxime",
  210. "Cefuzonam",
  211. "Cefcapene",
  212. "Cefdaloxime",
  213. "Cefdinir",
  214. "Cefditoren",
  215. "Cefetamet",
  216. "Cefixime",
  217. "Cefmenoxime",
  218. "Cefodizime",
  219. "Cefotaxime",
  220. "Cefpimizole",
  221. "Cefpodoxime",
  222. "Cefteram",
  223. "Ceftibuten",
  224. "Ceftiofur",
  225. "Ceftiolene",
  226. "Ceftizoxime",
  227. "Ceftriaxone",
  228. "Cefoperazone",
  229. "Ceftazidime",
  230. "Cefclidine",
  231. "Cefepime",
  232. "Cefluprenam",
  233. "Cefoselis",
  234. "Cefozopran",
  235. "Cefpirome",
  236. "Cefquinome",
  237. "Ceftobiprole",
  238. "Ceftaroline",
  239. "Cefaclomezine",
  240. "Cefaloram",
  241. "Cefaparole",
  242. "Cefcanel",
  243. "Cefedrolor",
  244. "Cefempidone",
  245. "Cefetrizole",
  246. "Cefivitril",
  247. "Cefmatilen",
  248. "Cefmepidium",
  249. "Cefovecin",
  250. "Cefoxazole",
  251. "Cefrotil",
  252. "Cefsumide",
  253. "Cefuracetime",
  254. "Ceftioxide",
  255. "Ceftazidime/Avibactam",
  256. "Ceftolozane/Tazobactam",
  257. "Aztreonam",
  258. "Imipenem",
  259. "Imipenem/cilastatin",
  260. "Doripenem",
  261. "Meropenem",
  262. "Ertapenem",
  263. "Azithromycin",
  264. "Erythromycin",
  265. "Clarithromycin",
  266. "Dirithromycin",
  267. "Roxithromycin",
  268. "Telithromycin",
  269. "Clindamycin",
  270. "Lincomycin",
  271. "Pristinamycin",
  272. "Quinupristin/dalfopristin",
  273. "Amikacin",
  274. "Gentamicin",
  275. "Kanamycin",
  276. "Neomycin",
  277. "Netilmicin",
  278. "Paromomycin",
  279. "Streptomycin",
  280. "Tobramycin",
  281. "Flumequine",
  282. "Nalidixic acid",
  283. "Oxolinic acid",
  284. "Piromidic acid",
  285. "Pipemidic acid",
  286. "Rosoxacin",
  287. "Ciprofloxacin",
  288. "Enoxacin",
  289. "Lomefloxacin",
  290. "Nadifloxacin",
  291. "Norfloxacin",
  292. "Ofloxacin",
  293. "Pefloxacin",
  294. "Rufloxacin",
  295. "Balofloxacin",
  296. "Gatifloxacin",
  297. "Grepafloxacin",
  298. "Levofloxacin",
  299. "Moxifloxacin",
  300. "Pazufloxacin",
  301. "Sparfloxacin",
  302. "Temafloxacin",
  303. "Tosufloxacin",
  304. "Besifloxacin",
  305. "Clinafloxacin",
  306. "Gemifloxacin",
  307. "Sitafloxacin",
  308. "Trovafloxacin",
  309. "Prulifloxacin",
  310. "Sulfamethizole",
  311. "Sulfamethoxazole",
  312. "Sulfisoxazole",
  313. "Trimethoprim-Sulfamethoxazole",
  314. "Demeclocycline",
  315. "Doxycycline",
  316. "Minocycline",
  317. "Oxytetracycline",
  318. "Tetracycline",
  319. "Tigecycline",
  320. "Chloramphenicol",
  321. "Metronidazole",
  322. "Tinidazole",
  323. "Nitrofurantoin",
  324. "Vancomycin",
  325. "Teicoplanin",
  326. "Telavancin",
  327. "Linezolid",
  328. "Cycloserine 2",
  329. "Rifampin",
  330. "Rifabutin",
  331. "Rifapentine",
  332. "Rifalazil",
  333. "Bacitracin",
  334. "Polymyxin B",
  335. "Viomycin",
  336. "Capreomycin",
  337. ]
  338. for a in abt:
  339. antibiotic = frappe.new_doc("Antibiotic")
  340. antibiotic.antibiotic_name = a
  341. try:
  342. antibiotic.save()
  343. except frappe.DuplicateEntryError:
  344. pass
  345. def create_lab_test_uom():
  346. records = [
  347. {"doctype": "Lab Test UOM", "name": "umol/L", "lab_test_uom": "umol/L", "uom_description": None},
  348. {"doctype": "Lab Test UOM", "name": "mg/L", "lab_test_uom": "mg/L", "uom_description": None},
  349. {
  350. "doctype": "Lab Test UOM",
  351. "name": "mg / dl",
  352. "lab_test_uom": "mg / dl",
  353. "uom_description": None,
  354. },
  355. {
  356. "doctype": "Lab Test UOM",
  357. "name": "pg / ml",
  358. "lab_test_uom": "pg / ml",
  359. "uom_description": None,
  360. },
  361. {"doctype": "Lab Test UOM", "name": "U/ml", "lab_test_uom": "U/ml", "uom_description": None},
  362. {"doctype": "Lab Test UOM", "name": "/HPF", "lab_test_uom": "/HPF", "uom_description": None},
  363. {
  364. "doctype": "Lab Test UOM",
  365. "name": "Million Cells / cumm",
  366. "lab_test_uom": "Million Cells / cumm",
  367. "uom_description": None,
  368. },
  369. {
  370. "doctype": "Lab Test UOM",
  371. "name": "Lakhs Cells / cumm",
  372. "lab_test_uom": "Lakhs Cells / cumm",
  373. "uom_description": None,
  374. },
  375. {"doctype": "Lab Test UOM", "name": "U / L", "lab_test_uom": "U / L", "uom_description": None},
  376. {"doctype": "Lab Test UOM", "name": "g / L", "lab_test_uom": "g / L", "uom_description": None},
  377. {
  378. "doctype": "Lab Test UOM",
  379. "name": "IU / ml",
  380. "lab_test_uom": "IU / ml",
  381. "uom_description": None,
  382. },
  383. {"doctype": "Lab Test UOM", "name": "gm %", "lab_test_uom": "gm %", "uom_description": None},
  384. {
  385. "doctype": "Lab Test UOM",
  386. "name": "Microgram",
  387. "lab_test_uom": "Microgram",
  388. "uom_description": None,
  389. },
  390. {"doctype": "Lab Test UOM", "name": "Micron", "lab_test_uom": "Micron", "uom_description": None},
  391. {
  392. "doctype": "Lab Test UOM",
  393. "name": "Cells / cumm",
  394. "lab_test_uom": "Cells / cumm",
  395. "uom_description": None,
  396. },
  397. {"doctype": "Lab Test UOM", "name": "%", "lab_test_uom": "%", "uom_description": None},
  398. {
  399. "doctype": "Lab Test UOM",
  400. "name": "mm / dl",
  401. "lab_test_uom": "mm / dl",
  402. "uom_description": None,
  403. },
  404. {
  405. "doctype": "Lab Test UOM",
  406. "name": "mm / hr",
  407. "lab_test_uom": "mm / hr",
  408. "uom_description": None,
  409. },
  410. {
  411. "doctype": "Lab Test UOM",
  412. "name": "ulU / ml",
  413. "lab_test_uom": "ulU / ml",
  414. "uom_description": None,
  415. },
  416. {
  417. "doctype": "Lab Test UOM",
  418. "name": "ng / ml",
  419. "lab_test_uom": "ng / ml",
  420. "uom_description": None,
  421. },
  422. {
  423. "doctype": "Lab Test UOM",
  424. "name": "ng / dl",
  425. "lab_test_uom": "ng / dl",
  426. "uom_description": None,
  427. },
  428. {
  429. "doctype": "Lab Test UOM",
  430. "name": "ug / dl",
  431. "lab_test_uom": "ug / dl",
  432. "uom_description": None,
  433. },
  434. ]
  435. insert_record(records)
  436. def create_duration():
  437. records = [
  438. {"doctype": "Prescription Duration", "name": "3 Month", "number": "3", "period": "Month"},
  439. {"doctype": "Prescription Duration", "name": "2 Month", "number": "2", "period": "Month"},
  440. {"doctype": "Prescription Duration", "name": "1 Month", "number": "1", "period": "Month"},
  441. {"doctype": "Prescription Duration", "name": "12 Hour", "number": "12", "period": "Hour"},
  442. {"doctype": "Prescription Duration", "name": "11 Hour", "number": "11", "period": "Hour"},
  443. {"doctype": "Prescription Duration", "name": "10 Hour", "number": "10", "period": "Hour"},
  444. {"doctype": "Prescription Duration", "name": "9 Hour", "number": "9", "period": "Hour"},
  445. {"doctype": "Prescription Duration", "name": "8 Hour", "number": "8", "period": "Hour"},
  446. {"doctype": "Prescription Duration", "name": "7 Hour", "number": "7", "period": "Hour"},
  447. {"doctype": "Prescription Duration", "name": "6 Hour", "number": "6", "period": "Hour"},
  448. {"doctype": "Prescription Duration", "name": "5 Hour", "number": "5", "period": "Hour"},
  449. {"doctype": "Prescription Duration", "name": "4 Hour", "number": "4", "period": "Hour"},
  450. {"doctype": "Prescription Duration", "name": "3 Hour", "number": "3", "period": "Hour"},
  451. {"doctype": "Prescription Duration", "name": "2 Hour", "number": "2", "period": "Hour"},
  452. {"doctype": "Prescription Duration", "name": "1 Hour", "number": "1", "period": "Hour"},
  453. {"doctype": "Prescription Duration", "name": "5 Week", "number": "5", "period": "Week"},
  454. {"doctype": "Prescription Duration", "name": "4 Week", "number": "4", "period": "Week"},
  455. {"doctype": "Prescription Duration", "name": "3 Week", "number": "3", "period": "Week"},
  456. {"doctype": "Prescription Duration", "name": "2 Week", "number": "2", "period": "Week"},
  457. {"doctype": "Prescription Duration", "name": "1 Week", "number": "1", "period": "Week"},
  458. {"doctype": "Prescription Duration", "name": "6 Day", "number": "6", "period": "Day"},
  459. {"doctype": "Prescription Duration", "name": "5 Day", "number": "5", "period": "Day"},
  460. {"doctype": "Prescription Duration", "name": "4 Day", "number": "4", "period": "Day"},
  461. {"doctype": "Prescription Duration", "name": "3 Day", "number": "3", "period": "Day"},
  462. {"doctype": "Prescription Duration", "name": "2 Day", "number": "2", "period": "Day"},
  463. {"doctype": "Prescription Duration", "name": "1 Day", "number": "1", "period": "Day"},
  464. ]
  465. insert_record(records)
  466. def create_dosage():
  467. records = [
  468. {
  469. "doctype": "Prescription Dosage",
  470. "name": "1-1-1-1",
  471. "dosage": "1-1-1-1",
  472. "dosage_strength": [
  473. {"strength": "1.0", "strength_time": "9:00:00"},
  474. {"strength": "1.0", "strength_time": "13:00:00"},
  475. {"strength": "1.0", "strength_time": "17:00:00"},
  476. {"strength": "1.0", "strength_time": "21:00:00"},
  477. ],
  478. },
  479. {
  480. "doctype": "Prescription Dosage",
  481. "name": "0-0-1",
  482. "dosage": "0-0-1",
  483. "dosage_strength": [{"strength": "1.0", "strength_time": "21:00:00"}],
  484. },
  485. {
  486. "doctype": "Prescription Dosage",
  487. "name": "1-0-0",
  488. "dosage": "1-0-0",
  489. "dosage_strength": [{"strength": "1.0", "strength_time": "9:00:00"}],
  490. },
  491. {
  492. "doctype": "Prescription Dosage",
  493. "name": "0-1-0",
  494. "dosage": "0-1-0",
  495. "dosage_strength": [{"strength": "1.0", "strength_time": "14:00:00"}],
  496. },
  497. {
  498. "doctype": "Prescription Dosage",
  499. "name": "1-1-1",
  500. "dosage": "1-1-1",
  501. "dosage_strength": [
  502. {"strength": "1.0", "strength_time": "9:00:00"},
  503. {"strength": "1.0", "strength_time": "14:00:00"},
  504. {"strength": "1.0", "strength_time": "21:00:00"},
  505. ],
  506. },
  507. {
  508. "doctype": "Prescription Dosage",
  509. "name": "1-0-1",
  510. "dosage": "1-0-1",
  511. "dosage_strength": [
  512. {"strength": "1.0", "strength_time": "9:00:00"},
  513. {"strength": "1.0", "strength_time": "21:00:00"},
  514. ],
  515. },
  516. {
  517. "doctype": "Prescription Dosage",
  518. "name": "Once Bedtime",
  519. "dosage": "Once Bedtime",
  520. "dosage_strength": [{"strength": "1.0", "strength_time": "21:00:00"}],
  521. },
  522. {
  523. "doctype": "Prescription Dosage",
  524. "name": "5 times a day",
  525. "dosage": "5 times a day",
  526. "dosage_strength": [
  527. {"strength": "1.0", "strength_time": "5:00:00"},
  528. {"strength": "1.0", "strength_time": "9:00:00"},
  529. {"strength": "1.0", "strength_time": "13:00:00"},
  530. {"strength": "1.0", "strength_time": "17:00:00"},
  531. {"strength": "1.0", "strength_time": "21:00:00"},
  532. ],
  533. },
  534. {
  535. "doctype": "Prescription Dosage",
  536. "name": "QID",
  537. "dosage": "QID",
  538. "dosage_strength": [
  539. {"strength": "1.0", "strength_time": "9:00:00"},
  540. {"strength": "1.0", "strength_time": "13:00:00"},
  541. {"strength": "1.0", "strength_time": "17:00:00"},
  542. {"strength": "1.0", "strength_time": "21:00:00"},
  543. ],
  544. },
  545. {
  546. "doctype": "Prescription Dosage",
  547. "name": "TID",
  548. "dosage": "TID",
  549. "dosage_strength": [
  550. {"strength": "1.0", "strength_time": "9:00:00"},
  551. {"strength": "1.0", "strength_time": "14:00:00"},
  552. {"strength": "1.0", "strength_time": "21:00:00"},
  553. ],
  554. },
  555. {
  556. "doctype": "Prescription Dosage",
  557. "name": "BID",
  558. "dosage": "BID",
  559. "dosage_strength": [
  560. {"strength": "1.0", "strength_time": "9:00:00"},
  561. {"strength": "1.0", "strength_time": "21:00:00"},
  562. ],
  563. },
  564. {
  565. "doctype": "Prescription Dosage",
  566. "name": "Once Daily",
  567. "dosage": "Once Daily",
  568. "dosage_strength": [{"strength": "1.0", "strength_time": "9:00:00"}],
  569. },
  570. ]
  571. insert_record(records)
  572. def create_dosage_form():
  573. records = [
  574. {
  575. "doctype": "Dosage Form",
  576. "dosage_form": "Tablet",
  577. },
  578. {
  579. "doctype": "Dosage Form",
  580. "dosage_form": "Syrup",
  581. },
  582. {
  583. "doctype": "Dosage Form",
  584. "dosage_form": "Injection",
  585. },
  586. {
  587. "doctype": "Dosage Form",
  588. "dosage_form": "Capsule",
  589. },
  590. {
  591. "doctype": "Dosage Form",
  592. "dosage_form": "Cream",
  593. },
  594. ]
  595. insert_record(records)
  596. def create_healthcare_item_groups():
  597. item_group = {
  598. "doctype": "Item Group",
  599. "item_group_name": _("All Item Groups"),
  600. "is_group": 0,
  601. "parent_item_group": "",
  602. }
  603. if not frappe.db.exists(item_group["doctype"], item_group["item_group_name"]):
  604. insert_record([item_group])
  605. records = [
  606. {
  607. "doctype": "Item Group",
  608. "item_group_name": _("Laboratory"),
  609. "is_group": 0,
  610. "parent_item_group": _("All Item Groups"),
  611. },
  612. {
  613. "doctype": "Item Group",
  614. "item_group_name": _("Drug"),
  615. "is_group": 0,
  616. "parent_item_group": _("All Item Groups"),
  617. },
  618. ]
  619. insert_record(records)
  620. def create_sensitivity():
  621. records = [
  622. {"doctype": "Sensitivity", "sensitivity": _("Low Sensitivity")},
  623. {"doctype": "Sensitivity", "sensitivity": _("High Sensitivity")},
  624. {"doctype": "Sensitivity", "sensitivity": _("Moderate Sensitivity")},
  625. {"doctype": "Sensitivity", "sensitivity": _("Susceptible")},
  626. {"doctype": "Sensitivity", "sensitivity": _("Resistant")},
  627. {"doctype": "Sensitivity", "sensitivity": _("Intermediate")},
  628. ]
  629. insert_record(records)
  630. def setup_patient_history_settings():
  631. import json
  632. settings = frappe.get_single("Patient History Settings")
  633. configuration = get_patient_history_config()
  634. for dt, config in configuration.items():
  635. settings.append(
  636. "standard_doctypes",
  637. {"document_type": dt, "date_fieldname": config[0], "selected_fields": json.dumps(config[1])},
  638. )
  639. settings.save()
  640. def get_patient_history_config():
  641. return {
  642. "Patient Encounter": (
  643. "encounter_date",
  644. [
  645. {"label": "Healthcare Practitioner", "fieldname": "practitioner", "fieldtype": "Link"},
  646. {"label": "Symptoms", "fieldname": "symptoms", "fieldtype": "Table Multiselect"},
  647. {"label": "Diagnosis", "fieldname": "diagnosis", "fieldtype": "Table Multiselect"},
  648. {"label": "Drug Prescription", "fieldname": "drug_prescription", "fieldtype": "Table"},
  649. {"label": "Lab Tests", "fieldname": "lab_test_prescription", "fieldtype": "Table"},
  650. {"label": "Clinical Procedures", "fieldname": "procedure_prescription", "fieldtype": "Table"},
  651. {"label": "Therapies", "fieldname": "therapies", "fieldtype": "Table"},
  652. {"label": "Review Details", "fieldname": "encounter_comment", "fieldtype": "Small Text"},
  653. ],
  654. ),
  655. "Clinical Procedure": (
  656. "start_date",
  657. [
  658. {"label": "Procedure Template", "fieldname": "procedure_template", "fieldtype": "Link"},
  659. {"label": "Healthcare Practitioner", "fieldname": "practitioner", "fieldtype": "Link"},
  660. {"label": "Notes", "fieldname": "notes", "fieldtype": "Small Text"},
  661. {"label": "Service Unit", "fieldname": "service_unit", "fieldtype": "Healthcare Service Unit"},
  662. {"label": "Start Time", "fieldname": "start_time", "fieldtype": "Time"},
  663. {"label": "Sample", "fieldname": "sample", "fieldtype": "Link"},
  664. ],
  665. ),
  666. "Lab Test": (
  667. "result_date",
  668. [
  669. {"label": "Test Template", "fieldname": "template", "fieldtype": "Link"},
  670. {"label": "Healthcare Practitioner", "fieldname": "practitioner", "fieldtype": "Link"},
  671. {"label": "Test Name", "fieldname": "lab_test_name", "fieldtype": "Data"},
  672. {"label": "Lab Technician Name", "fieldname": "employee_name", "fieldtype": "Data"},
  673. {"label": "Sample ID", "fieldname": "sample", "fieldtype": "Link"},
  674. {"label": "Normal Test Result", "fieldname": "normal_test_items", "fieldtype": "Table"},
  675. {
  676. "label": "Descriptive Test Result",
  677. "fieldname": "descriptive_test_items",
  678. "fieldtype": "Table",
  679. },
  680. {"label": "Organism Test Result", "fieldname": "organism_test_items", "fieldtype": "Table"},
  681. {
  682. "label": "Sensitivity Test Result",
  683. "fieldname": "sensitivity_test_items",
  684. "fieldtype": "Table",
  685. },
  686. {"label": "Comments", "fieldname": "lab_test_comment", "fieldtype": "Table"},
  687. ],
  688. ),
  689. "Therapy Session": (
  690. "start_date",
  691. [
  692. {"label": "Therapy Type", "fieldname": "therapy_type", "fieldtype": "Link"},
  693. {"label": "Healthcare Practitioner", "fieldname": "practitioner", "fieldtype": "Link"},
  694. {"label": "Therapy Plan", "fieldname": "therapy_plan", "fieldtype": "Link"},
  695. {"label": "Duration", "fieldname": "duration", "fieldtype": "Int"},
  696. {"label": "Location", "fieldname": "location", "fieldtype": "Link"},
  697. {"label": "Healthcare Service Unit", "fieldname": "service_unit", "fieldtype": "Link"},
  698. {"label": "Start Time", "fieldname": "start_time", "fieldtype": "Time"},
  699. {"label": "Exercises", "fieldname": "exercises", "fieldtype": "Table"},
  700. {"label": "Total Counts Targeted", "fieldname": "total_counts_targeted", "fieldtype": "Int"},
  701. {"label": "Total Counts Completed", "fieldname": "total_counts_completed", "fieldtype": "Int"},
  702. ],
  703. ),
  704. "Vital Signs": (
  705. "signs_date",
  706. [
  707. {"label": "Body Temperature", "fieldname": "temperature", "fieldtype": "Data"},
  708. {"label": "Heart Rate / Pulse", "fieldname": "pulse", "fieldtype": "Data"},
  709. {"label": "Respiratory rate", "fieldname": "respiratory_rate", "fieldtype": "Data"},
  710. {"label": "Tongue", "fieldname": "tongue", "fieldtype": "Select"},
  711. {"label": "Abdomen", "fieldname": "abdomen", "fieldtype": "Select"},
  712. {"label": "Reflexes", "fieldname": "reflexes", "fieldtype": "Select"},
  713. {"label": "Blood Pressure", "fieldname": "bp", "fieldtype": "Data"},
  714. {"label": "Notes", "fieldname": "vital_signs_note", "fieldtype": "Small Text"},
  715. {"label": "Height (In Meter)", "fieldname": "height", "fieldtype": "Float"},
  716. {"label": "Weight (In Kilogram)", "fieldname": "weight", "fieldtype": "Float"},
  717. {"label": "BMI", "fieldname": "bmi", "fieldtype": "Float"},
  718. ],
  719. ),
  720. "Inpatient Medication Order": (
  721. "start_date",
  722. [
  723. {"label": "Healthcare Practitioner", "fieldname": "practitioner", "fieldtype": "Link"},
  724. {"label": "Start Date", "fieldname": "start_date", "fieldtype": "Date"},
  725. {"label": "End Date", "fieldname": "end_date", "fieldtype": "Date"},
  726. {"label": "Medication Orders", "fieldname": "medication_orders", "fieldtype": "Table"},
  727. {"label": "Total Orders", "fieldname": "total_orders", "fieldtype": "Float"},
  728. ],
  729. ),
  730. }