Skip to content

Commit

Permalink
Merge branch 'hotfix/3.1.7'
Browse files Browse the repository at this point in the history
  • Loading branch information
xispa committed Jun 8, 2015
2 parents 5cb2d3a + 4b8db10 commit 5a414b6
Show file tree
Hide file tree
Showing 51 changed files with 2,641 additions and 492 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Bika Health LIS

Bika Laboratory Information Management System customised for use in Health laboratories.

Last stable version: **v3.1.6** · released: 2015-02-27
Last stable version: **v3.1.7** · released: 2015-06-09

[**Naringenin**](http://en.wikipedia.org/wiki/Naringenin) is a flavanone, a typeof flavonoid, that is considered to have a bioactive effect on human health as antioxidant, free radical scavenger, anti-inflammatory, carbohydrate metabolism promoter, and immune system modulator. It is the predominant flavanone in grapefruit.

Expand All @@ -12,7 +12,7 @@ Installation and upgrades
Bika Health can be installed on Windows, Mac OS X, Linux, BSD and other platforms:
https://github.com/bikalabs/bika.health/wiki/Installing-Bika-Health-Extension

**Bika Health LIS 3.1.6 is only compatible with Bika LIMS 3.1.7**. Follow the instructions [Installing Bika Health Extension](https://github.com/bikalabs/bika.health/wiki/Installing-Bika-Health-Extension).
**Bika Health LIS 3.1.7 is only compatible with Bika LIMS 3.1.8**. Follow the instructions [Installing Bika Health Extension](https://github.com/bikalabs/bika.health/wiki/Installing-Bika-Health-Extension).

You might also find useful the following recipes:
- Installing Bika LIMS: https://github.com/bikalabs/Bika-LIMS/wiki/Bika-LIMS-Installation
Expand Down
2 changes: 2 additions & 0 deletions bika/health/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def initialize(context):
from content.aetiologicagent import AetiologicAgent
from content.caseoutcome import CaseOutcome
from content.casestatus import CaseStatus
from content.ethnicity import Ethnicity
from content.casesyndromicclassification import CaseSyndromicClassification
from content.disease import Disease
from content.doctor import Doctor
Expand Down Expand Up @@ -64,6 +65,7 @@ def initialize(context):
from controlpanel.bika_immunizations import Immunizations
from controlpanel.bika_treatments import Treatments
from controlpanel.bika_insurancecompanies import InsuranceCompanies
from controlpanel.bika_ethnicities import Ethnicities
from controlpanel.bika_vaccinationcenters import VaccinationCenters

content_types, constructors, ftis = process_types(
Expand Down
16 changes: 0 additions & 16 deletions bika/health/browser/admin.py

This file was deleted.

78 changes: 78 additions & 0 deletions bika/health/browser/analysisrequest/add.py
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

8 changes: 8 additions & 0 deletions bika/health/browser/analysisrequest/overrides.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,12 @@
permission="bika.lims.ManageInvoices"
layer="bika.lims.interfaces.IBikaLIMS"
/>

<browser:page
for="bika.lims.interfaces.IAnalysisRequest"
name="ar_add"
class="bika.health.browser.analysisrequest.add.AnalysisRequestAddView"
permission="bika.lims.ManageAnalysisRequests"
layer="bika.lims.interfaces.IBikaLIMS"
/>
</configure>
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>

Loading

0 comments on commit 5a414b6

Please sign in to comment.