World #Clubfoot Day is afoot ! – Free medical camp for children with Clubfoot


I’m organising a free medical camp on June 4th at Palakkad Cooperative Hospital, Palakkad, Kerala on World Clubfoot Day.

Please do spread the news so that anybody interested can seek care.

Attaching below is a poster in local language Malayalam.

Interested patients may contact hospital Reception on following phone numbers for registration :

+91 491 252 0391

+91 491 252 2805

+91 491 253 6293

Clubfoot medical camp

World clubfoot day free medical camp

Bracing and Orthotics for Clubfoot (CTEV)


Once clubfoot is corrected with Ponseti plaster application and tendoachilles tenotomy, it’s time to maintain the correction of foot till child is grown more and started walking well. There is risk of clubfoot recurring without proper bracing.

Recurrent clubfoot

Recurrent clubfoot without bracing

Types of braces

Steinbeck device, Iowa Brace and Dobbs Brace are commonly used clubfoot Foot Abduction Orthosis.

Dobbs brace in particular has the added advantage of providing extra mobility to the child potentially improving compliance. Comparatively it’s more expensive.

Compliance

In rural India it’s especially difficult to ensure compliance to orthosis for parents as many feel clubfoot treatment finishes with Ponseti casting. Social issues and sensitivity of going out of home with brace fitted is one of the issues that makes parent fall out. Some of them don’t spend enough time learning to put it on and take it off and give up once child starts crying. It’s an easy procedure that we teach aling with nurses and orthotists to help parents during initial days.

Steinbeck braces

Steinbeck bracing

Clubfoot Steinbeck braces

Fitting Steinbeck clubfoot brace

Foot inside Steinbeck clubfoot brace

Dobbs Bracing

Dobbs brace for Clubfoot

Dobbs brace allowing movement

Osteogenesis Imperfecta


Osteogenesis Imperfecta is a congenital disorder of bones that has varied types and presentations. Severity varies based on the type of the genetic mutation that causes this disorder.

Regardless of the type the genetic modification cause malformed and weak bones and in some cases malformed teeth. Bone bend and deform or break easily and heals in deformed position. This results in cosmetic deformity along with issues with walking , standing for the child.

The bend of the bone if significant can cause repeated fractures either due to poor handling by caretakers or when child tries to bear weight and stand up.

Fortunately for the milder variants there’s are medications to make bones stronger and surgery to straighten bent bones. This allows child with help of walking aids and/or splints to ambulate.

For the very severe variants unfortunately clinical breakthrough is still awaited.

Torticollis or Wry Neck in Children


#Torticollis or #WryNeck is a common complaint in #children.

