-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
51 changed files
with
2,641 additions
and
492 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
from bika.lims.browser.analysisrequest.add import AnalysisRequestAddView as AnalysisRequestAddViewLIMS | ||
from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile | ||
import json | ||
from Products.CMFCore.utils import getToolByName | ||
from bika.lims.browser.widgets import AddressWidget | ||
|
||
|
||
class AnalysisRequestAddView(AnalysisRequestAddViewLIMS): | ||
""" | ||
The main AR Add form adapted for health usage | ||
""" | ||
health_template = ViewPageTemplateFile("templates/ar_add_health_standard.pt") | ||
patient_template = ViewPageTemplateFile("templates/ar_addpatient.pt") | ||
doctor_referrer_template = ViewPageTemplateFile("templates/ar_add_doctor_referrer.pt") | ||
insurance_template = ViewPageTemplateFile("templates/ar_insurance.pt") | ||
analyses_template = ViewPageTemplateFile("templates/ar_analyses.pt") | ||
prices_template = ViewPageTemplateFile("templates/ar_prices.pt") | ||
|
||
def __init__(self, context, request): | ||
AnalysisRequestAddViewLIMS.__init__(self, context, request) | ||
self.templatename = self.request.get('tpl','') | ||
self.w = AddressWidget() | ||
|
||
def __call__(self): | ||
if self.templatename == 'classic': | ||
return AnalysisRequestAddViewLIMS.__call__(self) | ||
|
||
# Getting the checkbox value | ||
enable_bika_request_field = self.context.bika_setup.Schema().getField('EnableBikaAnalysisRequestRequestForm') | ||
enable_bika_request = enable_bika_request_field.get(self.context.bika_setup) | ||
if enable_bika_request: | ||
# Use the template defined on BikaLIMS | ||
return AnalysisRequestAddViewLIMS.__call__(self) | ||
else: | ||
# Use the Health's template | ||
self.col_count = 1 | ||
self.request.set('disable_border', 1) | ||
return self.health_template() | ||
|
||
def get_json_format(self, d): | ||
""" | ||
Given some data, it gets its json format. | ||
:param d: Data to be formatted. | ||
:return: The formatted data in JSON. | ||
""" | ||
return json.dumps(d) | ||
|
||
def getDepartments(self): | ||
""" | ||
It obtains the different departments | ||
:return: A list with the department names and UID's [(UID,Name),....] | ||
""" | ||
dep = getToolByName(self.context, 'bika_setup_catalog')(portal_type='Department') | ||
l = [] | ||
for i in dep: | ||
l.append((i.UID, i.Title)) | ||
return l | ||
|
||
def categoryInDepartment(self, category, department): | ||
""" | ||
It checks if the category belongs to the department | ||
:param category: The category UID | ||
:param department: The department UID | ||
:return: True or False | ||
""" | ||
return getToolByName(self.context, 'bika_setup_catalog')(UID=category)[0]\ | ||
.getObject().getDepartment().UID() == department | ||
|
||
def getAvailableServices(self, categoryuid): | ||
""" Return a list of services brains | ||
""" | ||
bsc = getToolByName(self.context, 'bika_setup_catalog') | ||
services = bsc(portal_type="AnalysisService", | ||
sort_on='sortable_title', | ||
inactive_state='active', | ||
getCategoryUID=categoryuid) | ||
return services | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
bika/health/browser/analysisrequest/templates/ar_add_doctor_referrer.pt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<div class='content-block doctor-block'> | ||
|
||
<h2 i18n:translate="">Doctor and Referral Institution</h2> | ||
<!-- Referring doctor --> | ||
<div> | ||
<div class="field ArchetypesReferenceWidget " data-fieldname="Doctor" id="archetypes-fieldname-Doctor"> | ||
<label class="formQuestion" for="Doctor" i18n:translate="">Referring Doctor | ||
<span class="required" title="Required"> </span> | ||
</label> | ||
<span></span> | ||
<div class="fieldErrorBox"></div> | ||
<input type="text" | ||
name="ar.0.Doctor:record" | ||
id="ar_0_Doctor" | ||
class="blurrable firstToFocus referencewidget" | ||
size="20" | ||
minlength="0" | ||
search_query="{}" | ||
tal:attributes="base_query python:view.get_json_format({'portal_type': ['Doctor'], 'inactive_state': 'active'}); | ||
combogrid_options python:view.get_json_format({'colModel': [{'columnName': 'DoctorID', 'label': 'Doctor ID', 'width': '20'}, {'columnName': 'Title', 'label': 'Full Name', 'width': '80'}, {'columnName': 'UID', 'hidden': True}], 'minLength': '0', 'search_fields': ['Title'], 'sord': 'asc', 'discard_empty': [], 'searchIcon': True, 'sidx': 'Title', 'url': 'referencewidget_search', 'resetButton': False, 'width': '550px', 'showOn': True, 'force_all': True})" | ||
ui_item="Title" | ||
catalog_name="portal_catalog" | ||
resetbutton="False" | ||
maxlength="255" | ||
searchicon="True" | ||
showon="True" | ||
placeholder="" /> | ||
<input type="hidden" name="ar.0.Doctor_uid:record" id="ar_0_Doctor_uid" /></div> | ||
</div> | ||
<!-- This input will be fill out after a doctor has been chosen --> | ||
<div class='field'> | ||
<label class="formQuestion" for="DoctorsCode" i18n:translate="">Doctor's Code</label> | ||
<input type="text" id="DoctorsCode"/> | ||
</div> | ||
<!-- Copies to doctors --> | ||
<div id="archetypes-fieldname-CCDoctor" class="field ArchetypesStringWidget" data-fieldname="CCDoctor"> | ||
<span></span> | ||
<div class="fieldErrorBox"></div> | ||
<label class="formQuestion" for="CCDoctor" i18n:translate="">Copies to Doctors</label> | ||
<input type="text" | ||
name="ar.0.CCDoctor:record" | ||
id="ar_0_CCDoctor" | ||
class="blurrable firstToFocus referencewidget" | ||
size="20" | ||
minlength="0" | ||
search_query="{}" | ||
tal:attributes="base_query python:view.get_json_format({'portal_type': ['Doctor'], 'inactive_state': 'active'}); | ||
combogrid_options python:view.get_json_format({'colModel': [{'columnName': 'DoctorID', 'label': 'Doctor ID', 'width': '20'}, {'columnName': 'Title', 'label': 'Full Name', 'width': '80'}, {'columnName': 'UID', 'hidden': True}], 'minLength': '0', 'search_fields': ['Title'], 'sord': 'asc', 'discard_empty': [], 'searchIcon': True, 'sidx': 'Title', 'url': 'referencewidget_search', 'resetButton': False, 'width': '550px', 'showOn': True, 'force_all': True})" | ||
ui_item="Title" | ||
catalog_name="portal_catalog" | ||
resetbutton="False" | ||
maxlength="255" | ||
searchicon="True" | ||
showon="True" | ||
placeholder="" /> | ||
<input type="hidden" name="CCDoctor_uid" id="CCDoctor_uid" /> | ||
</div> | ||
|
||
<!-- Referral institution --> | ||
<div id="archetypes-fieldname-PrimaryReferrer" class="field ArchetypesSelectionWidget " data-fieldname="PrimaryReferrer"> | ||
<span></span> | ||
<div class="fieldErrorBox"></div> | ||
<label class="formQuestion" for="PrimaryReferrer">Hospital and Ward</label> | ||
<div class='readonly' tal:content="python:view.context.getClient().Name"/> | ||
</div> | ||
</div> | ||
|
Oops, something went wrong.