Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Updated cds / Master cds schema definitions. #64

Merged
merged 1 commit into from

1 participant

@pbugni

No description provided.

@pbugni pbugni merged commit c1bd0f1 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 29, 2012
  1. @pbugni

    New cds and Master cds schema definitions.

    pbugni authored
    (Removed obsolete schema files)
This page is out of date. Refresh to see the latest.
View
12 cds/database/add_CDA_name_n_date_cols.sql
@@ -1,12 +0,0 @@
--- Additional fields for index and retrieval of CDS records
---
--- to run, from a command shell:
--- mysql -u <user> -p <database_name> < <this_file>
---
--- i.e.
--- mysql -u oecuser -p cds < add_CDA_name_n_date_cols.sql
-
-ALTER TABLE CDA ADD COLUMN first_name TEXT NULL;
-ALTER TABLE CDA ADD COLUMN last_name TEXT NULL;
-ALTER TABLE CDA ADD COLUMN date_generated DATETIME NOT NULL;
-ALTER TABLE CDA ADD COLUMN date_stored DATETIME NOT NULL;
View
56 cds/database/cds.sql
@@ -0,0 +1,56 @@
+/*
+SQLyog Community v8.4 Beta2
+MySQL - 5.1.45-community : Database - cds
+*********************************************************************
+*/
+
+
+/*!40101 SET NAMES utf8 */;
+
+/*!40101 SET SQL_MODE=''*/;
+
+/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
+/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
+/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
+/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+CREATE DATABASE /*!32312 IF NOT EXISTS*/`cds` /*!40100 DEFAULT CHARACTER SET utf8 */;
+
+USE `cds`;
+
+/*Table structure for table `cda` */
+
+DROP TABLE IF EXISTS `cda`;
+
+CREATE TABLE `cda` (
+ `cda_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'internal key',
+ `patient_clinical_id` varchar(100) NOT NULL COMMENT 'Clinic ID assigned to a patient in a given facility',
+ `hdss_id` varchar(100) DEFAULT NULL COMMENT 'Hdss',
+ `facility_code` varchar(11) DEFAULT NULL COMMENT 'facility code from mfl',
+ `facility_name` varchar(100) DEFAULT NULL COMMENT 'name of the facility',
+ `cda` longtext COMMENT 'summarized patient information',
+ `first_name` varchar(64) DEFAULT NULL COMMENT 'patient''s first name',
+ `last_name` varchar(64) DEFAULT NULL COMMENT 'patient''s last name',
+ `birthdate` date COMMENT 'date of birth following MOH guidance',
+ `gender` ENUM ('M', 'F', 'U', 'N') DEFAULT 'N' COMMENT '''M'' (male), ''F'' (female), ''U'' (undifferentiated) and ''N'' (nullFlavor/unknown)',
+ `source_type` varchar(25) DEFAULT NULL COMMENT 'source of the document: EMR,LIS, Pharm etc',
+ `source_system` varchar(64) DEFAULT NULL,
+ `date_stored` datetime DEFAULT NULL COMMENT 'datetime when cda is stored in cds',
+ `date_generated` datetime DEFAULT NULL COMMENT 'datetime when cda was generated from source',
+ PRIMARY KEY (`cda_id`),
+ KEY `patient_clinical_id` (`patient_clinical_id`),
+ UNIQUE `unique_cda` (`patient_clinical_id`, `hdss_id`, `facility_code`, `source_system`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+DROP TABLE IF EXISTS `cda_to_process`;
+
+CREATE TABLE `cda_to_process` (
+ `cda_id` int(11) NOT NULL,
+ CONSTRAINT `fk_cda_id` FOREIGN KEY (`cda_id`) REFERENCES cda(`cda_id`) ON UPDATE CASCADE ON DELETE CASCADE,
+ UNIQUE (`cda_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+/*Data for the table `cda` */
+
+/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
+/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
+/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
View
57 cds/database/cds_store.sql
@@ -1,57 +0,0 @@
-CREATE DATABASE IF NOT EXISTS `cds` /*!40100 DEFAULT CHARACTER SET latin1 */;
-USE `cds`;
--- MySQL dump 10.13 Distrib 5.1.40, for Win32 (ia32)
---
--- Host: localhost Database: cds
--- ------------------------------------------------------
--- Server version 5.1.45-community
-
-/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
-/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
-/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
-/*!40101 SET NAMES utf8 */;
-/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
-/*!40103 SET TIME_ZONE='+00:00' */;
-/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
-/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
-/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
-
---
--- Table structure for table `cds_store`
---
-
-DROP TABLE IF EXISTS `cds_store`;
-/*!40101 SET @saved_cs_client = @@character_set_client */;
-/*!40101 SET character_set_client = utf8 */;
-CREATE TABLE `cds_store` (
- `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
- `destination` varchar(45) NOT NULL,
- `message` blob NOT NULL,
- `voided` tinyint(1) NOT NULL,
- `received_datetime` datetime NOT NULL,
- `voided_datetime` datetime DEFAULT NULL,
- PRIMARY KEY (`id`)
-) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
-/*!40101 SET character_set_client = @saved_cs_client */;
-
---
--- Dumping data for table `cds_store`
---
-
-LOCK TABLES `cds_store` WRITE;
-/*!40000 ALTER TABLE `cds_store` DISABLE KEYS */;
-INSERT INTO `cds_store` VALUES (1,'ke.go.moh.facility.14080.tb.reception','<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\r\n<PRPA_IN201302UV02 xmlns=\"urn:hl7-org:v3\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ITSVersion=\"XML_1.0\" xsi:schemaLocation=\"urn:hl7-org:v3 ../../schema/HL7V3/NE2008/multicacheschemas/PRPA_IN201311UV.xsd\">\r\n <id extension=\"13160650464701\" root=\"1.3.6.1.4.1.150.2474.11.1.1\"/>\r\n <creationTime value=\"201101010930\"/>\r\n <interactionId extension=\"PRPA_IN201302UV02\" root=\"2.16.840.1.113883.1.6\"/>\r\n <processingCode code=\"P\"/>\r\n <processingModeCode code=\"T\"/>\r\n <acceptAckCode code=\"NE\"/>\r\n <receiver typeCode=\"RCV\">\r\n <device classCode=\"DEV\" determinerCode=\"INSTANCE\">\r\n <id extension=\"ke.go.moh.facility.14080.cds\" root=\"1.3.6.1.4.1.150.2474.11.1.2\"/>\r\n <name>Clinical Document Store</name>\r\n </device>\r\n </receiver>\r\n <sender>\r\n <device classCode=\"DEV\" determinerCode=\"INSTANCE\">\r\n <id extension=\"ke.go.moh.facility.14080.tb.reception\" root=\"1.3.6.1.4.1.150.2474.11.1.2\"/>\r\n <name>Cds Test application </name>\r\n </device>\r\n </sender>\r\n <controlActProcess classCode=\"CACT\" moodCode=\"EVN\">\r\n <code code=\"PRPA_TE201302UV02\" codeSystem=\"2.16.840.1.113883.1.6\"/>\r\n <subject typeCode=\"SUBJ\">\r\n <registrationEvent classCode=\"REG\" moodCode=\"EVN\">\r\n <id nullFlavor=\"NA\"/>\r\n <statusCode code=\"active\"/>\r\n <subject1 typeCode=\"SBJ\">\r\n <patient classCode=\"PAT\">\r\n <statusCode code=\"active\"/>\r\n <patientPerson>\r\n <name>\r\n <given>Harry</given>\r\n <given>Kimani</given>\r\n <family>Thuku</family>\r\n </name>\r\n <administrativeGenderCode code=\"M\"/>\r\n <deceasedTime value=\"20110601\"/>\r\n <id extension=\"no\" root=\"1.3.6.1.4.1.150.2474.11.1.4.3\"/>\r\n <id extension=\"12945-12345/2010\" root=\"1.3.6.1.4.1.150.2474.11.1.5.4\"/>\r\n <id extension=\"ke.go.moh.facility.14080.tb.reception\" root=\"1.3.6.1.4.1.150.2474.11.1.6.1\"/>\r\n <id extension=\"20110915\" root=\"1.3.6.1.4.1.150.2474.11.1.6.2\"/>\r\n </patientPerson>\r\n </patient>\r\n </subject1>\r\n </registrationEvent>\r\n </subject>\r\n </controlActProcess>\r\n</PRPA_IN201302UV02>\r\n',0,'2011-09-15 08:37:26',NULL);
-/*!40000 ALTER TABLE `cds_store` ENABLE KEYS */;
-UNLOCK TABLES;
-/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
-
-/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
-/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
-/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
-/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
-/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
-/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-
--- Dump completed on 2011-09-17 15:48:04
View
49 cds/database/mcds.sql
@@ -0,0 +1,49 @@
+/*
+SQLyog Community v8.4 Beta2
+MySQL - 5.1.45-community : Database - mcds
+*********************************************************************
+*/
+
+
+/*!40101 SET NAMES utf8 */;
+
+/*!40101 SET SQL_MODE=''*/;
+
+/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
+/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
+/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
+/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+CREATE DATABASE /*!32312 IF NOT EXISTS*/`mcds` /*!40100 DEFAULT CHARACTER SET utf8 */;
+
+USE `mcds`;
+
+/*Table structure for table `cda` */
+
+DROP TABLE IF EXISTS `cda`;
+
+CREATE TABLE `cda` (
+ `cda_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'internal key',
+ `patient_clinical_id` varchar(100) NOT NULL COMMENT 'Clinic ID assigned to a patient in a given facility',
+ `hdss_id` varchar(100) DEFAULT NULL COMMENT 'Hdss',
+ `facility_code` varchar(11) DEFAULT NULL COMMENT 'facility code from mfl',
+ `facility_name` varchar(100) DEFAULT NULL COMMENT 'name of the facility',
+ `cda` longtext COMMENT 'summarized patient information',
+ `first_name` varchar(64) DEFAULT NULL COMMENT 'patient''s first name',
+ `last_name` varchar(64) DEFAULT NULL COMMENT 'patient''s last name',
+ `birthdate` date COMMENT 'date of birth following MOH guidance',
+ `gender` ENUM ('M', 'F', 'U', 'N') DEFAULT 'N' COMMENT '''M'' (male), ''F'' (female), ''U'' (undifferentiated) and ''N'' (nullFlavor/unknown)',
+ `source_type` varchar(25) DEFAULT NULL COMMENT 'source of the document: EMR,LIS, Pharm etc',
+ `source_system` varchar(64) DEFAULT NULL,
+ `date_stored` datetime DEFAULT NULL COMMENT 'datetime when cda is stored in cds',
+ `date_generated` datetime DEFAULT NULL COMMENT 'datetime when cda was generated from source',
+ PRIMARY KEY (`cda_id`),
+ KEY `patient_clinical_id` (`patient_clinical_id`),
+ KEY `hdss_id` (`hdss_id`),
+ UNIQUE `unique_cda` (`patient_clinical_id`, `hdss_id`, `facility_code`, `source_system`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+/*Data for the table `cda` */
+
+/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
+/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
+/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
Something went wrong with that request. Please try again.