Children will keep neck turned and/or tilted to one side. This can be a sudden occurrence especially after sore throat or upper airway infection, fall or maybe seen after difficult birth due to stretching and injury to the neck muscle (called Sternocleidomastoid .

While many are simple spam or contracture of neck muscle some torticollis as shown in the picture below could harbour problems like compression of #spinalcord by #neck bones which have gone off alignment. These problems in the structure of neck bones occur at birth and are due to a developmental error in the shape of the neck vertebra.

#ChildOrtho
#NeckPain
#PedOrtho

https://t.co/Nf8lSN2rTG

Cerebral Palsy Medical Camp at Shoranur, Kerala


A free medical camp for underpriviliged children suffering from Cerebral Palsy and Pediatric Orthopaedic disorders was organised by Dr. Easwar T.R and the administrative team at ICCONS, Shoranur, Kerala on 24th, May,2018.

A gamut of problems commonly seen in children with Cerebral Palsy was observed in OPD. While some parents had the good fortune of seeking medical care and intervention early in course of disease and others were not so fortunate. Lack of parental knowledge, distance / accessible care, financial cruch, normal siblings to care for and single parent challenges were the most important issues observed on casual data collection.

The medical camp was followed by an awareness class for parents, therapists and other care givers by Dr. Easwar T.R on the various aspects of Cerebral Palsy.

Custom wheel chair and mobility solutions for needy patients was discussed with Physiotherapists and low cost solutions for the same identified. Mobility solutions continue to be a major challenge for children in rural areas with poor roads, small homes with narrow doors and steps inside homes especially with outdoor toilets.

World Clubfoot Day on June 3rd


This 2018, on June 3rd, we at Palakkad District Co-operative Hospital and Research Centre are celebrating the World Clubfoot Day.

We are planning special Outpatient Clinics for children with Clubfoot disorder in and around Palakkad, Kerala.

Please find below the Malayalam Poster for the #ClubFoot Day

Screenshot from 2018-05-25 16-07-28.png

 

AuShadha2.0


For all those who were following AuShadha Open Source EMR project hosted at GitHub there’s news. 

I had paused developing for sometime due to pressure of time. 

The development has restarted for past few months (no commits ) and am planning to branch of development into AuShadha2.0 with changes to the core, Dojo 1.12 JavaScript library, Django1.10 support and Python3.x support. 

This is a version written with lessons of what were not ideal practices in previous version. 

Watch this space. Will post more by the end of this month. 

Paramedical Awareness of Cerebral Palsy Care


Cerebral palsy awareness lecture for paramedical personnel at ICCONS

Cerebral palsy awareness lecture for paramedical personnel at ICCONS


At ICCONS, where we have been successfully treating cerebral palsy children for over 10 years, rehabilitating them to achieve goals. It is so important to maintain the momentum of care across all departments.

Paramedical training ( physiotherapists, occupational therapists, orthotists, speech therapists, behavioral therapists, clinical psychologists, nursing team, social workers ) in cerebral palsy care, handling, treatment options and outcomes gives all those who are involved in the care of these children hope for the future. It also helps them prime parents towards realistic goals; both long and short term. The end result is a comprehensive care for these children with cerebral palsy. 

Frequent lectures are so important to keep up the spirit among team members and orienting new employees. 

A recent talk i gave at Pediatric Orthopedic & Cerebral Palsy Clinic, ICCONS, Kerala preceding the World Health Day , 2017

Cerebral palsy awareness lecture for paramedical personnel at ICCONS

Cerebral palsy awareness lecture for paramedical personnel at ICCONS

Take a look at @dreaswar‘s Tweet: https://twitter.com/dreaswar/status/850260886535020544?s=09

Cerebral Palsy Camp for underprivileged children at Palakkad, Kerala


In association with Rajiv Gandhi co-op erative hospital, Palakkad , to enable the Cerebral Palsy clinic and Gait Lab to reach underprivileged children, I’m conducting a medical camp for  children with cerebral palsy on 25 th, February, Saturday, 2017.

Those Interested may contact me at Me or the Hospital @ +919840724924 or +914912509000

This camp will include free Pediatric Orthopedic consultation with Dr. Easwar TR, video gait analysis, walking EMG measurement. Physotherapy services and Orthotic services are also integrated.

Thank you

You can read more about Cerebral Palsy here:

1) FAQs on Cerebral Palsy

2) Importance of Splints and Gait assistors in Cerebral Palsy

3) My Facebook Paediatric Orthopaedic and Limb Deformity Community

Club Foot

Dedicated Clubfoot Clinic at Palakkad , Kerala, India


Among the pediatric orthopedic problems, Club Foot is one of the commonest.

 It is a curving congenital deformity of the child’s foot. The knowledge of the deformity may come to light after birth and is traumatic for the parents. Thankfully treatment is simple, streamlined and gives good result. We apply POP casts to the foot every week and usually the foot corrects by 6 plasters. A small release of the heel cord may be required after the correction to complete the initial treatment. There after the foot is placed in special shoes and mother instructed on exercises.

 We have been dealing with large number of these children, educating their parents and care givers about the clubfoot that they stick through the initial treatment and subsequent follow up till mature. 

This is important so that any recurrence which is seen occasionally after a successful correction is addressed promptly. This translates to less surgery, if possible avoid surgery totally leaving a supple, scarless and beautiful foot. 

