{ "info": { "author": "Nicholas Orlowski", "author_email": "nick.orlowski@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "HL7py\n=====\nThe MIT License\n\nCopyright (c) 2012 Nicholas Orlowski\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\n=====\n\n\n\nA parser for the HL7 Health data interchange format written in python. Provides\nattribute-like access to correct datatypes and provides the ability to construct HL7\nmessages from dictionaries.\n\nThe HL7 transport protocol is a confusing mess of pipes and carriage returns. This package\nprovides easy Pythonic access to attributes within a message. There is much domain\nknowledge of segments names and field names, but what follows are some basic examples of\nsyntax and usage.\n\n\n\nHere is a sample message from http://www.coast2coastinformatics.com/user/ADTA08_examples-110106.pdf\n \n MSH|^~\\&|AccMgr|1|||20050110045504||ADT^A01|599102|P|2.3|||\n EVN|A01|20050110045502|||||\n PID|1||10006579^^^1^MRN^1||DUCK^DONALD^D||19241010|M||1|111 DUCK ST^^FOWL^CA^999990000^^M|1|8885551212|8885551212|1|2||40007716^^^AccMgr^VN^1|123121234|||||||||||NO NK1|1|DUCK^HUEY|SO|3583 DUCK RD^^FOWL^CA^999990000|8885552222||Y||||||||||||||\n PV1|1|I|PREOP^101^1^1^^^S|3|||37^DISNEY^WALT^^^^^^AccMgr^^^^CI|||01||||1|||37^DISNEY^WALT^^^^^^AccMgr^^^^CI|2|40007716^^^AccMgr^VN|4|||||||||||||||||||1||G|||20050110045253||||||\n GT1|1|8291|DUCK^DONALD^D||111^DUCK ST^^FOWL^CA^999990000|8885551212||19241010|M||1|123121234||||#Cartoon Ducks Inc|111^DUCK ST^^FOWL^CA^999990000|8885551212||PT| DG1|1|I9|71596^OSTEOARTHROS NOS-L/LEG ^I9|OSTEOARTHROS NOS-L/LEG ||A|\n IN1|1|MEDICARE|3|MEDICARE|||||||Cartoon Ducks Inc|19891001|||4|DUCK^DONALD^D|1|19241010|111^DUCK ST^^FOWL^CA^999990000|||||||||||||||||123121234A||||||PT|M|111 DUCK ST^^FOWL^CA^999990000|||||8291\n IN2|1||123121234|Cartoon Ducks Inc|||123121234A|||||||||||||||||||||||||||||||||||||||||||||||||||||||||8885551212 IN1|2|NON-PRIMARY|9|MEDICAL MUTUAL CALIF.|PO BOX 94776^^HOLLYWOOD^CA^441414776||8003621279|PUBSUMB|||Cartoon Ducks Inc||||7|DUCK^DONALD^D|1|19241010|111 DUCK ST^^FOWL^CA^999990000|||||||||||||||||056269770||||||PT|M|111^DUCK ST^^FOWL^CA^999990000|||||8291 IN2|2||123121234|Cartoon Ducks Inc||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||8885551212\n IN1|3|SELF PAY|1|SELF PAY|||||||||||5||1\n\n \n(Lines not wrapped for emotional effect)\n\n\n=================DATA ACCESS EXAMPLES============\n\nYou will be able to use syntax like\n\n1. 'SEG.some_attribute.data' to access either a dictionary (if that field has subfields)\n or a value parsed to the correct datatype, e.g. datetime or numeric.\n2. 'SEG.some_attribute.hl7' to have the message construct the HL7 equivalent of that\n attribute and all of its following segments and subsegments.\n\n3. 'SEG.some_attribute.some_timestamp.data = datetime.datetime.now()' allows you to set\n the value of a specific note/segment. See examples in the tests.\n\n\nExamples:\n\n from HL7py import parser\n my_message = parser.parse(incoming_str)\n my_message.PID.pat_name.data\n {'family_name':'DUCK','give_name':'DONALD','middle_name':'D'}\n my_message.PID.pat_name.family_name.hl7\n 'DUCK'\n my_message.IN1[0].ins_company_name.hl7\n 'MEDICARE'\n my_message.IN1[0].ins_company_name.data\n 'MEDICARE'\n my_message.IN1[1].ins_company_name.hl7\n 'SELF PAY'\n my_message.IN1_list\n [IN1,IN1]\n for ins in IN1_list:\n print ins.ins_company_name.hl7\n 'MEDICARE'\n 'SELFPAY\n\n\n\n\nThe NTE section is a special case. NTE sections can come after any other section and\nare assembled into the .note attribute for a segment.\n\n\n\n PID|1|123456789|112233|1234567|Test^Patient||19820620|F|||123 Fake St.^^SumCity^ST^12345-||(123)456-7890||||||\n ORC|RE|29117637990^LAB|291176379902012^LAB||||||201210170000|||1366445686^Doctor^M^^^^^N\n OBR|1|29117637990^LAB|291176379902012^LAB|001321^Iron and TIBC^L|||201210171632|||||||201210171934||||M542856833||29117637990||201210180743|||F\n OBX|1|NM|001347^Iron Bind.Cap.(TIBC)^L||476|ug/dL|250-450|H||N|F|19840622||201210180726|BN\n OBX|2|NM|001348^UIBC^L||462|ug/dL|150-375|H||N|F|19940518||201210180726|BN\n NTE|1|L|Results confirmed on\n NTE|2|L|dilution.\n \nThe following would occur:\n\n print my_message.ORC.OBR.OBX_list[1].note\n 'Results confirmed on dilution'\n\n=================MESSAGE CREATION EXAMPLES============\nMessages are created by assembling Segments and adding them to a Message.\n Here is an example of how our EMR, Ankhos, constructs an ADT/A08 message. The chart.to_dict()\n method constructs a dictionary of the relevant fields from chart demographics, etc.\n\n msg = Message()\n msh_data= dict(\n recv_app={'app_name': 'Their App'},\n send_app={'app_name': 'ANKHOS'},\n msg_type=dict(message_code='ADT',\n event_code='A08'),\n accept_ack_type='AL',\n application_ack_type='AL',\n proc_id='P',\n version='2.3',\n msg_ctl_id=control_id,\n encoding_chars='^~\\&',\n timestamp=datetime.datetime.now())\n MSH = Segment(code='MSH',data=msh_data)\n evn_data = dict(event_code=event_code,timestamp=dict(time=datetime.datetime.now(),\n resolution='S'))\n EVN = Segment(code='EVN',data=evn_data)\n PID = Segment(code='PID',data=chart.to_dict())\n pv1_data = {...}\n PV1 = Segment(code='PV1',data=pv1_data)\n msg.add_segments([MSH,EVN,PID,PV1])\n\n #Voila!\n print msg.hl7\n\n\nAs long as the data dictionaries follow the signatures in the HL7fields.py specification,\nthe Segments should be constructed correctly. There are a LOT of HL7 specified segments\nbut only a few in the include HL7fields.py file. We simply haven't had a use for most of them\nyet but if we do, I will be sure to update the HL7fields specification dictionary.\n\n\nCurrent limitations:\n 1. The ADD operation is not supported. (very low priority)\n 2. Intra-field repetition is not yet supported\n 3. The tests included are only smoke tests to make sure fundamental things haven't broken!\n HL7 is used in life-critical systems. Again. Please Please Please test your own software!\n More real tests will be added when time allows.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/norlowski/HL7py", "keywords": "hl7 parsing", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "HL7py", "package_url": "https://pypi.org/project/HL7py/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/HL7py/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/norlowski/HL7py" }, "release_url": "https://pypi.org/project/HL7py/1.01/", "requires_dist": null, "requires_python": null, "summary": "HL7 message parser", "version": "1.01" }, "last_serial": 784476, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "86c96c2870c02d499ade9f8503aebc95", "sha256": "61998f52c3d62f75b87dbb46f2af25a783bcfe0c95763caaa43026ff6444a823" }, "downloads": -1, "filename": "HL7py-1.0.zip", "has_sig": false, "md5_digest": "86c96c2870c02d499ade9f8503aebc95", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28307, "upload_time": "2012-11-19T18:52:59", "url": "https://files.pythonhosted.org/packages/55/2d/da37ffa93ac06ba0d627d14d4d5eb988aab3f80c1db0e57c3d72a34daab5/HL7py-1.0.zip" } ], "1.01": [ { "comment_text": "", "digests": { "md5": "1bfc6972ee4c4c6103ed75f529bc4fb0", "sha256": "58a0e9bc86255cb0a90d2327a4a2e5bca3fc827eda141a260d2daa359fddfb82" }, "downloads": -1, "filename": "HL7py-1.01.zip", "has_sig": false, "md5_digest": "1bfc6972ee4c4c6103ed75f529bc4fb0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28485, "upload_time": "2012-11-20T22:53:10", "url": "https://files.pythonhosted.org/packages/b2/12/53e5fc3cb714f66833a11faf833bf52cb0949fb29f593238d3d993aa01ca/HL7py-1.01.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1bfc6972ee4c4c6103ed75f529bc4fb0", "sha256": "58a0e9bc86255cb0a90d2327a4a2e5bca3fc827eda141a260d2daa359fddfb82" }, "downloads": -1, "filename": "HL7py-1.01.zip", "has_sig": false, "md5_digest": "1bfc6972ee4c4c6103ed75f529bc4fb0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28485, "upload_time": "2012-11-20T22:53:10", "url": "https://files.pythonhosted.org/packages/b2/12/53e5fc3cb714f66833a11faf833bf52cb0949fb29f593238d3d993aa01ca/HL7py-1.01.zip" } ] }