Clubfoot Plaster

Clubfoot Plaster

As the Pediatric Orthopedic service has matured at Palakkad District Cooperative Hospital, Palakkad, Kerala, India, we have now decided to allocate Monday as the special day for clubfoot children . This enables us to streamline our services and parents to learn from each other and support each other through this. 

We hope that this will help serve them better. 

All appointments can be booked via the contact page or via the CPOS clinic / hospital through phone +919840724924 or +914912520391

Sanskritam at IIT


IITs has been asked to teach Samskritam … read all about it !

…..screamed our electronic media. The reaction has been mostly negative. Occasional person voicing some positive comments. Twitter has been abuzz, specifically with people and blogs quoting Deputy CM of Delhi, Mr. Manish Sisodia to the effect that whether the nex-gen JS version is really worth the upgrade over Samskritam. What better could one expect from a party whose leader is a self-confessed anarchist.

Armed with my usual salt ( a pinch is too small a dose. I take spoonfuls ) considering the state of our media I searched for the full press release of Ministry of HRD to find out what it actually said. Unfortunately there is no press release so far in public domain from Ministry of HRD on this. What was projected and decided without a debate was from her statements in Loksabha.

The most acceptable version seems to be …

Accordingly, IITs have been requested to teach Sanskrit language especially with reference to study of works which contain scientific knowledge,” Irani said

This is based on the report submitted by N. Gopalaswami, who headed a committee formed by Ministry of HRD in Nov. 2015 for promotion of Sanskritam as a language. This was set up to look into and recommend measures to integrate its  study with disciplines such as mathematics, physics, chemistry, medical science and law. It will suggest changes in Sanskrit education in schools and universities and modern ways to impart Sanskrit education.
Eventhough Ms. Smriti Irani has clarified that it would be an elective, the media is still abuzz with people commenting on this, each looking at it with their lenses.

I cannot understand…

How a language which has given birth to most of the Indian Languages we speak today in many states or influenced the rest heavily could be such a politically fought tool.
How Sanskrit the language cannot be decoupled from opression, cateism, exclusivity, hindutva, brahminism and aryan-dravidian politics. If it is because it brings back bad memories to some, why dosent the language English bring back memories of British Oppression, Elitism, Exclusivity, Divide and rule politics and Missionary work ? Why dosent Arabic/Persian raise questions about Islamic suppression and atrocities ?
You hate the oppressor, not the language that he/she speaks.

What’s in a name ?

The language is a language. The time when Sanskrit was widely used – nobody seems to know when this was – but lets assume a safe year of 1000 BC, there still seems to have other languages that drew from it and thrived. It was a pan-indic-religious languages. Lets face it.  Hinduism, Buddhism, Jainism have large volumes of works written in it. Its not this only-Brahmin heritage.
The so called Dravidian ( which itself is a Sanskrit word ) languages are all heavily drawing from Sanskrit. Being a native speaker of both Malayalam and Tamil and student of Sanskritam I can say that both these languages draw heavily from it. Its a myth that Tamil just grew alone and is untouched by Sanskrit. The poster boy of Tamil Literature, Thiruvalluvar and his Thirukkural itself has many Samskritam words in it.All the Thevarams praise the Vedic Gods and include plentiful Samskritam to convey  untranslatable concepts.
It is my regular question set to my tamilian friend when it comes to opposing anything Hindi/Samskritam:
If Thiruvalluvar himself did not want to cleanse non-Tamil words from Thirukkural, why do the tamil politicians bother to clean tamil of sanskrit/ north-indian influence ? Do the modern tamilians claim to be better tamil lovers than Thiruvalluvar ?
If tamil is really an independent language, how come tamil legends talk about Agasthiyar ( a vedic Rishi) as the one who created Tamil ?
How a vedic God Shiva become the first Tamil Sangam Leader ? 

 

Why .. Why … Why do people love to hate it ?

The answer is that Sanskritam hatred is convenient and beneficial.
Let see how many birds one can kill with one stone – just by opposing Sanskritam.
  • 1  : Hindutva lovers / Sanghis / BJP
  • 2 : Hail Dravidian Identity and Tamil nationalism
  • 3 : Project modernity and upwardly mobile culture
  • 4 : Hey, its not as if I dont get a job if i dont study it.
  • 5 : Brahmin:  you oppressor, take that

In short ..

It’s a soft target. It has ‘X’ marked on it for any passer-by’s convenience. A quick punch. The vent. The pleasure. Un matched for the number of political/philosophical schools it pleases at the same time – commies, aaptards, congis,dravidians, upwardly mobile…


So do we need to protect, revive and reinstate Samskritam ?

If India has to go back to the glory days when it attracted people from distant lands to come and learn at its Universities at Takshashila and Nalanda,  when its riches were stuff of lore told in other lands, when we were living in a different century than the rest of the planet, we need to first find out what worked for us. We need then to find out what went wrong. Then we can understand whether we can go back. If we already have it there is no need to reinvent the wheel, but to look at ourselves we need the lingua-franca of the golden ages to understand its literature.

I am not talking of searching for lost technology for building airplanes, of doing genetic works, but I am sure all those wise men who trooped to our famous universities did so for a very good reason. We’d be fools to not look into our own culture and history to get us back where we were, for that’d be the most natural step to take. We have already been there, done that. We can do it again.
Lets hope good sense dawns, once the dust settles and India can get back to where it was.

A gentle yet clear brushing off of the cobwebs of the so-called Aryan theory and all its vicious corollaries is therefore absolutely necessary, especially for the South, and a proper self-respect created by a knowledge of the past grandeur of one of the great ancestors of the Aryan race — the great Tamilians.

We stick, in spite of Western theories, to that definition of the word “Arya” which we find in our sacred books, and which includes only the multitude we now call Hindus. This Aryan race, itself a mixture of two great races, Sanskrit-speaking and Tamil-speaking, applies to all Hindus alike.

-Swami Vivekananda, Aryans and Tamilians

Would you wear a garment without a blouse?


At a politically tumultuous time when you’re not even sure what secularism, nationalism, sedition, freedom of speech in particular and freedom in general (aazaadi) is, we have here a  peice on what constitutes ….for want of better words , shall we say and in the process provoke a redefinition of the word ‘decently dressed’. Thought provoking for the impartial inquirer, revolting to the convent educated elite, too much for even the liberalism chanting neavueau-upworldly mobile, slap in the face for ultra-conservatives. All at the same time. Are we staring at the truth here – for isn’t not truth said to be unpleasant/uncomfortable ?

This piece was a reaction to seeing a room full of amazing black and white photos by Sunil Janah of women who were topless. Like the below photo of a Hill Maria Woman from Bastar.  Courtesy of the …

Source: Would you wear a garment without a blouse?

Interventional Pain management and Palliative Pain Care – a write up on Cancer Pain


Coimbatore Pain Clinic

 

Commemorative day for Cancer passed us by, mostly un-noticed amidst the din of modern self centered life. Here is an article by my dear friend and senior colleague Dr. Sekar Michael who runs a Coimbatore Pain Clinic at Coimbatore, Tamil Nadu, India and is actively involved in treating under priviliged cancer patients.

This was published in Times Of India, an Indian News Paper.

Developing Pluggable Modules with AuShadha Open Source EMR – UI building with PyYAML – Tutorial – Part 3


Building the Dijit – UI with PyYAML markup and Django Templating

Get the PyYAML file from Git Hub Repo : get it here.

This is the file that generates the Patient Pane which is brought up after searching.

This is the UI it generates:

Patient Pane
This Patient Pane’s UI widgets, layout etc is partly generated from the PyYAML

This pane.yaml file is a Django template that leverages Django’s templating features as well as PyYAML‘s object mark up to generate a rendered JSON. This JSON is then returned on AJAX call to help the UI building. JSON is parsed by the Javascript file here to help build the Dijit UI, Widgets etc…

PyYAML file

Let us examine the PyYAML file markup

Comments and Verbatim Code

At the top, {% verbatim %} Django Template tag allow the developer to put some code / comments

 Declaring Variables

Variables that can be used all over the YAML file can be declared at the top. This is where PyYAML markup scores over Django Template. Django Template restricts variable naming and prevents you from doing Python stuff inside the template.  This is ok for most templates that output HTML where the relevent code can be put inside the views.py. However, for it is also convenient if the option exists on the template. PyYAML allows us to call random python objects, declare variables that can be used through the template, use aliases in YAML file and even instantiate Python objects. Coupled with Django Template, it can be used powerfully.

# VARS

Variables can be declared with the expected type just to be sure. Aliases created can be used like Variables throughout the YAML file. Of Course we can just use {{{<some_var>}} Django template variable to do the substitution as well without creating any alias. 

VARS:
  clinic_id: &CLINIC_ID
     !!int {{clinic_id}}
  patient_id: &PATIENT_ID
     !!int {{patient_id}}
URLS:

This calls the Django reverse method and allows calling with arguments. The results is stored as the PATIENT_PANE_URL alias. 

pane: &PATIENT_PANE_URL 
 !!python/object/apply:django.core.urlresolvers.reverse
 args: [ render_patient_pane_with_id ]
 kwds: { kwargs : { patient_id: *PATIENT_ID } }

Using Django {%url%} template tag, the code below can be rewritten more elegantlyas:

pane: &PATIENT_PANE_URL  # creates the Alias of PATIENT_PANE_URL    
    {% url 'render_patient_pane_with_id' *PATIENT_ID %}

 YAML Header and Describing the Layout of the UI, widgets inside each DOM

YAML Header describes which module the pane belongs to, what are requisite modules to be loaded before this loads and whether this loads on AuShadha start. This is something like a basicinformation about the pane.

# YAML

depends_on: [ search ] #Requires that the Search Module
load_after: search #Requires that Search UI should be loaded before this
load_first: !!bool False #Prevents loading this first explicitly

#Following markup start the description of the Patient UI Pane

id : PATIENT     #ID of the DOM Element

type : bc        # Type of Dijit Layout Widget this is bc = Dijit BorderContainer

title : Patient         #Title Attribute

url : *PATIENT_PANE_URL #The URL attribute which equals href of the widget

closable : !!bool True  #Whether the tab is closable

widgets: []             #Whether there are child widgets (exludes layout widgets)

panes:                  #Describes the child layout Panes / DOM Nodes

  - id: PATIENT_DETAIL_ACTIONS_ICONS #DOM Element Id of the pane
    type: dom                        #Says that this is only a DOM Node not Dijit
    domType: div                     #Specifies the DOM node type
    style:                           #Specifies the CSS styles 
      position: relative
      top: 10
      zIndex: 1000
      float: right
      width: 200px
      height: 1.8em
- id : PATIENT_TOP_CP            #Describes a Dijit Layout Widget DOM Id
 region: top                     #Region attribute of the widget
 type: cp                        #Type of widget cp = dijit ContentPane
 splitter: False                 #Splitter attibute
 url: *PATIENT_INFO_URL          #href attribute
 widgets: []                     #Contained non-layout widgets
 panes: []                       #Contained Dijit panes, DOM nodes
 class: topContentPane selected  #CSS class 
 style:                          #CSS styles
   height: 1.8em

The resulting PyYAML file can be parsed and UI created by the Javascript file. As you can see the method is easy and the markup is certainly more readable than an HTML file with Dijit declarative markup interspersed with Django template markup etc..

It can certainly be argued about the need for a PyYAML use when HTML can be used. However, to change a layout and to see switching layout / per -user customisation it is much easier to move the YAML blocks to and fro the nested levels than to switch HTML blocks with all the declarative markups. Of course we can use Django Template {% include %} to create a basic HTML file that will do the job. It is up to developer preference. I found this much easier on the eye.

The current limitation is regarding inline javascript. This can be solved through custom Dojo Modules using AMD loader. Dojo’s dojoConfig attribute allows runtime loading. The pane’sattribute can allow import of specifically needed JS modules / classes. This is a thought. I have not implemented this fully. However, the proof of concept of this exists at the Pluggable module aushadha_demographics_us tree.yaml file.

More on that on a later post.

Next Tutorial will be based on the core of AuShadha and its bundled apps

Developing Pluggable Modules with AuShadha Open Source EMR – Part 2


Creating a fresh application

For the purpose of this we will create a demographics application with data collection as done is USA.

The end result is available at http://github.com/dreaswar/Au-Pluggables

After activating the virtual environment run

$ python manage.py startapp aushadha_demographics_us --template AuShadha/app_template

This will generate the application scaffold and populate it with basic import stubs. The folder structure will be as described in the PART 1.

1. Creating the model, views and urls.py

The models will be derived based on the US Demographics requirements here:  Demographics

The model class inherits from AuShadhaBaseModel and the model form class will inherit from AuShadhaBaseModelForm class, which gives them some useful methods which they inherit.

Additionally, the AuShadhaModelForm class generates Dijits for display. The Dijits have to be configured in the dijit_widgets_constants.py file which is a python dictionary. This is will give the necessary Dijit declarative directives for generating the form widgets.

Once the models are done, the views and urls.py have nothing AuShadha specific about them. Basically we need views to add, edit, delete, view, json export the objects. The same can be represented in the urls.py

2. Determining the registration of roles

The aushadha.py  file registers the role of a particular class in the application. Roles are purely arbitrarily made up by the developer. However, if he needs to register a class for a particualr role that has already been registered, he will need to use the same name so as to override the preexisting class.

For eg> a PatientRegistration model may do the role of Patient Registration in the application. Hence this can be registered for that role. AuShadhaUI class generates an instance per server run and this registers the classes for a particular role on startup.

Registration can be accomplished inside aushadha.py as

UI.register(<class_name>, <role_name_as_string> )

3. Finalise the UI layout with PyYAML

Earlier in AuShadha developement, Django Template with HTML, CSS, and JS was used to generate the layout. This sometimes requires extensive Dijit declarative HTML markup that was not easy on the eye. Additionally interspersed JS and CSS didnt help.

Hence a method of returning the UI layout as a JSON was devised using PyYAML library. On JSON return, this is parsed and the UI dynamically generated using Javascript. This has dramatically reduced the JS files required.

The required PyYAML file is located in the dijit_widgets directory. The pane.yaml  and  pane.py  creates the necessary JSON

PyYAML directives are almost the same as Dijit declarative HTML markup except for the quotations and angled bracket distractions. I will devout an entire tutorial on this and how the JS file parses this. This is very early in AuShadha development so the markup, directive may change, but the principle is the same.

4. Study need for additional JS files

The add-on modules will have a media directory with sub-directories of js, styles, images  to house modules of JS, CSS and images. Dojo has the new AMD loader that encourages modular design and the dojoConfig variable can be changed at runtime allowing full flexibility to add modules as needed. This is demonstrated by the grids in the application (Contact, Phone and Guardian grid). The relevent module that should be called by the loader is specified in the pane.yaml under the grid directives as gridStrModule.

5. Integerate or install the application

The application itself needs to be added to the INSTALLED_APPS. Integrating the application (or installing ) requires changes in the settings.py to set the paths for templates, scripts, styles and media.  The Root urls.py needs to include the application as well. After the settings are done run syncdb to install the changes.

In case of Stock modules that clash with add-on modules, the stock modules will have to be removed, changes made to settings.py and urls.py to reflect this. This has to be done before syncdb is done.

The fully developed application for US demographics collection is at http://github.com/dreaswar/Au-Pluggables

Part 3 will deal with PyYAML and auto building the Dijit UI Widgets with PyYAML and Dojo

Developing Pluggable Modules for AuShadha – Tutorial – PART 1


AuShadha Open Source EMR has been made pluggable – well almost. The au_pluggable branch is meant to make it more pluggable that it was in master branch.

Issues the monolithic AuShadha:

Well, when I started this I myself was new to Django and programming in general. I learnt as I coded and as can be expected, there were code everywhere and it was not very pleasant. So I rewrote the app in many times from ground up before AuShadha came into being. I was at that time building something for myself – to use at my orthopaedic clinic.

When AuShadha was started, it suddenly dawned that there are now people participating; people who have never seen this code, and who probably will be put off on the huge pile of code to digest. Since there is already a lot of code out there, it is difficult for a developer joining a project or someone who does not want the whole AuShadha package to develop , rehash or add packages to it. The entry barrier was very high. I also seemed to be re-creating one of the problems that made me start and EMR project; I had found existing ones tough to customise.

In an ideal world, EMRs should vary. Data collection varies from hospital to hospital, country to country and speciality to speciality and to some extent practioner to practitioner. Except for gross repeatable elements that can be swapped, most of the EMRs have to be different. However, many are not. Its not common in India to see EMRs used by hospitals that do not fit into the Indian way of data gathering and its unique Demographics and other regional specifics. Some EMRs do provide custom form generation to tide over this and some vendors do provide some basic customisation. The solution has to be more robust.

My own experience with getting them to do that for us was poor. This is probably because the code is hardwired and they could not accomodate out request for a feature change easily. From their side it would involve extensive recoding and debugging, man power requirement, that could not be afforded when the system is live at a Hospital.

The user should be provided a decent package out of the box with the option of switching out elements as he / she sees fit, to develop his own variant of AuShadha. This would be the ultimate goal.

Why this tutorial ?

It became quickly clear that I had to do something about it before the project grew. So about 2 months ago I created the au_pluggable branch in an attempt to modularise AuShadha. Thankfully Django encourages pluggable modules. This process was not very difficult; except for the difficulties created by my mangled coding earlier 🙂

The purpose of the write-up is to show developers and other enthusiastic people who want to develop / test out AuShadha how easy it is now to create their own mix- and – match AuShadha brew. There is still a lot of work, but as it stands the process is simple enough for somebody to follow. It is intended to show how easy it is to create modules for AuShadha without knowing the whole codebase that is already out there.

The tutorial would be written in parts. This is the first one.

So, let us start.

As I said, one of the advantages of the current pluggability model it that it allows user to swap in custom implementation of a particular module. All this while retaining the inherent structure of Django. This is important as developers who would get involved with AuShadha should feel that the skill they improve here is usable outside of AuShadha. Therefore the customisations have be done on top of Django with no patching of Django or any hacks.

First, let us familiarise ourselves with AuShadha module directory and file structure. After that we will create a pluggable module for use. For example, if the user wants his own implementation of the Demographics module overriding the stock version he / she will do it as below. The procedure for creating new modules will also be identical to this, which will be examined in subsequent post.

Of course if the reader dosent care and just wants to build a pluggable module for AuShadha using raw Django, then there is not problem. He can just build a regular Django-app and intergrate it as usual and expect it to work; well, after some little configuration. No XML I promise.

Basic AuShadha-app structure

The basic Structure of an AuShadha-pluggable module is typically seen in the patient app ( called aushadha-patient )

patient/
|– admin.py
|– aushadha.py
|– dijit_fields_constants.py
|– dijit_widgets
| |– __init__.py
| |– pane.py
| |– pane.yaml
| |– tree.py
| `– tree.yaml
|– docs
|– fixtures
|– __init__.py
|– LICENSE.txt
|– MANIFEST.in
|– media
| |–patient
| | |– images
| | |– js
| | |– styles
| `– README
|– models.py
|– queries.py
|– README.md
|– setup.py
|– templates
| `– patient_detail
| |– add.html
| |– edit.html
| |– info.html
| |– list.html
| |– summary.html
|– tests.py
|– urls.py
|– utilities.py
|– views.py

Typical AuShadha Application Structure and its contents

Typical AuShadha Application Structure and its contents

models.py, views.py, urls.py, admin.py, media/, templates/ are directly from Django’s own system. Nothing much custom here. Standard Django roles are served by these files.

Custom action is mostly in dijit_widgets/ and its contents, dijit_fields_constants.py, aushadha.py, queries.py, utilities.py

AuShadha uses a system of PyYAML to serialize and generate the UI for each app. Each app can configure the UI layout using Dijit (Dojo) widgets using this markup. Whats’ wrong with HTML ? Well, this is way more readable, we can still use the goodness of Django’s template engine and PyYAML’s python object and function calls including pickling and this reduces the JS files. This way there is less to debug and quick prototyping and customisation of UI is possible. The dijit_widgets folder contains:

Folder Structure and contents inside dijit_widgets folder

Folder Structure and contents inside dijit_widgets folder


pane.py, pane.yaml — > Django view to serve the ‘pane’ for the app. All customisation can be done in the corresponding pane.yaml using django template syntax / PyYaml syntax. It will be serialized as JSON and presented on request. This JSON will autocreate the UI. It is much more easier than using HTML with Django template for UI generation. Of course this traditional approach can be used just to generate Django forms and its validation JS code. This is what is done in the templates/ folder.

tree.py, tree.yaml — > Though not necessary for all apps, apps that do provide a tree structure to the UI can define this and use tree.yaml to generate the structure dynamically. Django template can be used as can PyYAML object notations. The JSON can then be passed to the client on request.

dijit_fields_constants.py — > (WARINING: This is going to be changed soon ) This hold the Python dictionary values for model form fields as Django ModelForm using Dojo/Dijit markup. This was before YAML became widely used in the project. This will be replaced soon with PyYAML markup like the Ui and this file may be moved into the dijit_widgets directory.

aushadha.py –> Every project when server is started creates a shared instance of AuShadhaUI class that lives in . This instance accepts registration of classes for particular roles they will perform in the EMR. Registration for the role and the class is done here. Each module is autoinspected for aushadha.py file on server startup just like admin.py file. The purpose for this is to create a role based central registry that registers classes for roles in EMR. This allow relative role based imports rather than path based module dependant imports allowing free module swappability. No more ImportErrors if that particular module is not present. For eg; if the patient module has been changed by say Author Mr. X and he has named it patient-mr-x and included in installed apps, along with a registration in aushadha.py for “PatientRegistration” role, as long as syncdb has been done, the class is picked up on first load and registered for that role overwriting the stock ‘patient’ app. All modules that need ‘patient_detail’ foreignkey do a relative import of the same in their models.py / views.py. This allows a Zope 3 like Interface like, Role based registrations allowing loose coupling. This is explained by me in my query to Stack Overflow here. Sadly, no answers came. So this solution has been rolled out. http://stackoverflow.com/questions/19100013/using-zope-interface-with-django

LICENSE.txt, MANIFEST.in, README.md, setup.py, docs/ are requirements to make this a python package. This will allow users to easing installation.

Having described the directory structure of AuShadha app and its contents, we will discuss the app creation from scratch in next part of the tutorial

AuShadha Open Source EMR moves to Django 1.5.1


AuShadha Dependency Changes:
========================

This is to infrom that AuShadha dependency list has changed. This has been necessitated to ensure compatibility with Django 1.5.1 and xhtml2pdf.pisa packages along with upgrades to ReportLab, PIL, South.

Anybody wanting to test out code in the “visit_experimental” branch need to setup a Python virtualenv and run the following from the AuShadha code main directory

Read more about it here… http://blog.aushadha.org/?p=24

Dedicated Website for my Open Source Electronic Medical Records Project – AuShadha


AuShadha Website is live !

AuShadha Electronic Medical Records project written in Python using Django and Dojo Javascript library has now a dedicated website with integrated Wiki, Blog and Discussion Forum at http://www.aushadha.org/

Please visit and let me know the feedback.

Thanks,

Dr.Easwar