diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml index 3279b6be99..681f41ae2a 100644 --- a/.idea/codeStyles/Project.xml +++ b/.idea/codeStyles/Project.xml @@ -1,116 +1,116 @@ - - - - - - - -
- - - - xmlns:android - - ^$ - - - -
-
- - - - xmlns:.* - - ^$ - - - BY_NAME - -
-
- - - - .*:id - - http://schemas.android.com/apk/res/android - - - -
-
- - - - .*:name - - http://schemas.android.com/apk/res/android - - - -
-
- - - - name - - ^$ - - - -
-
- - - - style - - ^$ - - - -
-
- - - - .* - - ^$ - - - BY_NAME - -
-
- - - - .* - - http://schemas.android.com/apk/res/android - - - ANDROID_ATTRIBUTE_ORDER - -
-
- - - - .* - - .* - - - BY_NAME - -
-
-
-
-
+ + + + + + + +
+ + + + xmlns:android + + ^$ + + + +
+
+ + + + xmlns:.* + + ^$ + + + BY_NAME + +
+
+ + + + .*:id + + http://schemas.android.com/apk/res/android + + + +
+
+ + + + .*:name + + http://schemas.android.com/apk/res/android + + + +
+
+ + + + name + + ^$ + + + +
+
+ + + + style + + ^$ + + + +
+
+ + + + .* + + ^$ + + + BY_NAME + +
+
+ + + + .* + + http://schemas.android.com/apk/res/android + + + ANDROID_ATTRIBUTE_ORDER + +
+
+ + + + .* + + .* + + + BY_NAME + +
+
+
+
+
\ No newline at end of file diff --git a/.idea/copyright/sanjay_kranthi.xml b/.idea/copyright/sanjay_kranthi.xml old mode 100644 new mode 100755 diff --git a/.idea/encodings.xml b/.idea/encodings.xml old mode 100644 new mode 100755 diff --git a/.idea/gradle.xml b/.idea/gradle.xml old mode 100644 new mode 100755 diff --git a/.idea/misc.xml b/.idea/misc.xml old mode 100644 new mode 100755 diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml old mode 100644 new mode 100755 diff --git a/.idea/vcs.xml b/.idea/vcs.xml old mode 100644 new mode 100755 diff --git a/README.md b/README.md old mode 100644 new mode 100755 diff --git a/app/.gitignore b/app/.gitignore old mode 100644 new mode 100755 diff --git a/app/build.gradle b/app/build.gradle index c029a67711..148bb98b28 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -6,8 +6,8 @@ android { applicationId "io.intelehealth.client" minSdkVersion 19 targetSdkVersion 28 - versionCode 27 - versionName "version 2.0 beta 1" + versionCode 29 + versionName "version 2.0 beta 4" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" //Change this to true to enable multidex support for Kitkat multiDexEnabled true @@ -33,7 +33,7 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'com.android.support:appcompat-v7:28.0.0' - implementation 'com.android.support.constraint:constraint-layout:2.0.0-beta1' + implementation 'com.android.support.constraint:constraint-layout:2.0.0-beta2' implementation 'com.android.support:design:28.0.0' implementation 'com.android.support:support-v4:28.0.0' testImplementation 'junit:junit:4.13-beta-2' @@ -75,14 +75,8 @@ dependencies { //Google Guava implementation 'com.google.guava:guava:27.1-jre' //Storage librabry -// implementation 'com.snatik:storage:2.1.0' + // implementation 'com.snatik:storage:2.1.0' // dexter permission - // implementation 'com.karumi:dexter:5.0.0' - //Room database -// annotationProcessor "android.arch.lifecycle:compiler:1.1.1" -// implementation "android.arch.persistence.room:runtime:1.1.1" -// annotationProcessor "android.arch.persistence.room:compiler:1.1.1" -// implementation "android.arch.persistence.room:rxjava2:1.1.1" //Parse SDK implementation 'com.parse:parse-android:1.15.7' //date and time @@ -105,6 +99,11 @@ dependencies { implementation "com.google.firebase:firebase-messaging:17.3.4" implementation 'com.google.firebase:firebase-crash:16.2.1' + implementation('com.github.SandroMachado:restaurant:0.2.0@aar') { + transitive = true + } + + implementation 'com.rengwuxian.materialedittext:library:2.1.4' } diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro old mode 100644 new mode 100755 diff --git a/app/release/11jul.apk b/app/release/11jul.apk new file mode 100755 index 0000000000..a0488ae160 Binary files /dev/null and b/app/release/11jul.apk differ diff --git a/app/release/20-sep-appbeta.apk b/app/release/20-sep-appbeta.apk new file mode 100644 index 0000000000..e93a26019a Binary files /dev/null and b/app/release/20-sep-appbeta.apk differ diff --git a/app/release/22 aug .apk b/app/release/22 aug .apk new file mode 100644 index 0000000000..a3d6634a15 Binary files /dev/null and b/app/release/22 aug .apk differ diff --git a/app/release/25 aug .apk b/app/release/25 aug .apk new file mode 100644 index 0000000000..5067095edd Binary files /dev/null and b/app/release/25 aug .apk differ diff --git a/app/release/25version.apk b/app/release/25version.apk new file mode 100755 index 0000000000..bed3ee7b1f Binary files /dev/null and b/app/release/25version.apk differ diff --git a/app/release/25version5june.apk b/app/release/25version5june.apk new file mode 100755 index 0000000000..c3a0947111 Binary files /dev/null and b/app/release/25version5june.apk differ diff --git a/app/release/28junebetaversion.apk b/app/release/28junebetaversion.apk new file mode 100755 index 0000000000..13e16f560d Binary files /dev/null and b/app/release/28junebetaversion.apk differ diff --git a/app/release/29 aug app beta2.0 4.apk b/app/release/29 aug app beta2.0 4.apk new file mode 100644 index 0000000000..8436b85a0f Binary files /dev/null and b/app/release/29 aug app beta2.0 4.apk differ diff --git a/app/release/3julapprelease.apk b/app/release/3julapprelease.apk new file mode 100755 index 0000000000..def90c4c80 Binary files /dev/null and b/app/release/3julapprelease.apk differ diff --git a/app/release/9julrelease.apk b/app/release/9julrelease.apk new file mode 100755 index 0000000000..0cbfff775f Binary files /dev/null and b/app/release/9julrelease.apk differ diff --git a/app/release/Sprint1release.apk b/app/release/Sprint1release.apk old mode 100644 new mode 100755 diff --git a/app/release/app beta 2.0 8 aug.apk b/app/release/app beta 2.0 8 aug.apk new file mode 100755 index 0000000000..de20d61cb1 Binary files /dev/null and b/app/release/app beta 2.0 8 aug.apk differ diff --git a/app/release/app beta 2.0 version 3 26-aug.apk b/app/release/app beta 2.0 version 3 26-aug.apk new file mode 100644 index 0000000000..b08f5b0caf Binary files /dev/null and b/app/release/app beta 2.0 version 3 26-aug.apk differ diff --git a/app/release/app beta 2.0-24jul.apk b/app/release/app beta 2.0-24jul.apk new file mode 100755 index 0000000000..84db33dfe6 Binary files /dev/null and b/app/release/app beta 2.0-24jul.apk differ diff --git a/app/release/app beta 2.0-25july.apk b/app/release/app beta 2.0-25july.apk new file mode 100755 index 0000000000..c213b03f2b Binary files /dev/null and b/app/release/app beta 2.0-25july.apk differ diff --git a/app/release/app beta 2.0-26july.apk b/app/release/app beta 2.0-26july.apk new file mode 100755 index 0000000000..fb55daf5d8 Binary files /dev/null and b/app/release/app beta 2.0-26july.apk differ diff --git a/app/release/app beta 2.0-5 aug.apk b/app/release/app beta 2.0-5 aug.apk new file mode 100755 index 0000000000..7b9e53f01c Binary files /dev/null and b/app/release/app beta 2.0-5 aug.apk differ diff --git a/app/release/app beta 2.0-5aug.apk b/app/release/app beta 2.0-5aug.apk new file mode 100755 index 0000000000..ce8c5374a0 Binary files /dev/null and b/app/release/app beta 2.0-5aug.apk differ diff --git a/app/release/app beta 2.0-8 aug.apk b/app/release/app beta 2.0-8 aug.apk new file mode 100755 index 0000000000..29c9c8a5f4 Binary files /dev/null and b/app/release/app beta 2.0-8 aug.apk differ diff --git a/app/release/app beta2.0 -27 sep.apk b/app/release/app beta2.0 -27 sep.apk new file mode 100644 index 0000000000..799f83ddfd Binary files /dev/null and b/app/release/app beta2.0 -27 sep.apk differ diff --git a/app/release/app beta2.0-23july.apk b/app/release/app beta2.0-23july.apk new file mode 100755 index 0000000000..bbecec63b3 Binary files /dev/null and b/app/release/app beta2.0-23july.apk differ diff --git a/app/release/app beta2.0-9oct.apk b/app/release/app beta2.0-9oct.apk new file mode 100644 index 0000000000..75f8dd4ccd Binary files /dev/null and b/app/release/app beta2.0-9oct.apk differ diff --git a/app/release/jun7release.apk b/app/release/jun7release.apk new file mode 100755 index 0000000000..75ebb465de Binary files /dev/null and b/app/release/jun7release.apk differ diff --git a/app/release/may1sprintrelease1.apk b/app/release/may1sprintrelease1.apk old mode 100644 new mode 100755 diff --git a/app/release/may29.apk b/app/release/may29.apk new file mode 100755 index 0000000000..5fcf2a194e Binary files /dev/null and b/app/release/may29.apk differ diff --git a/app/release/mon8julrelease.apk b/app/release/mon8julrelease.apk new file mode 100755 index 0000000000..8a6cbc8b37 Binary files /dev/null and b/app/release/mon8julrelease.apk differ diff --git a/app/release/newversion.apk b/app/release/newversion.apk new file mode 100755 index 0000000000..fee7fb1870 Binary files /dev/null and b/app/release/newversion.apk differ diff --git a/app/release/output.json b/app/release/output.json old mode 100644 new mode 100755 index 450f7fa6fd..5a7c65b086 --- a/app/release/output.json +++ b/app/release/output.json @@ -6,8 +6,8 @@ "apkData": { "type": "MAIN", "splits": [], - "versionCode": 27, - "versionName": "version 2.0 beta 1", + "versionCode": 29, + "versionName": "version 2.0 beta 4", "enabled": true, "outputFile": "app-release.apk", "fullName": "release", diff --git a/app/src/androidTest/java/io/intelehealth/client/ExampleInstrumentedTest.java b/app/src/androidTest/java/io/intelehealth/client/ExampleInstrumentedTest.java old mode 100644 new mode 100755 diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml old mode 100644 new mode 100755 diff --git a/app/src/main/assets/config.json b/app/src/main/assets/config.json new file mode 100644 index 0000000000..61c75c1ed1 --- /dev/null +++ b/app/src/main/assets/config.json @@ -0,0 +1,86 @@ +{ + "mFirstName": true, + "mMiddleName": true, + "mLastName": true, + "mGenderM": true, + "mGenderF": true, + "mDOB": true, + "mAge": true, + "mPhoneNum": true, + "mCountry": "India", + "countryText": true, + "mState": "", + "stateText": true, + "mCity": true, + "mAddress1": true, + "mAddress2": true, + "mOccupation": true, + "casteLayout": true, + "educationLayout": true, + "economicLayout": true, + "mPostal": true, + "countryStateLayout": true, + "mRelationship": true, + "mHeight": true, + "mWeight": true, + "mPulse": true, + "mBpSys": true, + "mBpDia": true, + "mTemperature": true, + "mCelsius": true, + "mFahrenheit": false, + "mSpo2": true, + "mBMI": true, + "mResp": true, + "privacyNotice": true, + "privacyNoticeText": "Privacy notice and consent form for patients + +Personal Information +We collect the following personal information from you when the health-worker meets you at the clinic location or on home visits: +● Full name +● Gender +● Date of birth +● Home address +● Email address +● Contact numbers +● Health information – height, weight, blood type, blood pressure, medical history, allergy information, and other diagnostic information as required + +Use +Your medical records and other personal data will be processed in compliance with the relevant Data Privacy Act, and its Implementing Rules and Regulations of the jurisdiction where your data is collected. + +Your information is used for diagnosing and treating you. + +Your contact information may be used to +• send you reminders +• prescription information, +• other related communication. + +In addition, your personal information will be anonymized for use in research, disease monitoring, and analysis to help us improve our products and services. Anonymization removes your identifying information and protects your privacy. + +We may disclose your personal information: +● as required by law, such as to comply with a subpoena, or similar legal process; +● when we believe in good faith that disclosure is necessary to protect our rights, protect your safety or the safety of others, investigate fraud, or respond to a government request; +● with our trusted services providers who work on our behalf, do not have an independent use of the information we disclose to them, and have agreed to adhere to our privacy policy. +● if Intelehealth, Inc. is involved in a merger, acquisition, or sale of all or a portion of its assets, you will be notified via email and/or a prominent notice on our website of any change in ownership or uses of this information, as well as any choices you may have regarding this information. + +Protection Measures +• We provide physical, electronic, and procedural safeguards to protect information we process and maintain. +• Only authorized personnel have access to your personal information. If a transfer of information is required, the exchange of which will be facilitated through email or hard copy. Digital files will be encrypted and/or password-protected before such transfers. +• Personal data records will be stored in a secure database for the period of our contract to provide these services, after which any physical records shall be disposed of through shredding, while digital files shall be anonymized. + +Access and Correction +You have the right to ask for a copy of any personal information we hold about you, as well as to ask for it to be corrected if you think it is wrong. + +If you’d like us to delete your personal data that you have provided to us, please contact us at support@intelehealth.io and we will respond in a reasonable time. + +To make any requests for access, modification, or deletion of your personal information with us, please contact the Data Privacy Officer, at support@intelehealth.io + +On clicking “Accept”, I consent to the collection and use of my personal data, including health information, and to give access to the above-mentioned entities. +", + + "privacyNoticeText_Cebuano" : "", + +"privacyNoticeText_Odiya" : "", + "presciptionHeader1": "Philippines Telemedicine Project", + "presciptionHeader2": "ePrescription" +} \ No newline at end of file diff --git a/app/src/main/assets/engines/Abdominal Pain.json b/app/src/main/assets/engines/Abdominal Pain.json new file mode 100644 index 0000000000..ecd366a52a --- /dev/null +++ b/app/src/main/assets/engines/Abdominal Pain.json @@ -0,0 +1,624 @@ +{ + "id": "ID_1000991358", + "text": "Abdominal Pain", + "perform-physical-exam": "Abdomen:Scars;Abdomen:Distension;Abdomen:Tenderness;Abdomen:Lumps;Physical Growth:Sexual Maturation;", + "display-or": "ପେଟଯନ୍ତ୍ରଣା", + "options": [ + { + "id": "ID_210551359", + "text": "Site", + "display": "Which part of the abdomen do you feel pain?", + "display-or": "କୋଉଯାଗାରେ", + "options": [ + { + "id": "ID_1935801557", + "text": "Upper (R) - Right Hypochondrium", + "display-or": "ଡାହାଣ ଉପରକୁ" + }, + { + "id": "ID_845387253", + "text": "Upper (C) - Epigastric", + "display-or": "ନାଭି ଉପରକୁ" + }, + { + "id": "ID_1036073432", + "text": "Upper (L) - Left Hypochondrium", + "display-or": "ବାମ ଉପରକୁ" + }, + { + "id": "ID_568631554", + "text": "Middle (R) - Right Lumbar", + "display-or": "ଡ଼ାହାଣ ମଝି" + }, + { + "id": "ID_962169419", + "text": "Middle (C) - Umbilical", + "display-or": "ନାଭି ଚାରିକଡ଼େ" + }, + { + "id": "ID_1324037145", + "text": "Middle (L) - Left Lumbar", + "display-or": "ବାମ ମଝି" + }, + { + "id": "ID_1239783765", + "text": "Lower (R) - Right Illiac Fossa", + "display-or": "ଡ଼ାହାଣ ତଳ" + }, + { + "id": "ID_644410306", + "text": "Lower (C) - Hypogastric/Suprapubic", + "display-or": "ନାଭି ତଳକୁ" + }, + { + "id": "ID_562710446", + "text": "Lower (R) - Left Illiac Fossa", + "display-or": "ବାମ ତଳ" + }, + { + "id": "ID_917293565", + "text": "All over", + "display-or": "ଚାରିଅାଡ଼େ" + } + ] + }, + { + "id": "ID_334440965", + "text": "Radiation", + "display": "Does the pain move to other parts of the body?", + "display-or": "ଯନ୍ତ୍ରଣା ଅନ୍ୟ ଜାଗା ଯାଉଛି", + "language": "%", + "options": [ + { + "id": "ID_1457415162", + "text": "Does not move", + "language": "Pain does not radiate", + "display-or": "ନାହିଁ, ଯଦିହିଁ" + }, + { + "id": "ID_1228815375", + "text": "Pain radiates to", + "display-or": "ଦରଜ ଗତି କରୁଛି?", + "options": [ + { + "id": "ID_758995804", + "text": "Upper (R) - Right Hypochondrium", + "display-or": "ଡାହାଣ ଉପରକୁ" + }, + { + "id": "ID_1252297295", + "text": "Upper (C) - Epigastric", + "display-or": "ନାଭି ଉପରକୁ" + }, + { + "id": "ID_498017375", + "text": "Upper (L) - Left Hypochondrium", + "display-or": "ବାମ ଉପରକୁ" + }, + { + "id": "ID_137477881", + "text": "Middle (R) - Right Lumbar", + "display-or": "ଡ଼ାହାଣ ମଝି" + }, + { + "id": "ID_150225290", + "text": "Middle (C) - Umbilical", + "display-or": "ନାଭି ଚାରିକଡ଼େ" + }, + { + "id": "ID_1960997639", + "text": "Middle (L) - Left Lumbar", + "display-or": "ବାମ ମଝି" + }, + { + "id": "ID_477522154", + "text": "Lower (R) - Right Illiac Fossa", + "display-or": "ଡ଼ାହାଣ ତଳ" + }, + { + "id": "ID_1692350292", + "text": "Lower (C) - Hypogastric/Suprapubic", + "display-or": "ସମ ନାଭି ତଳକୁ" + }, + { + "id": "ID_1565049622", + "text": "Lower (R) - Left Illiac Fossa", + "display-or": "ବାମ ତଳ" + }, + { + "id": "ID_622263949", + "text": "Right shoulder", + "display-or": "ଡ଼ାହାଣ କାନ୍ଧ" + }, + { + "id": "ID_128266450", + "text": "Right scapula", + "display-or": "ଡ଼ାହାଣ ଖୁଅା" + }, + { + "id": "ID_346840033", + "text": "Groin", + "display-or": "ଜଘଂ ସନ୍ଧି" + }, + { + "id": "ID_580405108", + "text": "Sacral region", + "display-or": "ପିଚାା" + }, + { + "id": "ID_957000739", + "text": "Flanks", + "display-or": "ପେଟ ପୋଡା" + }, + { + "id": "ID_1183788319", + "text": "Chest", + "display-or": "ଛାତି" + } + ] + } + ] + }, + { + "id": "ID_313791833", + "text": "Duration", + "display": "Since when have you had this symptom?", + "display-or": "କେବେଠାରୁ", + "language": "%", + "options": [ + { + "id": "ID_826155781", + "text": "[Enter since when]", + "input-type": "duration", + "language": "since", + "display-or": "କେବେ ଠାରୁ ଲେଖ" + } + ] + }, + { + "id": "ID_374306869", + "text": "Onset", + "display": "How did the pain start?", + "display-or": "କେମିତି ଅାରମ୍ଭ ହେଲା", + "options": [ + { + "id": "ID_1052994247", + "text": "Gradual", + "display-or": "ଅାସ୍ତେ ଅାସ୍ତେ" + }, + { + "id": "ID_467135839", + "text": "Rapidly increasing", + "display-or": "ସାଙ୍ଗେ ସାଙ୍ଗେ" + }, + { + "id": "ID_1466867687", + "text": "Sudden", + "display-or": "ହଠାତ୍" + }, + { + "id": "ID_1906994892", + "text": "Other [describe]", + "input-type": "text", + "language": "%", + "display-or": "ଅନ୍ୟାନ୍ୟ (ବର୍ଣନା କର)" + } + ] + }, + { + "id": "ID_1026022834", + "text": "Timing", + "display": "What time of the day do you feel the pain?", + "display-or": "ଦିନ ର କେଉଁ ସମୟ ରେ ଦରଜ ହୋଉ ଛି?", + "options": [ + { + "id": "ID_1291573791", + "text": "Morning", + "display-or": "ସକାଳ" + }, + { + "id": "ID_1360001530", + "text": "Night", + "display-or": "ରାତି" + }, + { + "id": "ID_1637651626", + "text": "Not linked to any particular time of day", + "display-or": "ସମୟ ସହ ସମ୍ପର୍କ ନାହିଁ" + }, + { + "id": "ID_247362287", + "text": "Other [Describe]", + "input-type": "text", + "language": "%", + "display-or": "ଅନ୍ୟାନ୍ୟ (ବର୍ଣନା କର)" + } + ] + }, + { + "id": "ID_1719879342", + "text": "Character of the pain", + "display-or": "କେଉଁ ପ୍ରକାର", + "options": [ + { + "id": "ID_1639883399", + "text": "Constant", + "display-or": "ସବୁ ସମୟରେ" + }, + { + "id": "ID_839389482", + "text": "Colicky / Intermittent (comes & goes)", + "display-or": "ବେଳେ ବେଳେ" + }, + { + "id": "ID_640171637", + "text": "Gnawing/chewing", + "display-or": "ଚିପିଲା ପରି" + }, + { + "id": "ID_492112592", + "text": "Cramping", + "display-or": "କାମୁଡ଼ିଲା ପରି" + }, + { + "id": "ID_1454167791", + "text": "Dull, aching", + "display-or": "ଅାସ୍ତେ ଅାସ୍ତେ" + }, + { + "id": "ID_460419502", + "text": "Other [describe]", + "input-type": "text", + "language": "%", + "display-or": "ଅନ୍ୟାନ୍ୟ (ବର୍ଣନା କର)" + } + ] + }, + { + "id": "ID_88181483", + "text": "Severity", + "display": "How severe is the pain?", + "display-or": "କେତେ ଯୋରରେ", + "options": [ + { + "id": "ID_277668181", + "text": "Mild, 1-3", + "display-or": "1-3 ଅଳ୍ପ" + }, + { + "id": "ID_279688978", + "text": "Moderate, 4-6", + "display-or": "4-6 ମଧ୍ୟମ" + }, + { + "id": "ID_1018371251", + "text": "Severe, 7-9", + "display-or": "7-9 ବହୁତ" + }, + { + "id": "ID_1999276601", + "text": "Very Severe, 10", + "display-or": "10 ବହୁତ ଯୋରରେ" + } + ] + }, + { + "id": "ID_294177528", + "text": "Associated symptoms", + "display": "Do you have the following symptom(s)?", + "display-or": "ତମର ଏହି ଲକ୍ଷଣ ସବୁ ଅଛି କି?", + "pos-condition": "c.", + "neg-condition": "s.", + "options": [ + { + "id": "ID_1516120181", + "text": "Nausea", + "display-or": "ବାନ୍ତି ଲାଗିବା" + }, + { + "id": "ID_1126058800", + "text": "Vomiting", + "display-or": "ବାନ୍ତି ହେବା" + }, + { + "id": "ID_1985768122", + "text": "Anorexia", + "display-or": "ଭୋକ ନ ଲାଗିବା" + }, + { + "id": "ID_1147187284", + "text": "Diarrhoea", + "display-or": "ଝାଡ଼ା ହେବା" + }, + { + "id": "ID_966543680", + "text": "Constipation", + "display-or": "କୋଷ୍ଠ କାଠିନ୍ଯ" + }, + { + "id": "ID_74520590", + "text": "Fever", + "display-or": "ଜ୍ୱର" + }, + { + "id": "ID_442321642", + "text": "Abdominal distention / Bloating", + "display-or": "ପେଟ ଫମ୍ପାଇବା ବା ଫୁଲେଇବା" + }, + { + "id": "ID_1113713472", + "text": "Belching / Burping", + "display-or": "ପେଟ ମୋଡ଼ି ହବା" + }, + { + "id": "ID_1105381776", + "text": "Flatulence", + "display-or": "ବାୟୁ" + }, + { + "id": "ID_1045478269", + "text": "Change in appetite", + "language": "%", + "display-or": "ଭୁକରେ ପରିବର୍ତନ", + "options": [ + { + "id": "ID_99335376", + "text": "Increased", + "language": "Increase in appetite", + "display-or": "ବଢ଼ିଛି" + }, + { + "id": "ID_1103933462", + "text": "Decreased", + "language": "Decrease in appetite", + "display-or": "କମିଛି" + } + ] + }, + { + "id": "ID_1091296053", + "text": "Color change in stool [describe]", + "input-type": "text", + "display-or": "ଝାଡା ର ରଂଗ ପରିବର୍ତନ (ବର୍ଣନା କର)" + }, + { + "id": "ID_1597444506", + "text": "Blood in stool", + "display-or": "ଝାଡ଼ାରେ ରକ୍ତ" + }, + { + "id": "ID_330292438", + "text": "Change in frequency of urinating [describe]", + "input-type": "text", + "display-or": "ମୂତ୍ର ରେ ଆବୃତି ରେ ପରିବର୍ତନ (ବର୍ଣନା କର)" + }, + { + "id": "ID_1019342392", + "text": "Color change in urine [describe]", + "input-type": "text", + "display-or": "ଋଙ୍ଗ ପରିବର୍ତନ (ବର୍ଣନା କର)" + }, + { + "id": "ID_324285652", + "text": "Hiccups", + "display-or": "ହକୁଡ଼ି" + }, + { + "id": "ID_576443230", + "text": "Restlessness", + "display-or": "ଅଣନିଶ୍ୱାସ" + }, + { + "id": "ID_491498670", + "text": "Injury", + "display-or": "ଖଣ୍ଡିଅା ହୋଇଛି" + }, + { + "id": "ID_6543523", + "text": "Others [describe]", + "input-type": "text", + "language": "%", + "display-or": "ଅନ୍ୟାନ୍ୟ (ବର୍ଣନା କର)" + } + ] + }, + { + "id": "ID_1343783907", + "text": "Exacerbating Factors", + "display": "Does the pain get worse with the following situations?", + "display-or": "ନିଁନ୍ମ ଲିଖିତ ଅବସ୍ଥା ରେ ଯନ୍ତ୍ରଣା କମି ଯାଏ କି?", + "options": [ + { + "id": "ID_529298614", + "text": "Hunger", + "display-or": "ଭୋକ ସହିତ" + }, + { + "id": "ID_884486009", + "text": "Food", + "display-or": "ଖାଇବା ବେଳେ" + }, + { + "id": "ID_1552008107", + "text": "Urination", + "display-or": "ପରିସ୍ରା ବେଳେ" + }, + { + "id": "ID_1112583071", + "text": "Pressure", + "display-or": "ଚାପି ଦେଲେ" + }, + { + "id": "ID_953323975", + "text": "Movement", + "display-or": "ଗତି କଲେ" + }, + { + "id": "ID_267946733", + "text": "Coughing", + "display-or": "କାସ ହେଲେ" + }, + { + "id": "ID_1947537413", + "text": "Straining", + "display-or": "କୁନ୍ଥେଇଲେ" + }, + { + "id": "ID_767780670", + "text": "Other [describe]", + "input-type": "text", + "language": "%", + "display-or": "ଅନ୍ୟାନ୍ୟ (ବର୍ଣନା କର)" + }, + { + "id": "ID_1794978958", + "text": "None", + "display-or": "କିଛି ନକଲେ/ ମନା" + }, + { + "id": "ID_1955648297", + "text": "Don't know/Unsure", + "language": "Patient did not know/was unsure", + "display-or": "ଜାଣୁ ନଥିଲା/ ନିଶ୍ଚିତ ନଥିଲା" + } + ] + }, + { + "id": "ID_971905494", + "text": "Relieving Factors", + "display": "Does the pain get better with the following situations?", + "display-or": "ନିଁନ୍ମ ଲିଖିତ ଅବସ୍ଥା ରେ ଯନ୍ତ୍ରଣା ଠିକ ହୁଏ କି?", + "options": [ + { + "id": "ID_1266170702", + "text": "Medications [describe]", + "input-type": "text", + "language": "medications such as", + "display-or": "ଔଷଧ ଦ୍ୱାରା (କେଉଁ ଔଷଧ)" + }, + { + "id": "ID_1774996180", + "text": "Food", + "display-or": "ଖାଦ୍ୟ ଦ୍ୱାରା" + }, + { + "id": "ID_266980448", + "text": "Leaning forward", + "display-or": "ଅାଗକୁୁ ଲଇଁଲେ" + }, + { + "id": "ID_33512499", + "text": "Squatting", + "display-or": "ତୁଙ୍କା ହୋଇ ବସିଲେ" + }, + { + "id": "ID_1168881523", + "text": "Vomiting", + "display-or": "ବାନ୍ତି କଲେ" + }, + { + "id": "ID_79912314", + "text": "Passing of stool", + "display-or": "ଝାଡ଼ା ଗଲେ" + }, + { + "id": "ID_443778764", + "text": "Other [describe]", + "input-type": "text", + "language": "%", + "display-or": "ଅନ୍ୟାନ୍ୟ (ବର୍ଣନା କର)" + }, + { + "id": "ID_1303352427", + "text": "None", + "display-or": "କିଛି ନକଲେ/ ମନା" + }, + { + "id": "ID_1427868891", + "text": "Don't know/Unsure", + "language": "Patient did not know/was unsure", + "display-or": "ଜାଣୁ ନଥିଲା/ ନିଶ୍ଚିତ ନଥିଲା" + } + ] + }, + { + "id": "ID_1004615569", + "text": "Menstrual history", + "display-or": "ମାସିକିଅା ବିବରଣୀ", + "options": [ + { + "id": "ID_1558745378", + "text": "Has not started menstruation", + "display-or": "ଅାରମ୍ଭ ହେଇନି" + }, + { + "id": "ID_518238742", + "text": "Is menstruating", + "display-or": "ମାସିକିଆ ହୋଉ ଛି", + "options": [ + { + "id": "ID_850736876", + "text": "Age at onset ", + "input-type": "number", + "display-or": "କେତେ ବୟସରେ" + }, + { + "id": "ID_1665118762", + "text": "Last menstruation period", + "input-type": "date", + "display-or": "ଶେଷଥର କେବେ ହୋଇଥିଲା", + "language": "LMP" + } + ] + }, + { + "id": "ID_1420686231", + "text": "Menopause", + "display-or": "ମାସିକିଅା ବନ୍ଦ", + "options": [ + { + "id": "ID_745440603", + "text": "Age at menopause ", + "input-type": "number", + "display-or": "କେବେ ହେଲା" + } + ] + } + ] + }, + { + "id": "ID_573035068", + "text": "Prior treatment sought", + "display": "Have you taken any treatment (including self-medication or home remedies) or seen any health provider for this problem before coming here today?", + "display-or": "ତମେ ଆଗରୁ କୌଣସି ପ୍ରାକାର ଔଷଦ ନଇଥିଲ କି? (ନିଜେ ସ୍ୱାସ୍ଥ୍ୟ ଏବଂ ଘରୋଇ ଉପଚାର)", + "options": [ + { + "id": "ID_1763201920", + "text": "Yes [Describe]", + "input-type": "text", + "language": "%", + "display-or": "ହାଁ (ବର୍ଣନା କର)" + }, + { + "id": "ID_1226925547", + "text": "None", + "display-or": "କିଛି ନାହିଁ" + } + ] + }, + { + "id": "ID_1065741634", + "text": "Additional information", + "display-or": "ଅତିରିକ୍ତ ସୂଚନା", + "options": [ + { + "id": "ID_1894895710", + "text": "[Enter additional information]", + "input-type": "text", + "language": "%", + "display-or": "ଅତିରିକ୍ତ ସୂଚନା ପ୍ରଦାନ କରିବା" + } + ] + } + ] +} \ No newline at end of file diff --git a/app/src/main/assets/engines/Back & Neck pain.json b/app/src/main/assets/engines/Back & Neck pain.json new file mode 100644 index 0000000000..a0145e04f4 --- /dev/null +++ b/app/src/main/assets/engines/Back & Neck pain.json @@ -0,0 +1,428 @@ +{ + "id": "ID_844006222", + "text": "Back & Neck pain", + "perform-physical-exam": "Leg:Movement;Leg:Strength;Back:Deformity;Back:Tenderness;Back:Redness;Back:Swelling;Back:Movement;", + "display-or": "ପିଠି ଓ ବେକ ଯନ୍ତ୍ରଣା", + "options": [ + { + "id": "ID_313791833", + "text": "Duration", + "display": "Since when have you had this symptom?", + "display-or": "କେବେଠାରୁ", + "language": "%", + "options": [ + { + "id": "ID_826155781", + "text": "[Enter since when]", + "input-type": "duration", + "language": "Since", + "display-or": "କେବେ ଠାରୁ ଲେଖ" + } + ] + }, + { + "id": "ID_1731524131", + "text": "Site", + "display": "Which part of the neck/back do you feel pain?", + "display-or": "କୋଉ ଯାଗା", + "options": [ + { + "id": "ID_1065573307", + "text": "Neck", + "display-or": "ବେକ" + }, + { + "id": "ID_860011135", + "text": "Upper back (Chest level)", + "display-or": "ଉପର ପିଠି" + }, + { + "id": "ID_428565875", + "text": "Lower back", + "display-or": "ତଳ ପିଠି" + }, + { + "id": "ID_153009314", + "text": "Other (Describe)", + "input-type": "text", + "language": "%", + "display-or": "ଅନ୍ୟାନ୍ୟ (ବର୍ଣନା କର)" + } + ] + }, + { + "id": "ID_1755024985", + "text": "Radiation", + "display": "Does the pain go anywhere?", + "display-or": "ଯନ୍ତ୍ରଣା ଅନ୍ୟ ଜାଗା ଯାଉଛି", + "language": "%", + "options": [ + { + "id": "ID_206032917", + "text": "Yes", + "language": "Pain radiates to", + "display-or": "ହଁ", + "options": [ + { + "id": "ID_1119894651", + "text": "Which side", + "language": "%", + "display-or": "କେଉଁ ଜାଗା ରେ?", + "options": [ + { + "id": "ID_1544169529", + "text": "Left side", + "display-or": "ଡାହାଣ" + }, + { + "id": "ID_553825199", + "text": "Right side", + "display-or": "ବାମ" + }, + { + "id": "ID_700998927", + "text": "Both sides", + "display-or": "ଉଭୟ" + } + ] + }, + { + "id": "ID_858023894", + "text": "Radiates to ", + "language": "%", + "display-or": "ଏହି ଜାଗା ଗତି କରେ", + "options": [ + { + "id": "ID_1757223199", + "text": "Buttock", + "display-or": "ମଳ ପିଚା" + }, + { + "id": "ID_795034298", + "text": "Legs", + "display-or": "ଗୋଡ଼" + }, + { + "id": "ID_1003802391", + "text": "Arms", + "display-or": "ବାହୁ" + }, + { + "id": "ID_1636167619", + "text": "Abdomen", + "display-or": "ପେଟ" + }, + { + "id": "ID_1321533395", + "text": "Other (Describe)", + "input-type": "text", + "language": "%", + "display-or": "ଅନ୍ୟାନ୍ୟ (ବର୍ଣନା କର)" + } + ] + } + ] + }, + { + "id": "ID_719881950", + "text": "No", + "language": "Pain does not radiate", + "display-or": "ନାଁ" + } + ] + }, + { + "id": "ID_877218212", + "text": "Timing", + "display": "In a day, when do you feel pain the most?", + "display-or": "ଦିନରେ କେତେବେଳେ ବେଶୀ ହୁଏ", + "options": [ + { + "id": "ID_1638634219", + "text": "Morning", + "display-or": "ସକାଳ" + }, + { + "id": "ID_63012444", + "text": "Evening", + "display-or": "ସନ୍ଧ୍ଯାରେ" + }, + { + "id": "ID_190407049", + "text": "Night", + "display-or": "ରାତି" + }, + { + "id": "ID_1302174966", + "text": "Constant", + "display-or": "ସବୁବେଳେ" + }, + { + "id": "ID_383896745", + "text": "Other(Describe)", + "input-type": "text", + "language": "%", + "display-or": "ଅନ୍ୟାନ୍ୟ (ବର୍ଣନା କର)" + } + ] + }, + { + "id": "ID_1900307893", + "text": "Experience of heavy lifting/twisting", + "display": "Have you lifted a heavy object or twisted your back/neck?", + "display-or": "ହଠାତ୍ ଓଜନିଅା ଜିନିଷ ଉଠେଇବା", + "language": "%", + "options": [ + { + "id": "ID_1641578583", + "text": "Yes", + "display-or": "ହଁ", + "language": "Patient has recently lifted heavy objects or twisted their back/neck" + }, + { + "id": "ID_1862613985", + "text": "No", + "display-or": "ନାଁ", + "language": "Patient has no recent h/o lifting heavy objects or twisting their back/neck" + } + ] + }, + { + "id": "ID_880975242", + "text": "Aggravating factor(s)", + "display": "Do(es) the following(s) make your symptom worse?", + "display-or": "ଉପରୁକ୍ତ ଦ୍ୱାରା ଲକ୍ଷଣ ସବୁ ବଢ଼ୁ ଛି କି?", + "options": [ + { + "id": "ID_1472978738", + "text": "Postural change", + "display-or": "ବସା ଉଠା କଲେ", + "language": "Postural change" + }, + { + "id": "ID_1999015442", + "text": "Cough/sneezing", + "display-or": "କାସିଲେ ବା ଛିଙ୍କିଲେ" + }, + { + "id": "ID_1868450180", + "text": "Activities", + "language": "Activity", + "display-or": "କାମ କଲେ", + "options": [ + { + "id": "ID_160076589", + "text": "[Describe activities]", + "language": "like", + "display-or": "ବର୍ଣନା କର", + "input-type": "text" + } + ] + }, + { + "id": "ID_169891635", + "text": "Pain worse at rest", + "display-or": "ସ୍ଥିର ଥିବା ାବ ହୁଏ" + }, + { + "id": "ID_1794978958", + "text": "None", + "display-or": "କିଛି ନକଲେ/ ମନା" + }, + { + "id": "ID_1955648297", + "text": "Don't know/Unsure", + "language": "Patient did not know/was unsure", + "display-or": "ଜାଣୁ ନଥିଲା/ ନିଶ୍ଚିତ ନଥିଲା" + } + ] + }, + { + "id": "ID_1652156031", + "text": "Associated symptoms", + "display": "Do you have the following symptom(s)?", + "display-or": "ଏପରି ଲକ୍ଷଣ", + "pos-condition": "c.", + "neg-condition": "s.", + "options": [ + { + "id": "ID_338751766", + "text": "Numbness/Weakness affecting one or both leg", + "display-or": "କ୍ଷରଶ ବଧିରା ବା ଦୁର୍ବଳ ଲାଗିବା", + "options": [ + { + "id": "ID_1651887547", + "text": "Right leg", + "display-or": "ଡ଼ାହାଣ ଗୋଡ଼" + }, + { + "id": "ID_4553325", + "text": "Left leg", + "display-or": "ବାମ ଗୋଡ଼" + }, + { + "id": "ID_1433694719", + "text": "Both legs", + "display-or": "ଦୁଇ ଗୋଡ଼" + }, + { + "id": "ID_776389291", + "text": "None", + "display-or": "ନାହିଁ" + } + ] + }, + { + "id": "ID_1103014075", + "text": "Urinary incontinence", + "display-or": "ପରିସ୍ରା ନ ରହିବା", + "display": "Involuntary passing of urine/Urine leakage" + }, + { + "id": "ID_1318383888", + "text": "Gait disturbance", + "display-or": "ଚାଲିବାରେ ଅସୁବିଧା" + }, + { + "id": "ID_1843499401", + "text": "Muscle spasm", + "display-or": "ମାଂସପେଶୀ ଦରଜ" + }, + { + "id": "ID_715672211", + "text": "Fever", + "display-or": "ଜ୍ୱର" + }, + { + "id": "ID_1080197761", + "text": "Sweat", + "display-or": "ଝାଳ" + }, + { + "id": "ID_440858661", + "text": "Weight loss", + "display-or": "ଓଜନ ହ୍ରାସ", + "options": [ + { + "id": "ID_529191460", + "text": "[Enter amount of weight lost (kg)]", + "input-type": "number", + "language": "amount of weight lost in kgs", + "display-or": "(ଓଜନ ହ୍ରାସ ପରିମାଣ)" + } + ] + }, + { + "id": "ID_1957174317", + "text": "Abdominal pain", + "perform-physical-exam": "Abdomen:Tenderness;Abdomen:Lumps;", + "display-or": "ପେଟ ଯନ୍ତ୍ରଣା" + }, + { + "id": "ID_1417664586", + "text": "Headache", + "display-or": "ମୁଣ୍ଡବିନ୍ଧା" + }, + { + "id": "ID_1990064224", + "text": "Depressed mood", + "display-or": "ମାନସିକ ଅବଷାଦ" + }, + { + "id": "ID_1845304522", + "text": "Anxiety", + "display-or": "ରାଗ ଲାଗିବା" + }, + { + "id": "ID_485544343", + "text": "Other (Describe)", + "input-type": "text", + "language": "%", + "display-or": "ଅନ୍ୟାନ୍ୟ (ବର୍ଣନା କର)" + } + ] + }, + { + "id": "ID_549649173", + "text": "H/o specific illness", + "display": "Have you ever been diagnosed with any of the following specific diseases?", + "display-or": "ତମେ କେବେ ଆଗରୁ ଏହି ବିଶିଷ୍ଟ ରୋଗ ର ଲକ୍ଷସହାନ ଦେଖେଇ ଥିଲ କି?", + "pos-condition": "h/o", + "neg-condition": "no h/o", + "options": [ + { + "id": "ID_1600652916", + "text": "HIV/AIDS", + "display-or": "ଏଡ୍ସ" + }, + { + "id": "ID_1350554066", + "text": "Trauma history", + "display-or": "ଅାଘାତ / ଦୁର୍ଘଟଣା", + "options": [ + { + "id": "ID_1688286619", + "text": "When", + "input-type": "date", + "language": "on", + "display-or": "କେବେ" + }, + { + "id": "ID_1817538464", + "text": "Involved area", + "display-or": "କୋଉ ଯାଗା", + "options": [ + { + "id": "ID_1978862710", + "text": "Back & Neck", + "display-or": "ପିଠି ଓ ବେକ" + }, + { + "id": "ID_771155446", + "text": "Other (Describe)", + "input-type": "text", + "language": "%", + "display-or": "ଅନ୍ୟାନ୍ୟ (ବର୍ଣନା କର)" + } + ] + } + ] + } + ] + }, + { + "id": "ID_573035068", + "text": "Prior treatment sought", + "display": "Have you taken any treatment (including self-medication or home remedies) or seen any health provider for this problem before coming here today?", + "display-or": "ତମେ ଆଗରୁ କୌଣସି ପ୍ରାକାର ଔଷଦ ନଇଥିଲ କି? (ନିଜେ ସ୍ୱାସ୍ଥ୍ୟ ଏବଂ ଘରୋଇ ଉପଚାର)", + "options": [ + { + "id": "ID_1763201920", + "text": "Yes [Describe]", + "input-type": "text", + "language": "%", + "display-or": "ହାଁ (ବର୍ଣନା କର)" + }, + { + "id": "ID_1226925547", + "text": "None", + "display-or": "କିଛି ନାହିଁ" + } + ] + }, + { + "id": "ID_1962864824", + "text": "Additional information", + "display-or": "ଅତିରିକ୍ତ ସୂଚନା", + "options": [ + { + "id": "ID_239409896", + "text": "[Enter additional information]", + "input-type": "text", + "language": "%", + "display-or": "ଅତିରିକ୍ତ ସୂଚନା ପ୍ରଦାନ କରିବା" + } + ] + } + ] +} \ No newline at end of file diff --git a/app/src/main/assets/engines/Diarrhea.json b/app/src/main/assets/engines/Diarrhea.json new file mode 100644 index 0000000000..db0454a97a --- /dev/null +++ b/app/src/main/assets/engines/Diarrhea.json @@ -0,0 +1,189 @@ +{ + "id": "ID_1609227579", + "text": "Diarrhea", + "perform-physical-exam": "Arm:Lying BP;Mouth:Tongue Dryness;Abdomen:Tenderness;Abdomen:Lumps;", + "display-or": "ପତଳା ଝାଡ଼ା", + "options": [ + { + "id": "ID_313791833", + "text": "Duration", + "display": "Since when have you had this symptom?", + "display-or": "କେବେଠାରୁ", + "options": [ + { + "id": "ID_1786426130", + "text": "[Enter since when]", + "input-type": "duration", + "language": "since", + "display-or": "କେବେ ଠାରୁ ଲେଖ" + } + ] + }, + { + "id": "ID_1442984979", + "text": "Type of stool", + "display-or": "ପ୍ରକାର", + "options": [ + { + "id": "ID_198180342", + "text": "Watery", + "display-or": "ପାଣିଅା" + }, + { + "id": "ID_55890314", + "text": "Mucous", + "display-or": "ଲାଳୁଅା" + }, + { + "id": "ID_1403055651", + "text": "Formed/lumpy feces", + "display-or": "ଝାଡ଼ା ଠିକ୍" + } + ] + }, + { + "id": "ID_452844637", + "text": "Associated symptoms", + "display": "Do you have the following symptom(s)?", + "display-or": "ଅନ୍ଯ ଲକ୍ଷଣ", + "pos-condition": "c.", + "neg-condition": "s.", + "options": [ + { + "id": "ID_581139002", + "text": "Vomiting", + "display-or": "ବାନ୍ତି" + }, + { + "id": "ID_152322033", + "text": "Fever", + "display-or": "ଜ୍ୱର" + }, + { + "id": "ID_1707274166", + "text": "Abdominal Pain", + "display-or": "ପେଟ ଯନ୍ତ୍ରଣା", + "options": [ + { + "id": "ID_1622248186", + "text": "Is the abdominal pain associated with specific food?", + "display-or": "କୋଣସି ଖାଦ୍ୟ ଦ୍ବାରା", + "language": "%", + "options": [ + { + "id": "ID_986881512", + "text": "Yes", + "language": "Associated withi specific foods", + "display-or": "ହଁ" + }, + { + "id": "ID_601116444", + "text": "No", + "language": "Not associated with specific foods", + "display-or": "ନା" + } + ] + }, + { + "id": "ID_1353996130", + "text": "Is the abdominal pain associated with bowel movements?", + "language": "%", + "display-or": "ଝାଡା ହେବା ଦ୍ଵାରା", + "options": [ + { + "id": "ID_1897293133", + "text": "No association with bowel movements", + "display-or": "ନାହିଁ" + }, + { + "id": "ID_370262093", + "text": "Pain occurs before bowel movement", + "display-or": "ଝାଡ଼ା ପୂର୍ବରୁ" + }, + { + "id": "ID_158297779", + "text": "Pain occurs after bowel movement", + "display-or": "ଝାଡ଼ା ପରେ" + } + ] + } + ] + }, + { + "id": "ID_926225316", + "text": "Bloating", + "display-or": "ପେଟ ଫାମ୍ପେଇବା" + }, + { + "id": "ID_329499595", + "text": "Hematochezia", + "display": "Blood in stool", + "display-or": "ଝାଡ଼ାରେ ରକ୍ତ" + } + ] + }, + { + "id": "ID_530974936", + "text": "Have you experienced any indigestion of unusual food/liquid within the previous months before diarrhea started?", + "display-or": "ପତଳା ଝାଡା ଆରମ୍ଭ ପୂର୍ଵରୁ ଖାଦ୍ୟ ହଜମ ହୋଇ ନଥିଲା କି?", + "language": "%", + "options": [ + { + "id": "ID_640010371", + "text": "Yes", + "language": "Patient has experienced indigestion within the previous months before diarrhea started", + "display-or": "ହାଁ", + "options": [ + { + "id": "ID_1219994553", + "text": "when", + "input-type": "date", + "language": "Occured on", + "display-or": "କେବେ" + } + ] + }, + { + "id": "ID_146905266", + "text": "No", + "language": "No experience of indigestion within the previous months before diarrhea started", + "display-or": "ନାହିଁ" + } + ] + }, + { + "id": "ID_811421813", + "text": "Prior treatment sought", + "display": "Have you taken any treatment (including self-medication or home remedies) or seen any health provider for this problem before coming here today?", + "display-or": "ତମେ ଆଗରୁ କୌଣସି ପ୍ରାକାର ଔଷଦ ନଇଥିଲ କି? (ନିଜେ ସ୍ୱାସ୍ଥ୍ୟ ଏବଂ ଘରୋଇ ଉପଚାର)", + "options": [ + { + "id": "ID_412480003", + "text": "Yes [Describe]", + "input-type": "text", + "language": "%", + "display-or": "ହାଁ (ବର୍ଣନା କର)" + }, + { + "id": "ID_264450220", + "text": "None", + "display-or": "କିଛି ନାହିଁ" + } + ] + }, + { + "id": "ID_1103446377", + "text": "Additional information", + "display-or": "ଅତିରିକ୍ତ ସୂଚନା", + "options": [ + { + "id": "ID_58175367", + "text": "[Enter additional information]", + "input-type": "text", + "language": "%", + "display-or": "ଅତିରିକ୍ତ ସୂଚନା ପ୍ରଦାନ କରିବା" + } + ] + } + ] +} \ No newline at end of file diff --git a/app/src/main/assets/engines/Fever.json b/app/src/main/assets/engines/Fever.json new file mode 100644 index 0000000000..92b17d31c1 --- /dev/null +++ b/app/src/main/assets/engines/Fever.json @@ -0,0 +1,667 @@ +{ + "id": "ID_303783560", + "text": "Fever", + "perform-physical-exam": "Mouth:Back of throat (redness, swelling);Any Location:Skin Rash;Any Location:Ulcer;Abdomen:Tenderness;", + "display-or": "ଜ୍ୱର", + "options": [ + { + "id": "ID_313791833", + "text": "Duration", + "display": "Since when have you had this symptom?", + "display-or": "କେବେଠାରୁ", + "options": [ + { + "id": "ID_826155781", + "text": "[Enter since when]", + "input-type": "duration", + "language": "since", + "display-or": "କେବେଠାରୁ" + } + ] + }, + { + "id": "ID_570262661", + "text": "Nature of fever", + "display-or": "ପ୍ରକାର", + "options": [ + { + "id": "ID_1434989288", + "text": "All day/ Constant", + "display-or": "ପୂରା ଦିନ" + }, + { + "id": "ID_2420513", + "text": "Irregular (comes & goes)", + "display-or": "ଅସମୟରେ ଅାସେ ଓ ଯାଏ" + }, + { + "id": "ID_1877805872", + "text": "Alternate days", + "display-or": "ଦିନେ ଛଡ଼ା ଦିନେ" + }, + { + "id": "ID_1188913049", + "text": "Every few hours", + "display-or": "କିଛି ଘଣ୍ଟାରେ ଥରେ" + }, + { + "id": "ID_881523069", + "text": "Every few days", + "display-or": "କିଛି ଦିନରେ ଥରେ" + }, + { + "id": "ID_99907657", + "text": "Other [describe]", + "input-type": "text", + "language": "%", + "display-or": "ଅନ୍ୟାନ୍ୟ (ବର୍ଣନା କର)" + } + ] + }, + { + "id": "ID_1515765694", + "text": "Timing", + "display": "In a day, when do you feel fever the most?", + "display-or": "ଦିନରେ କେତେବେଳେ", + "options": [ + { + "id": "ID_1012801036", + "text": "All day", + "display-or": "ପୂରା ଦିନ" + }, + { + "id": "ID_1350825896", + "text": "Morning", + "display-or": "ସକାଳେ" + }, + { + "id": "ID_757091275", + "text": "Evening", + "display-or": "ସନ୍ଧ୍ଯାରେ" + }, + { + "id": "ID_1340390501", + "text": "Night", + "display-or": "ରାତିରେ" + }, + { + "id": "ID_1906994892", + "text": "Other [describe]", + "input-type": "text", + "language": "%", + "display-or": "ଅନ୍ୟାନ୍ୟ (ବର୍ଣନା କର)" + } + ] + }, + { + "id": "ID_1234321810", + "text": "Severity", + "display-or": "ମାତ୍ରା", + "options": [ + { + "id": "ID_107199083", + "text": "Low", + "display-or": "କମ" + }, + { + "id": "ID_1269790101", + "text": "Moderate", + "display-or": "ମଧ୍ୟମ" + }, + { + "id": "ID_1406542099", + "text": "High", + "display-or": "ବହୁତ" + }, + { + "id": "ID_489074591", + "text": "Combined high and low", + "display-or": "ବହୁତ, କମ" + }, + { + "id": "ID_739994206", + "text": "Did you recently measure fever using thermometer?", + "language": "%", + "display-or": "ଏବେ ମାପିଥିଲେ", + "options": [ + { + "id": "ID_961113183", + "text": "Yes", + "language": "Patient recently measured fever using a thermometer", + "display-or": "ହଁ", + "options": [ + { + "id": "ID_1919807442", + "text": "When", + "input-type": "date", + "language": "measured on", + "display-or": "କେବେ" + }, + { + "id": "ID_751092164", + "text": "Body Temperature (F)", + "input-type": "number", + "display-or": "ଶରୀର ତାପମାତ୍ରା କେତେ ହୋଇ ଛି" + } + ] + }, + { + "id": "ID_617241106", + "text": "No", + "language": "Patient did not measure their temperature recently", + "display-or": "ନାଁ" + } + ] + } + ] + }, + { + "id": "ID_1422717482", + "text": "Associated symptoms", + "display": "Do you have the following symptom(s)?", + "pos-condition": "c.", + "neg-condition": "s.", + "display-or": "ତମର ଏହି ଲକ୍ଷଣ ସବୁ ଅଛି କି?", + "options": [ + { + "id": "ID_558962385", + "text": "Chills", + "display-or": "ଥଣ୍ଡାରେ ଥରିବା" + }, + { + "id": "ID_157243198", + "text": "Cough", + "display-or": "କାଶ", + "options": [ + { + "id": "ID_1699941000", + "text": "Dry", + "display-or": "ଶୁଖିଲା" + }, + { + "id": "ID_66542167", + "text": "Productive (With sputum)", + "display-or": "କଫି", + "options": [ + { + "id": "ID_40884973", + "text": "Color of sputum", + "display-or": "କଫ ର ରଙ୍ଗ", + "options": [ + { + "id": "ID_134663424", + "text": "Yellow", + "display-or": "ହଳଦିଅା" + }, + { + "id": "ID_504991450", + "text": "Bloody", + "display-or": "ଲାଲ" + }, + { + "id": "ID_1999465218", + "text": "Green", + "display-or": "ସବୁଜ" + } + ] + } + ] + } + ] + }, + { + "id": "ID_1645426383", + "text": "Pain", + "display-or": "ଯନ୍ତ୍ରଣା" + }, + { + "id": "ID_936898754", + "text": "General Weakness", + "display-or": "ଦୁର୍ବଳତା" + }, + { + "id": "ID_235017393", + "text": "Loss of Weight ", + "display-or": "ଓଜନ ହ୍ରାସ", + "options": [ + { + "id": "ID_174062405", + "text": "[Enter amount of weight lost (kgs)]", + "input-type": "number", + "language": "kgs lost", + "display-or": "ଓଜନ ହ୍ରାସ ର ପରିମାଣ" + } + ] + }, + { + "id": "ID_1431006973", + "text": "Night sweats", + "display-or": "ରାତିରେ ଝାଳ" + }, + { + "id": "ID_222702672", + "text": "Chest pain/discomfort", + "display-or": "ଛାତି ଯନ୍ତ୍ରଣା" + }, + { + "id": "ID_1310566684", + "text": "Headache", + "perform-physical-exam": "Head:Injury;Neck:Neck stiffness (Part 1);Neck:Neck stiffness (Part 2);" + }, + { + "id": "ID_851509891", + "text": "Neck stiffness", + "perform-physical-exam": "Head:Injury;Neck:Neck stiffness (Part 1);Neck:Neck stiffness (Part 2);", + "display-or": "ବେକ ଟାଣ" + }, + { + "id": "ID_757040944", + "text": "Diarrhea", + "display-or": "ପତଳା ଝାଡ଼ା" + }, + { + "id": "ID_39019143", + "text": "Nausea/vomiting", + "display-or": "ବାନ୍ତି ଲାଗିବ/ବାନ୍ତି ହେବା" + }, + { + "id": "ID_147125013", + "text": "Abdominal pain", + "display-or": "ପେଟ ଯନ୍ତ୍ରଣା", + "options": [ + { + "id": "ID_844839702", + "text": "Site", + "display": "Which part of the abdomen do you feel pain?", + "display-or": "କେଉଁ ଯାଗା", + "options": [ + { + "id": "ID_1728260319", + "text": "Right upper", + "display-or": "ଡ଼ାହାଣ ଉପର" + }, + { + "id": "ID_295800872", + "text": "Left upper", + "display-or": "ବାମ ଉପର" + }, + { + "id": "ID_1219391815", + "text": "Right lower", + "display-or": "ଡ଼ାହାଣ ତଳ" + }, + { + "id": "ID_1674884611", + "text": "Left lower", + "display-or": "ବାମ ତଳ" + }, + { + "id": "ID_1427243412", + "text": "Periumbilical (Around umbilicus)", + "display-or": "ନାଭି ଚାରିକଡ଼" + }, + { + "id": "ID_483200570", + "text": "Suprapubic (Lower abdomen)", + "display-or": "ତଳ ପେଟ" + }, + { + "id": "ID_1383184737", + "text": "Whole abdomen", + "display-or": "ପୂରା ପେଟପୂରା ପେଟ" + } + ] + }, + { + "id": "ID_1331948149", + "text": "Character", + "display": "Describe the pain", + "display-or": "ଯନ୍ତ୍ରଣା ର ପ୍ରକାର", + "options": [ + { + "id": "ID_1143128376", + "text": "Cramping", + "display-or": "ଐଁଠନ" + }, + { + "id": "ID_520806906", + "text": "Dull", + "display-or": "ଟିକେଟିକେ" + }, + { + "id": "ID_1430702255", + "text": "Aching", + "display-or": "ଧିରେ ଧିରେ" + }, + { + "id": "ID_1114635679", + "text": "Other (Describe)", + "input-type": "text", + "language": "%", + "display-or": "ଅନ୍ୟାନ୍ୟ (ବର୍ଣନା କର)" + } + ] + } + ] + }, + { + "id": "ID_1111135541", + "text": "Jaundice", + "display": "Yellow eyes/skin", + "display-or": "ହଳଦିଅା ଅାଖି ବା ଚର୍ମ", + "options": [ + { + "id": "ID_202931153", + "text": "Since when", + "input-type": "date", + "language": "since", + "display-or": "କେବେଠାରୁ" + } + ] + }, + { + "id": "ID_1891556441", + "text": "Urinary symptoms", + "display-or": "ପରିସ୍ରା ଲକ୍ଷଣ", + "options": [ + { + "id": "ID_1162467925", + "text": "Burning sensation during urination", + "display-or": "ପରିଶ୍ରା ର ପୋଡ଼ା ଜାଲା" + }, + { + "id": "ID_330292438", + "text": "Change in frequency [describe]", + "input-type": "text", + "language": "change in frequency of urination", + "display-or": "ପରିଶ୍ରା ର ଆଭୂତି ର ପରିବର୍ତନ" + }, + { + "id": "ID_1019342392", + "text": "Any color change in urine?", + "language": "%", + "display-or": "ଋଙ୍ଗ ପରିବର୍ତ୍ତନ", + "options": [ + { + "id": "ID_1916988026", + "text": "Yes [describe]", + "input-type": "text", + "language": "colour change seen in urine,", + "display-or": "ହଁ କେଉଁ ପ୍ରକାର" + }, + { + "id": "ID_1746821438", + "text": "No", + "language": "no colour change in urine", + "display-or": "ନାଁ" + } + ] + } + ] + }, + { + "id": "ID_1359276592", + "text": "Skin rash", + "display-or": "ଚର୍ମ ଚିହ୍ନ" + }, + { + "id": "ID_1295072716", + "text": "Photosensitivity", + "display-or": "ଆଲୁଅ ରେ ୱାଲେର୍ଜ୍ୟ" + }, + { + "id": "ID_1013072886", + "text": "Ear discomfort", + "display-or": "କାନ ଯନ୍ତ୍ରଣା" + }, + { + "id": "ID_1473421586", + "text": "Joint pain", + "perform-physical-exam": "Joint:Swelling;Joint:Redness;Joint:Deformity;Joint:Tenderness;Joint:Movement Pain;", + "display-or": "ଗଣ୍ଠି ଯନ୍ତ୍ରଣା", + "options": [ + { + "id": "ID_269284247", + "text": "Involving multiple joints", + "language": "%", + "display": "Does it involve single or multiple joints?", + "display-or": "ଗୋଟିଏ ଗଣ୍ଠି ରେ କିମ୍ବା ବହୁତ ଗଣ୍ଠି", + "options": [ + { + "id": "ID_121143788", + "text": "Multiple joints", + "language": "Involving multiple joints", + "display-or": "ବହୁତ" + }, + { + "id": "ID_311234053", + "text": "Single joint", + "language": "Involving single joint", + "display-or": "ଗୋଟେ" + } + ] + }, + { + "id": "ID_1649793525", + "text": "Migratory", + "language": "%", + "display": "Does the pain move to other parts of the body?", + "display-or": "ଯନ୍ତ୍ରଣା ଅନ୍ଯଯାଗାକୁ ଯାଉଛି", + "options": [ + { + "id": "ID_151756404", + "text": "No", + "language": "pain is not migratory in nature", + "display-or": "ନାହିଁ" + }, + { + "id": "ID_88957406", + "text": "Yes", + "language": "pain is migratory in nature", + "display-or": "ହଁ" + } + ] + } + ] + }, + { + "id": "ID_1350555004", + "text": "Other ", + "input-type": "Text", + "language": "%", + "display-or": "ଅନ୍ୟାନ୍ୟ (ବର୍ଣନା କର)" + } + ] + }, + { + "id": "ID_1006867618", + "text": "H/o specific illness", + "display": "Have you ever been diagnosed with any of the following specific diseases?", + "pos-condition": "h/o", + "neg-condition": "no h/o", + "display-or": "ତମକୁ କେବେ ଆଗରୁ ନିମ୍ନ ଲିଖିତ ବିଶିଷ୍ଟ ରୋଗ ଚିହ୍ନଟ ହୋଇଥିଲା କି?", + "options": [ + { + "id": "ID_313022533", + "text": "Chronic liver disease", + "display-or": "ପୁରୁଣା ଯକୃତ ରୋଗ" + }, + { + "id": "ID_1288475275", + "text": "Chronic renal disease", + "display-or": "ପୁରୁଣା ବୃକକ ରୋଗ" + }, + { + "id": "ID_786460262", + "text": "HIV/AIDS", + "display-or": "ଏଡ୍ସ", + "options": [ + { + "id": "ID_179615514", + "text": "Since when", + "input-type": "duration", + "language": "since", + "display-or": "କେବେଠାରୁ" + } + ] + } + ] + }, + { + "id": "ID_679451870", + "text": "Recent h/o specific events", + "display": "Have you experienced the following situation within the previous months before fever started?", + "pos-condition": "h/o", + "neg-condition": "no h/o", + "display-or": "ଜ୍ଵର ଆରମ୍ଭ ହେବାର ମାସେ ପୂର୍ବରୁ ଏପରି ଅବସ୍ଥା ହୋଇଥିଲା କି?", + "options": [ + { + "id": "ID_720863845", + "text": "Recent contact with persons having fever", + "display": "Any recent contact with any persons with fever?", + "display-or": "ଅନ୍ଯ ଜ୍ୱର ବ୍ଯକ୍ତିସହ ସଂସ୍ପର୍ଷ", + "options": [ + { + "id": "ID_139847654", + "text": "Yes", + "display-or": "ହଁ", + "options": [ + { + "id": "ID_1897055931", + "text": "when", + "input-type": "date", + "language": "on", + "display-or": "କେବେ" + } + ] + }, + { + "id": "ID_781457946", + "text": "No", + "display-or": "ନାଁ" + } + ] + }, + { + "id": "ID_382852578", + "text": "Recent travel", + "display": "Did you/your family travel recently?", + "language": "%", + "display-or": "ଏଇ ଭିତରେ ୟାତ୍ରା କରିଥିଲା କି ?", + "options": [ + { + "id": "ID_1670552427", + "text": "Yes", + "language": "Patient has recent h/o travel", + "display-or": "ନାଁ", + "options": [ + { + "id": "ID_1089527845", + "text": "When", + "input-type": "date", + "display": "on", + "display-or": "କେବେ" + }, + { + "id": "ID_289225269", + "text": "Where", + "input-type": "text", + "language": "to", + "display-or": "କେଉଁ ଯାଗା" + } + ] + }, + { + "id": "ID_1914522243", + "text": "No", + "language": "No recent h/o travel", + "display-or": "ହଁ" + } + ] + }, + { + "id": "ID_1746357268", + "text": "Recent hospitalization", + "display": "Have you recently been hospitalized?", + "language": "%", + "display-or": "ହସ୍ପିଟାଲହସ୍ପିଟାଲରେ ଭର୍ତ୍ତିରେ ଭର୍ତ୍ତି", + "options": [ + { + "id": "ID_843774285", + "text": "Yes", + "language": "Patient has recently been hospitalized", + "display-or": "ନାଁ", + "options": [ + { + "id": "ID_1143673149", + "text": "when", + "input-type": "date", + "language": "on", + "display-or": "କେବେ" + } + ] + }, + { + "id": "ID_144523400", + "text": "No", + "language": "No recent h/o hospitalization", + "display-or": "ହଁ" + } + ] + }, + { + "id": "ID_905772600", + "text": "Needles use (for drug)", + "display": "Have you recently used any needles (eg: for drugs)?", + "display-or": "ଏଇ ଭୀତରୀ ଛଞ୍ଚିରେ ବ୍ୟବହାର କରିଥିଲା କି? (ଉଦାହରଣ: ଇଞ୍ଜେକ୍ସନ, ଚିତା, ମାଦକ ଦ୍ରବ୍ୟ)", + "options": [ + { + "id": "ID_937068930", + "text": "Yes", + "display-or": "ନାଁ" + }, + { + "id": "ID_858421266", + "text": "No", + "display-or": "ହଁ" + } + ] + } + ] + }, + { + "id": "ID_1979920311", + "text": "Prior treatment sought", + "display": "Have you taken any treatment (including self-medication or home remedies) or seen any health provider for this problem before coming here today?", + "display-or": "ତମେ ଆଗରୁ କୌଣସି ପ୍ରାକାର ଔଷଦ ନଇଥିଲ କି? (ନିଜେ ସ୍ୱାସ୍ଥ୍ୟ ଏବଂ ଘରୋଇ ଉପଚାର)", + "options": [ + { + "id": "ID_830833900", + "text": "Yes [Describe]", + "input-type": "text", + "language": "%", + "display-or": "ହାଁ (ବର୍ଣନା କର)" + }, + { + "id": "ID_1226925547", + "text": "None", + "display-or": "କିଛି ନାହିଁ" + } + ] + }, + { + "id": "ID_1436146669", + "text": "Additional information", + "display-or": "ଅତିରିକ୍ତ ସୂଚନା", + "options": [ + { + "id": "ID_451991982", + "text": "[Enter additional information]", + "input-type": "text", + "language": "%", + "display-or": "ଅତିରିକ୍ତ ସୂଚନା ପ୍ରଦାନ କରିବା" + } + ] + } + ] +} \ No newline at end of file diff --git a/app/src/main/assets/engines/Sick child (under 5years).json b/app/src/main/assets/engines/Sick child (under 5years).json new file mode 100644 index 0000000000..f5c74beb7f --- /dev/null +++ b/app/src/main/assets/engines/Sick child (under 5years).json @@ -0,0 +1,834 @@ +{ + "id": "ID_983435415", + "text": "Sick child (under 5years)", + "perform-physical-exam": "Sick Child:Lethargy;Sick Child:Fast Breathing;Sick Child:Stridor;Sick Child:Chest indrawing;Physical Growth:MUAC;", + "display-or": "ଅସୁସ୍ଥ ପିଲା (୫ ବର୍ଷ ରୁ କମ )", + "options": [ + { + "id": "ID_207965551", + "text": "Main symptom", + "display-or": "ମୁଖ୍ୟ ଲକ୍ଷଣ", + "options": [ + { + "id": "ID_560327678", + "text": "Cough", + "display-or": "କାଶ", + "options": [ + { + "id": "ID_88649572", + "text": "Type of cough", + "display": "What is the type of cough ?", + "display-or": "ଶୁଖିଲା କାଶ କି କଫ କାଶ ?", + "options": [ + { + "id": "ID_1538929543", + "text": "Dry Cough (No sputum)", + "display-or": "ଶୁଖିଲା କାଶ" + }, + { + "id": "ID_1222106302", + "text": "Productive(with sputum)", + "display-or": "କଫ କାଶ", + "options": [ + { + "id": "ID_1622352976", + "text": "Sputum color", + "input-type": "text", + "display-or": "କଫ ର ରଙ୍ଗ କଣ ?" + }, + { + "id": "ID_1398300581", + "text": "Amount of sputum", + "display-or": "କଫ ର ପରିମାଣ କେତେ ?", + "options": [ + { + "id": "ID_1758361583", + "text": "Large", + "display-or": "ବହୁତ" + }, + { + "id": "ID_1824631887", + "text": "Moderate", + "display-or": "ମଧ୍ୟମ" + }, + { + "id": "ID_945187001", + "text": "Scanty", + "display-or": "ଅଳ୍ପ" + } + ] + }, + { + "id": "ID_1907479127", + "text": "Odor of sputum", + "input-type": "text", + "display-or": "କଫ ର ଗନ୍ଧ କଣ?" + } + ] + } + ] + }, + { + "id": "ID_448800992", + "text": "No", + "display-or": "ନା" + } + ] + }, + { + "id": "ID_184173473", + "text": "Difficult breathing", + "display-or": "ନିଶ୍ୱାସ ପ୍ରଶ୍ୱାସରେ କଷ୍ଠ", + "options": [ + { + "id": "ID_1537676411", + "text": "Onset", + "display": "How does this symptom start?", + "display-or": "କେମିତି ଆରମ୍ଭ ହେଲା", + "options": [ + { + "id": "ID_1801845361", + "text": "Sudden ", + "display-or": "ହଠାତ୍" + }, + { + "id": "ID_1357546942", + "text": "Gradual", + "display-or": "ଧୀରେ ଧୀରେ" + } + ] + }, + { + "id": "ID_1606955749", + "text": "Associated symptoms", + "display": "Does your child have the following symptom(s)?", + "pos-condition": "c.", + "neg-condition": "s.", + "display-or": "ଅନ୍ୟ କୌଣସି ଲକ୍ଷଣ ଦେଖା ଯାଉଛି କି?", + "options": [ + { + "id": "ID_1589026365", + "text": "Color change of lips/hands/feet", + "display-or": "ହୋତା, ହାତ, ଗୋଡ ରେ ରଙ୍ଗ ପରିବର୍ତନ" + }, + { + "id": "ID_721701359", + "text": "Change in voice/Hoarse voice", + "display-or": "ସ୍ବର ପରିବର୍ତନ / କଣ୍ଠ ପଡି ଯାଇ ଚି" + }, + { + "id": "ID_1682839034", + "text": "Wheezing", + "display-or": "ଶ୍ୱାସରେ ଶଦ୍ଦ" + }, + { + "id": "ID_1804952768", + "text": "Other [describe]", + "input-type": "text", + "language": "%", + "display-or": "ଅନ୍ୟାନ୍ୟ" + } + ] + } + ] + }, + { + "id": "ID_290457033", + "text": "Diarrhea", + "display-or": "ଝାଡା", + "options": [ + { + "id": "ID_542470862", + "text": "Frequency", + "input-type": "frequency", + "display-or": "କେତେ ଥର" + }, + { + "id": "ID_1052283087", + "text": "Characteristics", + "display-or": "ପ୍ରକାର", + "options": [ + { + "id": "ID_1522859806", + "text": "Bloody", + "display-or": "ରକ୍ତ" + }, + { + "id": "ID_204022976", + "text": "Watery", + "display-or": "ପାଣି" + } + ] + }, + { + "id": "ID_1340744128", + "text": "Associated symptoms", + "display": "Does your child have the following symptom(s)?", + "pos-condition": "c.", + "neg-condition": "s.", + "display-or": "ତମର ଶିଶୁ କୁଏହି ଲକ୍ଷଣ ସବୁ ଅଛି କି?", + "options": [ + { + "id": "ID_120934554", + "text": "Abdominal pain", + "display-or": "ପେଟ କାଟିବା" + }, + { + "id": "ID_587201373", + "text": "Other [describe]", + "input-type": "text", + "language": "%", + "display-or": "ଅନ୍ୟାନ୍ୟ" + } + ] + } + ] + }, + { + "id": "ID_1129106210", + "text": "Fever", + "perform-physical-exam": "Umbilicus:Redness;Umbilicus:Discharge;Umbilicus:Shape;Neck:Neck stiffness (Part 1);Neck:Neck stiffness (Part 2);Any Location:Skin Rash;Any Location:Lumps;", + "display-or": "ଜ୍ୱର", + "options": [ + { + "id": "ID_1851308351", + "text": "Associated symptoms", + "display": "Does your child have the following symptom(s)?", + "pos-condition": "c.", + "neg-condition": "s.", + "display-or": "ତମର ଶିଶୁ କୁଏହି ଲକ୍ଷଣ ସବୁ ଅଛି କି?", + "options": [ + { + "id": "ID_1101629130", + "text": "Runny nose", + "display-or": "ନାକରୁ ପାଣି ବା ଥଣ୍ଡା" + }, + { + "id": "ID_1967599366", + "text": "Skin rash", + "display-or": "ଚର୍ମ ଚିହ୍ନ" + }, + { + "id": "ID_1273162547", + "text": "Red eyes", + "display-or": "ନାଲି ଆଖି" + }, + { + "id": "ID_1931521264", + "text": "Other [describe]", + "input-type": "text", + "language": "%", + "display-or": "ଅନ୍ୟାନ୍ୟ" + } + ] + }, + { + "id": "ID_570262661", + "text": "Nature of Fever", + "display": "How has fever changed?", + "display-or": "ଜର କେମିତି ବଦଳୁଛି ?", + "options": [ + { + "id": "ID_1434989288", + "text": "All day/ Constant", + "display-or": "ପୁରା ଦିନ" + }, + { + "id": "ID_2420513", + "text": "Irregular (comes & goes)", + "display-or": "ଆସେ ଯାଏ" + }, + { + "id": "ID_1220882698", + "text": "Periodic", + "display-or": "ଅନ୍ତରାଳ", + "options": [ + { + "id": "ID_1877805872", + "text": "Alternate days", + "display-or": "ଦିଅଁ ଛାଡ ଦିନେ" + }, + { + "id": "ID_1188913049", + "text": "Every few hours", + "display-or": "କିଛି ଘଣ୍ଟା ଛାଡି" + }, + { + "id": "ID_881523069", + "text": "Every few days", + "display-or": "ପ୍ରତି ଅଳ୍ପ ଦିନରେ" + }, + { + "id": "ID_99907657", + "text": "Other [describe]", + "input-type": "text", + "language": "%", + "display-or": "ଅନ୍ୟାନ୍ୟ" + } + ] + } + ] + }, + { + "id": "ID_1714549680", + "text": "Measles history within the last 3 months", + "display": "Has the baby/child had measles within the previous 3 months?", + "language": "%", + "display-or": "ଗତ ତିନି ମାସରେ ମିଳମିଳା", + "options": [ + { + "id": "ID_1091419494", + "text": "Yes", + "language": "h/o measles in last 3 months", + "display-or": "ହଁ" + }, + { + "id": "ID_627126435", + "text": "No", + "language": "no h/o measles in past 3 months", + "display-or": "ନା" + } + ] + } + ] + }, + { + "id": "ID_887317121", + "text": "Ear pain", + "perform-physical-exam": "Ear:Bleeding;Ear:Discharge;Ear:Redness;Ear:Swelling;", + "display-or": "କଣ ଯନ୍ତ୍ରଣା", + "options": [ + { + "id": "ID_1078199479", + "text": "Ear discharge", + "display-or": "କାନରେ ଝରିବା", + "display": "Any ear discharge?", + "options": [ + { + "id": "ID_740615069", + "text": "No", + "display-or": "ନା" + }, + { + "id": "ID_1516184532", + "text": "Clear", + "display-or": "ପାଣି" + }, + { + "id": "ID_1563668689", + "text": "Pus", + "display-or": "ପୂଜ" + }, + { + "id": "ID_225988098", + "text": "Bloody", + "display-or": "ରକ୍ତ" + } + ] + } + ] + }, + { + "id": "ID_1839428155", + "text": "Jaundice", + "display": "Yellow eyes/skin", + "perform-physical-exam": "Abdomen:Distension;Abdomen:Tenderness;Abdomen:Lumps;", + "display-or": "ହଳଦିଆ ଆଖି ବା ଚର୍ମ", + "options": [ + { + "id": "ID_749851373", + "text": "Palm/soles involvement", + "language": "%", + "display-or": "ପାପୁଲି ବା ପାଦ", + "options": [ + { + "id": "ID_146956158", + "text": "Yes", + "language": "involves palm / soles pain", + "display-or": "ହଁ" + }, + { + "id": "ID_812798599", + "text": "No", + "language": "Does not involve Palm / soles pain", + "display-or": "ନା" + } + ] + } + ] + } + ] + }, + { + "id": "ID_178840515", + "text": "Duration", + "display": "Since when have you had this symptom?", + "display-or": "କେବେଠାରୁ", + "options": [ + { + "id": "ID_1250493396", + "text": "[Enter since when]", + "input-type": "duration", + "language": "since", + "display-or": "କେବେଠାରୁ" + } + ] + }, + { + "id": "ID_1392114445", + "text": "Danger signs", + "display": "Does the baby/child have the following danger symtpom?", + "display-or": "ତମର ଶିଶୁ କୁଏହି ବିପଦ ଲକ୍ଷଣ ସବୁ ଅଛି କି?", + "options": [ + { + "id": "ID_1017967578", + "text": "Drinking/breastfeeding", + "display": "Is the child drinking/breastfeeding normally?", + "display-or": "ପିଇବା/ସ୍ଥାନପନ", + "options": [ + { + "id": "ID_1840963745", + "text": "Normal", + "display-or": "ଠିକ" + }, + { + "id": "ID_379542848", + "text": "Abnormal", + "display-or": "ଠିକ ନାହିଁ" + } + ] + }, + { + "id": "ID_348298739", + "text": "Vomit everything", + "display": "Does the child vomit everything?", + "language": "%", + "display-or": "ବାନ୍ତି", + "options": [ + { + "id": "ID_827175001", + "text": "Yes", + "language": "Child vomits everything", + "display-or": "ହଁ" + }, + { + "id": "ID_482272294", + "text": "No", + "language": "Child does not vomit everything", + "display-or": "ନା" + } + ] + }, + { + "id": "ID_14409162", + "text": "Convulsions", + "display-or": "ବାତ", + "options": [ + { + "id": "ID_580083998", + "text": "Yes", + "display-or": "ହଁ", + "options": [ + { + "id": "ID_1700203444", + "text": "Frequency", + "input-type": "frequency", + "display-or": "କେତେ ଥର" + }, + { + "id": "ID_1025383388", + "text": "Since when", + "input-type": "duration", + "language": "since", + "display-or": "କେବେ ଠାରୁ" + } + ] + }, + { + "id": "ID_1067905726", + "text": "No", + "display-or": "ନା" + } + ] + }, + { + "id": "ID_286552621", + "text": "Movement (Age <2months)", + "display-or": "ଚାଲ ଚଂଚଳ/ହାତ ଗୋଡ ହଲଚଲ", + "options": [ + { + "id": "ID_1885364117", + "text": "Normal", + "display-or": "ଠିକ" + }, + { + "id": "ID_282232741", + "text": "Movement only when stimulated", + "display-or": "ହଲଚଲ କେଲେ ହଲଚଲ ହୁଏ" + }, + { + "id": "ID_503134636", + "text": "No movement", + "display-or": "ନାହିଁ" + } + ] + } + ] + }, + { + "id": "ID_1089252797", + "text": "Currently breastfeeding", + "display": "Are you currently breastfeeding the child?", + "display-or": "ବର୍ତମାନ ସ୍ତନ ପାନ", + "options": [ + { + "id": "ID_1730066682", + "text": "Yes", + "display-or": "ହଁ", + "options": [ + { + "id": "ID_1036819013", + "text": "Frequency", + "input-type": "frequency", + "display-or": "କେତେ ଥର" + }, + { + "id": "ID_839592773", + "text": "Exclusive breast feeding", + "language": "%", + "display-or": "କେବଳ ସ୍ତନ ପାନ", + "options": [ + { + "id": "ID_1314901547", + "text": "Yes", + "language": "Child is exclusively breastfed", + "display-or": "ହଁ" + }, + { + "id": "ID_1851450126", + "text": "No (With other food/drink)", + "language": "Child is given food / drink along with breast feeding", + "display-or": "ନା", + "options": [ + { + "id": "ID_1976934114", + "text": "Frequency", + "input-type": "frequency", + "display-or": "କେତେ ଥର" + }, + { + "id": "ID_1096274872", + "text": "Food/drink (Describe)", + "input-type": "text", + "language": "%", + "display-or": "ଖାଦ୍ୟ/ପାନୀୟ (ବର୍ଣନା କର)" + } + ] + } + ] + } + ] + }, + { + "id": "ID_1256017452", + "text": "No", + "display-or": "ନା" + } + ] + }, + { + "id": "ID_1662561260", + "text": "Associated symptoms", + "display": "Does your child have the following symptom(s)?", + "pos-condition": "c.", + "neg-condition": "s.", + "display-or": "ତମର ଶିଶୁ କୁଏହି ଲକ୍ଷଣ ସବୁ ଅଛି କି?", + "options": [ + { + "id": "ID_43499979", + "text": "Mouth pain", + "display-or": "ପାଟି କଷ୍ଟ" + }, + { + "id": "ID_404322592", + "text": "White coating/patches on the tongue/mouth/inner/cheeks/the back of the throat", + "display-or": "ଜିଭ/ପାଟି/ଗ୍ଳାଭିତର/ଗାଲରେ/ଢାଲଛିଞ୍ଚ ପଡିବ", + "perform-physical-exam": "Mouth:Oral thrush;" + }, + { + "id": "ID_1255360406", + "text": "Fever for over 1 month", + "display-or": "ଏକ ମାସେରୁଅଧିକ ଜ୍ୱର" + }, + { + "id": "ID_378312136", + "text": "Diarrhea for over 14 days", + "display-or": "ଚୌଡା ଦିନରୁ ଅଧିକ ଝଡ଼" + }, + { + "id": "ID_1516597491", + "text": "Skin rash", + "display-or": "ଚର୍ମ ଚିହ୍ନ" + } + ] + }, + { + "id": "ID_1989844813", + "text": "HIV status of the mother", + "display-or": "ମା ର ଏଚ ଆଇ ଭି ସ୍ତିଥି", + "options": [ + { + "id": "ID_882729624", + "text": "Unknown", + "display-or": "ଜଣ ନାହିଁ" + }, + { + "id": "ID_939613126", + "text": "No", + "language": "Mother of child does not have HIV", + "display-or": "ନା" + }, + { + "id": "ID_644478527", + "text": "Yes", + "language": "Mother of child has HIV", + "display-or": "ହଁ", + "options": [ + { + "id": "ID_1881481341", + "text": "HIV of mother was diagnosed but not treated", + "display-or": "ହଁ(ଜଣାଅଛି/ଚିକିତ୍ସା ହୋଇନି)", + "options": [ + { + "id": "ID_1684180296", + "text": "Diagnosed on ", + "input-type": "date", + "display-or": "କେବେ ଜଣାପଡିଲା" + } + ] + }, + { + "id": "ID_301418939", + "text": "HIV of mother was diagnosed and treated", + "display-or": "ହଁ(ଜଣା ଅଛି/ଚିକିତ୍ସା ହୋଇଛି)", + "options": [ + { + "id": "ID_1983633024", + "text": "Diagnosed on", + "input-type": "date", + "display-or": "କେବେ ଚିକିତ୍ସା ହୋଇଥିଲା" + }, + { + "id": "ID_53087073", + "text": "Medication", + "display-or": "ଔଷଧ", + "options": [ + { + "id": "ID_301163296", + "text": "Since when", + "input-type": "duration", + "language": "since", + "display-or": "କେବେ ଠାର" + }, + { + "id": "ID_1981612616", + "text": "Medication name (Describe)", + "input-type": "text", + "language": "medication name", + "display-or": "ଔଷଧ ନାମ" + } + ] + } + ] + } + ] + } + ] + }, + { + "id": "ID_1627456178", + "text": "HIV status of the child", + "display-or": "ପିଲାର ଏଚ ଆଇ ଭି ସ୍ତିଥି", + "options": [ + { + "id": "ID_1401427314", + "text": "No", + "language": "Child does not have HIV", + "display-or": "ନା" + }, + { + "id": "ID_1240780060", + "text": "Unknown", + "display-or": "ଜଣାନାହିଁ" + }, + { + "id": "ID_1803107427", + "text": "Yes", + "language": "Child has HIV", + "display-or": "ହଁ", + "options": [ + { + "id": "ID_1683715654", + "text": "Child's HIV was diagnosed but not treated", + "display-or": "ହଁ(ଜଣାଅଛି/ଚିକିତ୍ସା ହୋଇନି)", + "options": [ + { + "id": "ID_1221797255", + "text": "Diagnosed on ", + "input-type": "date", + "display-or": "କେବେ ଜଣାପଡିଲା" + } + ] + }, + { + "id": "ID_1644573369", + "text": "Child's HIV was diagnosed and treated", + "display-or": "ହଁ(ଜଣା ଅଛି/ଚିକିତ୍ସା ହୋଇଛି)", + "options": [ + { + "id": "ID_1632178620", + "text": "Diagnosed on ", + "input-type": "date", + "display-or": "କେବେ ଜଣାପଡିଲା" + }, + { + "id": "ID_1173184947", + "text": "Medication", + "display-or": "ଔଷଧ", + "options": [ + { + "id": "ID_1275471882", + "text": "Since when", + "input-type": "duration", + "language": "since", + "display-or": "କେବେଠାରୁ" + }, + { + "id": "ID_917767294", + "text": "Medication name (Describe)", + "input-type": "text", + "language": "%", + "display-or": "ଔଷଧର ନାମ" + } + ] + } + ] + } + ] + } + ] + }, + { + "id": "ID_1819787065", + "text": "Immunization/supplement history", + "display-or": "ଟୀକା ବିତରଣୀ", + "options": [ + { + "id": "ID_1151501448", + "text": "Unknown", + "display-or": "ଜଣାନାହିଁ" + }, + { + "id": "ID_539183464", + "text": "Vaccine", + "display-or": "ଟୀକା", + "options": [ + { + "id": "ID_1366738232", + "text": "Yes", + "display-or": "ହଁ" + }, + { + "id": "ID_1144390923", + "text": "No", + "display-or": "ନା" + }, + { + "id": "ID_1898781474", + "text": "Unknown", + "display-or": "ଜଣାନାହିଁ" + } + ] + }, + { + "id": "ID_1429322932", + "text": "Vitamin A ", + "display-or": "ଭିଟାମିନ ଏ", + "options": [ + { + "id": "ID_254788964", + "text": "Yes", + "display-or": "ହଁ" + }, + { + "id": "ID_432137563", + "text": "No", + "display-or": "ନା" + }, + { + "id": "ID_499449342", + "text": "Unknown", + "display-or": "ଜଣାନାହିଁ" + } + ] + }, + { + "id": "ID_476586209", + "text": "Worm treatment", + "display-or": "କୃମି ଚିକିତ୍ସା", + "options": [ + { + "id": "ID_223386196", + "text": "Yes", + "display-or": "ହଁ" + }, + { + "id": "ID_1301645260", + "text": "No", + "display-or": "ନା" + }, + { + "id": "ID_1677637795", + "text": "Unknown", + "display-or": "ଜଣାନାହିଁ" + } + ] + } + ] + }, + { + "id": "ID_1270557284", + "text": "Prior treatment sought", + "display": "Have you taken any treatment (including self-medication or home remedies) or seen any health provider for this problem before coming here today?", + "display-or": "ତମେ ଆଗରୁ କୌଣସି ପ୍ରାକାର ଔଷଦ ନଇଥିଲ କି? (ନିଜେ ସ୍ୱାସ୍ଥ୍ୟ ଏବଂ ଘରୋଇ ଉପଚାର)", + "options": [ + { + "id": "ID_1505986090", + "text": "Yes [Describe]", + "input-type": "text", + "language": "%", + "display-or": "ହାଁ (ବର୍ଣନା କର)" + }, + { + "id": "ID_1226925547", + "text": "None", + "display-or": "କିଛି ନାହିଁ" + } + ] + }, + { + "id": "ID_1769744008", + "text": "Additional information", + "display-or": "ଅତିରିକ୍ତ ସୂଚନା", + "options": [ + { + "id": "ID_651811445", + "text": "[Enter additional information]", + "input-type": "text", + "language": "%", + "display-or": "ଅତିରିକ୍ତ ସୂଚନା ପ୍ରଦାନ କରିବା" + } + ] + } + ] +} \ No newline at end of file diff --git a/app/src/main/assets/famHist-or-translation.json b/app/src/main/assets/famHist-or-translation.json new file mode 100644 index 0000000000..862ef68939 --- /dev/null +++ b/app/src/main/assets/famHist-or-translation.json @@ -0,0 +1,281 @@ +{ + "id": "ID_211456448", + "text": "Family History", + "display-or": "ପରିବାର ସମ୍ବନ୍ଧୀୟ", + "options": [ + { + "id": "ID_1078855957", + "text": "High BP", + "display-or": "ଉଚ୍ଚ ରକ୍ତଚାପ", + "options": [ + { + "id": "ID_1854447992", + "text": "Mother", + "display-or": "ମା" + }, + { + "id": "ID_1609028547", + "text": "Father", + "display-or": "ବାପା" + }, + { + "id": "ID_839417744", + "text": "Sister", + "display-or": "ଭଉଣୀ" + }, + { + "id": "ID_1586264392", + "text": "Brother", + "display-or": "ଭାଇ" + }, + { + "id": "ID_1668112188", + "text": "[Describe relation]", + "input-type": "text", + "language": "%", + "display-or": "ଅନ୍ଯ ସମ୍ପର୍କୀୟ" + } + ] + }, + { + "id": "ID_1138006551", + "text": "Heart Disease", + "display-or": "ହୃଦ୍ରୋଗ", + "options": [ + { + "id": "ID_756175657", + "text": "Mother", + "display-or": "ମା" + }, + { + "id": "ID_352913221", + "text": "Father", + "display-or": "ବାପା" + }, + { + "id": "ID_210664833", + "text": "Sister", + "display-or": "ଭଉଣୀ" + }, + { + "id": "ID_1359181501", + "text": "Brother", + "display-or": "ଭାଇ" + }, + { + "id": "ID_1113722262", + "text": "[Describe relation]", + "input-type": "text", + "language": "%", + "display-or": "ଅନ୍ଯ ସମ୍ପର୍କୀୟ" + } + ] + }, + { + "id": "ID_923819641", + "text": "Stroke", + "display-or": "ପରଲିସିସ attack", + "options": [ + { + "id": "ID_235946224", + "text": "Mother", + "display-or": "ମା" + }, + { + "id": "ID_462556614", + "text": "Father", + "display-or": "ବାପା" + }, + { + "id": "ID_694071463", + "text": "Sister", + "display-or": "ଭଉଣୀ" + }, + { + "id": "ID_1366406172", + "text": "Brother", + "display-or": "ଭାଇ" + }, + { + "id": "ID_1977626009", + "text": "[Describe relation]", + "input-type": "text", + "language": "%", + "display-or": "ଅନ୍ଯ ସମ୍ପର୍କୀୟ" + } + ] + }, + { + "id": "ID_519272944", + "text": "Diabetes", + "display-or": "ମଧୁମେହ", + "options": [ + { + "id": "ID_486810641", + "text": "Mother", + "display-or": "ମା" + }, + { + "id": "ID_652245267", + "text": "Father", + "display-or": "ବାପା" + }, + { + "id": "ID_289390649", + "text": "Sister", + "display-or": "ଭଉଣୀ" + }, + { + "id": "ID_1725905248", + "text": "Brother", + "display-or": "ଭାଇ" + }, + { + "id": "ID_1782077559", + "text": "[Describe relation]", + "input-type": "text", + "language": "%", + "display-or": "ଅନ୍ଯ ସମ୍ପର୍କୀୟ" + } + ] + }, + { + "id": "ID_1502189405", + "text": "Asthma", + "display-or": "ନିଶ୍ବାଶ ନେବାରେ କଷ୍ଟ", + "options": [ + { + "id": "ID_314608166", + "text": "Mother", + "display-or": "ମା" + }, + { + "id": "ID_1457691080", + "text": "Father", + "display-or": "ବାପା" + }, + { + "id": "ID_106821929", + "text": "Sister", + "display-or": "ଭଉଣୀ" + }, + { + "id": "ID_1118438497", + "text": "Brother", + "display-or": "ଭାଇ" + }, + { + "id": "ID_67727267", + "text": "[Describe relation]", + "input-type": "text", + "language": "%", + "display-or": "ଅନ୍ଯ ସମ୍ପର୍କୀୟ" + } + ] + }, + { + "id": "ID_1031615963", + "text": "Tuberculosis", + "display-or": "ଯକ୍ଷ୍ମା", + "options": [ + { + "id": "ID_272150375", + "text": "Mother", + "display-or": "ମା" + }, + { + "id": "ID_1592939719", + "text": "Father", + "display-or": "ବାପା" + }, + { + "id": "ID_1456647623", + "text": "Sister", + "display-or": "ଭଉଣୀ" + }, + { + "id": "ID_1619111173", + "text": "Brother", + "display-or": "ଭାଇ" + }, + { + "id": "ID_1185424509", + "text": "[Describe relation]", + "input-type": "text", + "language": "%", + "display-or": "ଅନ୍ଯ ସମ୍ପର୍କୀୟ" + } + ] + }, + { + "id": "ID_645572228", + "text": "Cancer", + "display-or": "କ୍ଯାନସର୍", + "options": [ + { + "id": "ID_1792917607", + "text": "Mother", + "display-or": "ମା" + }, + { + "id": "ID_1469130675", + "text": "Father", + "display-or": "ବାପା" + }, + { + "id": "ID_718923800", + "text": "Sister", + "display-or": "ଭଉଣୀ" + }, + { + "id": "ID_1385116729", + "text": "Brother", + "display-or": "ଭାଇ" + }, + { + "id": "ID_962569699", + "text": "[Describe relation]", + "input-type": "text", + "language": "%", + "display-or": "ଅନ୍ଯ ସମ୍ପର୍କୀୟ" + } + ] + }, + { + "id": "ID_525209857", + "text": "Other", + "input-type": "text", + "display-or": "ଅନ୍ଯାନ୍ଯ", + "language": "%", + "options": [ + { + "id": "ID_1935937602", + "text": "Mother", + "display-or": "ମା" + }, + { + "id": "ID_1622999292", + "text": "Father", + "display-or": "ବାପା" + }, + { + "id": "ID_69280074", + "text": "Sister", + "display-or": "ଭଉଣୀ" + }, + { + "id": "ID_258479257", + "text": "Brother", + "display-or": "ଭାଇ" + }, + { + "id": "ID_840659387", + "text": "[Describe relation]", + "input-type": "text", + "language": "%", + "display-or": "ଅନ୍ଯ ସମ୍ପର୍କୀୟ" + } + ] + } + ] +} \ No newline at end of file diff --git a/app/src/main/assets/famHist.json b/app/src/main/assets/famHist.json new file mode 100644 index 0000000000..862ef68939 --- /dev/null +++ b/app/src/main/assets/famHist.json @@ -0,0 +1,281 @@ +{ + "id": "ID_211456448", + "text": "Family History", + "display-or": "ପରିବାର ସମ୍ବନ୍ଧୀୟ", + "options": [ + { + "id": "ID_1078855957", + "text": "High BP", + "display-or": "ଉଚ୍ଚ ରକ୍ତଚାପ", + "options": [ + { + "id": "ID_1854447992", + "text": "Mother", + "display-or": "ମା" + }, + { + "id": "ID_1609028547", + "text": "Father", + "display-or": "ବାପା" + }, + { + "id": "ID_839417744", + "text": "Sister", + "display-or": "ଭଉଣୀ" + }, + { + "id": "ID_1586264392", + "text": "Brother", + "display-or": "ଭାଇ" + }, + { + "id": "ID_1668112188", + "text": "[Describe relation]", + "input-type": "text", + "language": "%", + "display-or": "ଅନ୍ଯ ସମ୍ପର୍କୀୟ" + } + ] + }, + { + "id": "ID_1138006551", + "text": "Heart Disease", + "display-or": "ହୃଦ୍ରୋଗ", + "options": [ + { + "id": "ID_756175657", + "text": "Mother", + "display-or": "ମା" + }, + { + "id": "ID_352913221", + "text": "Father", + "display-or": "ବାପା" + }, + { + "id": "ID_210664833", + "text": "Sister", + "display-or": "ଭଉଣୀ" + }, + { + "id": "ID_1359181501", + "text": "Brother", + "display-or": "ଭାଇ" + }, + { + "id": "ID_1113722262", + "text": "[Describe relation]", + "input-type": "text", + "language": "%", + "display-or": "ଅନ୍ଯ ସମ୍ପର୍କୀୟ" + } + ] + }, + { + "id": "ID_923819641", + "text": "Stroke", + "display-or": "ପରଲିସିସ attack", + "options": [ + { + "id": "ID_235946224", + "text": "Mother", + "display-or": "ମା" + }, + { + "id": "ID_462556614", + "text": "Father", + "display-or": "ବାପା" + }, + { + "id": "ID_694071463", + "text": "Sister", + "display-or": "ଭଉଣୀ" + }, + { + "id": "ID_1366406172", + "text": "Brother", + "display-or": "ଭାଇ" + }, + { + "id": "ID_1977626009", + "text": "[Describe relation]", + "input-type": "text", + "language": "%", + "display-or": "ଅନ୍ଯ ସମ୍ପର୍କୀୟ" + } + ] + }, + { + "id": "ID_519272944", + "text": "Diabetes", + "display-or": "ମଧୁମେହ", + "options": [ + { + "id": "ID_486810641", + "text": "Mother", + "display-or": "ମା" + }, + { + "id": "ID_652245267", + "text": "Father", + "display-or": "ବାପା" + }, + { + "id": "ID_289390649", + "text": "Sister", + "display-or": "ଭଉଣୀ" + }, + { + "id": "ID_1725905248", + "text": "Brother", + "display-or": "ଭାଇ" + }, + { + "id": "ID_1782077559", + "text": "[Describe relation]", + "input-type": "text", + "language": "%", + "display-or": "ଅନ୍ଯ ସମ୍ପର୍କୀୟ" + } + ] + }, + { + "id": "ID_1502189405", + "text": "Asthma", + "display-or": "ନିଶ୍ବାଶ ନେବାରେ କଷ୍ଟ", + "options": [ + { + "id": "ID_314608166", + "text": "Mother", + "display-or": "ମା" + }, + { + "id": "ID_1457691080", + "text": "Father", + "display-or": "ବାପା" + }, + { + "id": "ID_106821929", + "text": "Sister", + "display-or": "ଭଉଣୀ" + }, + { + "id": "ID_1118438497", + "text": "Brother", + "display-or": "ଭାଇ" + }, + { + "id": "ID_67727267", + "text": "[Describe relation]", + "input-type": "text", + "language": "%", + "display-or": "ଅନ୍ଯ ସମ୍ପର୍କୀୟ" + } + ] + }, + { + "id": "ID_1031615963", + "text": "Tuberculosis", + "display-or": "ଯକ୍ଷ୍ମା", + "options": [ + { + "id": "ID_272150375", + "text": "Mother", + "display-or": "ମା" + }, + { + "id": "ID_1592939719", + "text": "Father", + "display-or": "ବାପା" + }, + { + "id": "ID_1456647623", + "text": "Sister", + "display-or": "ଭଉଣୀ" + }, + { + "id": "ID_1619111173", + "text": "Brother", + "display-or": "ଭାଇ" + }, + { + "id": "ID_1185424509", + "text": "[Describe relation]", + "input-type": "text", + "language": "%", + "display-or": "ଅନ୍ଯ ସମ୍ପର୍କୀୟ" + } + ] + }, + { + "id": "ID_645572228", + "text": "Cancer", + "display-or": "କ୍ଯାନସର୍", + "options": [ + { + "id": "ID_1792917607", + "text": "Mother", + "display-or": "ମା" + }, + { + "id": "ID_1469130675", + "text": "Father", + "display-or": "ବାପା" + }, + { + "id": "ID_718923800", + "text": "Sister", + "display-or": "ଭଉଣୀ" + }, + { + "id": "ID_1385116729", + "text": "Brother", + "display-or": "ଭାଇ" + }, + { + "id": "ID_962569699", + "text": "[Describe relation]", + "input-type": "text", + "language": "%", + "display-or": "ଅନ୍ଯ ସମ୍ପର୍କୀୟ" + } + ] + }, + { + "id": "ID_525209857", + "text": "Other", + "input-type": "text", + "display-or": "ଅନ୍ଯାନ୍ଯ", + "language": "%", + "options": [ + { + "id": "ID_1935937602", + "text": "Mother", + "display-or": "ମା" + }, + { + "id": "ID_1622999292", + "text": "Father", + "display-or": "ବାପା" + }, + { + "id": "ID_69280074", + "text": "Sister", + "display-or": "ଭଉଣୀ" + }, + { + "id": "ID_258479257", + "text": "Brother", + "display-or": "ଭାଇ" + }, + { + "id": "ID_840659387", + "text": "[Describe relation]", + "input-type": "text", + "language": "%", + "display-or": "ଅନ୍ଯ ସମ୍ପର୍କୀୟ" + } + ] + } + ] +} \ No newline at end of file diff --git a/app/src/main/assets/patHist-or-translation.json b/app/src/main/assets/patHist-or-translation.json new file mode 100644 index 0000000000..9fb30a2f14 --- /dev/null +++ b/app/src/main/assets/patHist-or-translation.json @@ -0,0 +1,819 @@ +{ + "id": "3bdlnqpm78un86npauhh5oobq5", + "text": "Patient History", + "options": [ + { + "id": "ID_1421528652", + "text": "Pregnancy status", + "display-or": "ଗର୍ଭ", + "options": [ + { + "id": "ID_686727285", + "text": "Patient is unmarried", + "display-or": "ଅବିବାହିତ" + }, + { + "id": "ID_1767078340", + "text": "Yes", + "language": "Pregnant", + "display-or": "ହଁ", + "options": [ + { + "id": "ID_505838034", + "text": "Last menstruation period", + "input-type": "date", + "display-or": "ଶେଷ ମାସିକିଅା କେବେ" + } + ] + }, + { + "id": "ID_629184183", + "text": "No", + "language": "Not pregnant", + "display-or": "ନାହିଁ" + }, + { + "id": "ID_1296076911", + "text": "Don't know", + "language": "Pregnancy status not known", + "display-or": "ଜଣା ନାହିଁ" + } + ] + }, + { + "id": "ID_1216797604", + "text": "Allergies", + "display": "Do you have any allergies?", + "display-or": "କେଉଁ ଆଲର୍ଜି ଅଛି କ?", + "options": [ + { + "id": "ID_1182630066", + "text": "Yes [Describe]", + "input-type": "text", + "language": "%", + "display-or": "ହଁ କେଉଁପରି" + }, + { + "id": "ID_1336561607", + "text": "No known allergies", + "display-or": "ନାଁ" + } + ] + }, + { + "id": "ID_488941477", + "text": "Alcohol use", + "display-or": "ମଦ", + "options": [ + { + "id": "ID_858796823", + "text": "Yes", + "display-or": "ହଁ", + "options": [ + { + "id": "ID_1464551289", + "text": "[Enter since when]", + "input-type": "duration", + "display-or": "କେବେ ଠାରୁ", + "language": "Since:" + }, + { + "id": "ID_541643837", + "text": "Frequency", + "input-type": "text", + "display": "How often do you take alcohol?", + "display-or": "କେତେ ଥର ନିଅ" + }, + { + "id": "ID_449910899", + "text": "Number of drinks consumed in one go", + "display-or": "ଥର କରେ କେତେ ନିଅ?", + "options": [ + { + "id": "ID_353665659", + "text": "1-2" + }, + { + "id": "ID_1083178746", + "text": "3-4" + }, + { + "id": "ID_339759237", + "text": "5-6" + }, + { + "id": "ID_1073159208", + "text": ">=7" + } + ] + } + ] + }, + { + "id": "ID_1066408122", + "text": "No/Denied", + "display-or": "ନ/ ମନ କରିବ" + } + ] + }, + { + "id": "ID_1479282969", + "text": "Smoking history", + "display-or": "ଧୂଅାଁ ଧୂମ୍ରପାନ", + "options": [ + { + "id": "ID_318732760", + "text": "Never-smoker", + "language": "Patient denied/has no h/o smoking", + "display-or": "କେବେ ନୁହେଁ" + }, + { + "id": "ID_1599020946", + "text": "Current-smoker", + "language": "Patient is a smoker", + "display-or": "ଏବେ ଧୁମ୍ରପାନ କରୁ ଛ", + "options": [ + { + "id": "ID_815751980", + "text": "[Enter since when]", + "input-type": "duration", + "language": "Since:", + "display-or": "କେବେଠାରୁ" + }, + { + "id": "ID_1655069807", + "text": "How many cigarettes per day do you smoke?", + "input-type": "number", + "language": "No. of cigarettes smoked/day:", + "display-or": "ଦିନକୁ କେତେଟା" + } + ] + }, + { + "id": "ID_803362413", + "text": "Ex-smoker", + "language": "Patient was a smoker", + "display-or": "ଆଗରୁ ଧୁମ୍ରପାନ କରୁଥିଲା", + "options": [ + { + "id": "ID_22359699", + "text": "How many cigarettes per day did you smoke?", + "input-type": "number", + "language": "No. of cigarettes smoked/day:", + "display-or": "ଦିନକୁ କେତେଟା" + }, + { + "id": "ID_370617072", + "text": "From", + "input-type": "date", + "display-or": "କେବେଠାରୁ" + }, + { + "id": "ID_1148758817", + "text": "To", + "input-type": "date", + "display-or": "କେଉଁ ପର୍ଯ୍ଯନ୍ତ" + } + ] + } + ] + }, + { + "id": "ID_1294148047", + "text": "Drug history", + "display": "Have you recently taken any kind of medicine (including ayurvedic/homeopathic/unani/herbal)?", + "display-or": "ତମେ ଆଗର କେବେ ଔଷଦ ନାଇଛ କି?", + "options": [ + { + "id": "ID_1388678356", + "text": "No", + "language": "No recent medication", + "display-or": "ନାଁ" + }, + { + "id": "ID_465969786", + "text": "Yes", + "language": "%", + "display-or": "ହଁ", + "options": [ + { + "id": "ID_1905877530", + "text": "Medication name 1", + "input-type": "text", + "display-or": "ଔଷଧ ନାମ 1", + "options": [ + { + "id": "ID_1689701069", + "text": "From", + "input-type": "date", + "display-or": "କେବେଠାରୁ" + }, + { + "id": "ID_1008011661", + "text": "To", + "input-type": "date", + "display-or": "କେଉଁ ପର୍ଯ୍ଯନ୍ତ" + } + ] + }, + { + "id": "ID_519893607", + "text": "Medication name 2", + "input-type": "text", + "display-or": "ଔଷଧ ନାମ 2", + "options": [ + { + "id": "ID_1617161985", + "text": "From", + "input-type": "date", + "display-or": "କେବେଠାରୁ" + }, + { + "id": "ID_64950422", + "text": "To", + "input-type": "date", + "display-or": "କେଉଁ ପର୍ଯ୍ଯନ୍ତ" + } + ] + }, + { + "id": "ID_1502080913", + "text": "Medication name 3", + "input-type": "text", + "display-or": "ଔଷଧ ନାମ 3", + "options": [ + { + "id": "ID_738451674", + "text": "From", + "input-type": "date", + "display-or": "କେବେଠାରୁ" + }, + { + "id": "ID_113852535", + "text": "To", + "input-type": "date", + "display-or": "କେଉଁ ପର୍ଯ୍ଯନ୍ତ" + } + ] + }, + { + "id": "ID_1501586422", + "text": "Medication name 4", + "input-type": "text", + "display-or": "ଔଷଧ ନାମ 4", + "options": [ + { + "id": "ID_1287862648", + "text": "From", + "input-type": "date", + "display-or": "କେବେଠାରୁ" + }, + { + "id": "ID_1590292190", + "text": "To", + "input-type": "date", + "display-or": "କେଉଁ ପର୍ଯ୍ଯନ୍ତ" + } + ] + }, + { + "id": "ID_255486354", + "text": "Medication name 5", + "input-type": "text", + "display-or": "ଔଷଧ ନାମ 5", + "options": [ + { + "id": "ID_1955040003", + "text": "From", + "input-type": "date", + "display-or": "କେବେଠାରୁ" + }, + { + "id": "ID_1832509360", + "text": "To", + "input-type": "date", + "display-or": "କେଉଁ ପର୍ଯ୍ଯନ୍ତ" + } + ] + }, + { + "id": "ID_1705452987", + "text": "Medication Adherence", + "display": "How often do you have trouble taking medicines the way you have been told to take them?", + "display-or": "ଔଷଦ ନେବା ସମୟ ରେ ଅସୁବିଧା ସେମାନଂକୁ ପଚାରିଥିଲେ କି?", + "options": [ + { + "id": "ID_621583351", + "text": "I always take them as prescribed", + "language": "Patient always takes medicine as prescribed", + "display-or": "ମୁ ସବୁ ବେଳେ ସେମାଙ୍କର ଚିଠା ନିଏ" + }, + { + "id": "ID_1330901869", + "text": "Sometimes I take them as prescribed", + "language": "Patient sometimes takes medicines as prescribed", + "display-or": "ବେଳେ ବେଳେ ସେମାଙ୍କର ଚିଠା ନିଏ" + }, + { + "id": "ID_1896221092", + "text": "I seldom take them as prescribed", + "language": "Patient seldom takes medicine as prescribed", + "display-or": "କିଛି ସମୟରେ ନିଏ" + } + ] + } + ] + } + ] + }, + { + "id": "553uunvdc4uq9oe860n2mtbd62", + "text": "High Blood Pressure", + "display-or": "ଉଚ୍ଚ ରକ୍ତଚାପ", + "options": [ + { + "id": "4gnb2kln9nvarkf1hn54iih13b", + "text": "Diagnosed on ", + "input-type": "date", + "display-or": "କେତେ ଜଣାପଡ଼ିଲା" + }, + { + "id": "ID_413173969", + "text": "Current medication", + "display-or": "କଣ ଔଷଧ ଖାଉଛନ୍ତି", + "options": [ + { + "id": "ID_188140409", + "text": "[Describe]", + "input-type": "text", + "language": "%", + "display-or": "ହଁ କେଉଁପରି" + }, + { + "id": "ID_559800345", + "text": "Not taking any medication", + "display-or": "ନାଁ" + } + ] + } + ] + }, + { + "id": "2t624p0ss7caug21hd4efumj4n", + "text": "Heart Problems", + "display-or": "ହାର୍ଟ ପ୍ରୋବ୍ଲେମ", + "options": [ + { + "id": "ID_1743003464", + "text": "Problem description", + "input-type": "text", + "language": "%", + "display": "What was the problem?", + "display-or": "ଅସୁବିଧା କଣ ହେଉଥିଲା" + }, + { + "id": "0fq5omh0fjmcot6v89tmmujs45", + "text": "Occured/Diagnosed on", + "input-type": "date", + "display-or": "କେତେ ଜଣାପଡ଼ିଲା" + }, + { + "id": "5f1pjn5mukmjrsvfnkp24nlq0q", + "text": "Treatment", + "display": "How was it treated?", + "display-or": "କେମିତି ଚିକିସତ୍ା କରାହେଇଥିଲା", + "options": [ + { + "id": "1rsrtassckdufd1v66g679huai", + "text": "Surgery", + "display-or": "ଅପରେସନ" + }, + { + "id": "3ih5vrd5crs57nrsfnsl9arcot", + "text": "Angioplasty", + "display-or": "ଅାଞ୍ଜିଓପ୍ଳାଷ୍ଟି" + }, + { + "id": "6g0frvbl14quckj6e0i2hcc7e1", + "text": "Medication", + "display-or": "ଔଷଧ" + }, + { + "id": "ID_938378473", + "text": "Other [Describe]", + "input-type": "text", + "language": "%", + "display-or": "ଅାଉ କିପରି" + } + ] + }, + { + "id": "ID_615919605", + "text": "Current medication", + "display-or": "ଏବେ କ’ଣ ଔଷଧ ଖାଉଛନ୍ତି", + "options": [ + { + "id": "ID_1320661699", + "text": "[Describe]", + "input-type": "text", + "language": "%", + "display-or": "କେଉଁପରି" + }, + { + "id": "ID_531462972", + "text": "Not taking any medication", + "display-or": "ନାଁ" + } + ] + } + ] + }, + { + "id": "52dkambh5lhqmlg9bkghn1gicb", + "text": "Stroke", + "display-or": "ପରଲିସିସ attack", + "options": [ + { + "id": "ID_545498382", + "text": "Occured on", + "input-type": "date", + "display-or": "କେବେ ହୋଇଥିଲା" + }, + { + "id": "ID_1222999660", + "text": "Treatment", + "display": "How was it treated?", + "display-or": "କେମିତି ଚିକିସତ୍ା କରାହେଇଥିଲା", + "options": [ + { + "id": "ID_1622266745", + "text": "Surgery", + "display-or": "ଅପରେସନ" + }, + { + "id": "ID_1348167551", + "text": "Medication", + "display-or": "ଔଷଧ" + }, + { + "id": "ID_1424803469", + "text": "Other [Describe]", + "input-type": "text", + "language": "%", + "display-or": "ଅନ୍ୟାନ୍ୟ" + } + ] + }, + { + "id": "ID_1162336019", + "text": "Current medication", + "display-or": "ଏବେ କ’ଣ ଔଷଧ ଖାଉଛନ୍ତି", + "options": [ + { + "id": "ID_1104534286", + "text": "[Describe]", + "input-type": "text", + "language": "%", + "display-or": "କେଉଁପରି" + }, + { + "id": "ID_187354967", + "text": "Not taking any medication", + "display-or": "ନାଁ" + } + ] + } + ] + }, + { + "id": "62id4878o7nteih18eiup3j92c", + "text": "Diabetes", + "display-or": "ମଧୁମେହ", + "options": [ + { + "id": "52bvud72kt13igfoauucsubnuv", + "text": "Since", + "display": "When were you diagnosed?", + "display-or": "କେବେଠାରୁ", + "input-type": "date" + }, + { + "id": "ID_1870024323", + "text": "Current medication", + "display-or": "ଏବେ କ’ଣ ଔଷଧ ଖାଉଛନ୍ତି", + "options": [ + { + "id": "ID_274560179", + "text": "[Describe]", + "input-type": "text", + "language": "%", + "display-or": "କେଉଁପରି" + }, + { + "id": "ID_1247339075", + "text": "Not taking any medication", + "display-or": "ନାଁ" + } + ] + }, + { + "id": "25b4es720c3ehote8hv9824tck", + "text": "Last measured Blood Sugar and HbA1C", + "display-or": "ଶେଷ ପରୀକ୍ଷାର ସୁଗାର ଓ ଐଭଇ1ଉ କେତେ ଥିଲା", + "options": [ + { + "id": "ID_1804659027", + "text": "Not known", + "display-or": "ନୋଟ କଁଅବଂ" + }, + { + "id": "ID_701392638", + "text": "[Enter if known]", + "input-type": "text", + "display-or": "ନାଁ" + } + ] + } + ] + }, + { + "id": "6f3rb25rb5q5jvgffdv2jvr8rv", + "text": "Asthma", + "display-or": "ନିଶ୍ବାଶ ନେବା ରେ କଷ୍ଟ", + "options": [ + { + "id": "ID_479323452", + "text": "Since", + "display": "When were you diagnosed?", + "input-type": "date", + "display-or": "କେବେ ଜଣା ପଡ଼ିଥିଲା" + }, + { + "id": "ID_1533422168", + "text": "Current medication", + "display-or": "ଏବେ କ’ଣ ଔଷଧ ଖାଉଛନ୍ତି", + "options": [ + { + "id": "ID_71438631", + "text": "[Describe]", + "input-type": "text", + "language": "%", + "display-or": "କେଉଁପରି" + }, + { + "id": "ID_1961136611", + "text": "Not taking any medication", + "display-or": "ନାଁ" + } + ] + } + ] + }, + { + "id": "38l21icefr40paikr5t8n4s46r", + "text": "Tuberculosis", + "display-or": "ଯକ୍ଷ୍ମା", + "options": [ + { + "id": "ID_856359070", + "text": "Since", + "display": "When were you diagnosed?", + "input-type": "date", + "display-or": "କେବେ ଜଣାପଡ଼ିଲା" + }, + { + "id": "6q6oio9kdl9qm1ng0pnaa4t32g", + "text": "Treatment", + "display": "Did you take treatment?", + "display-or": "କେମିତି ଚିକିସତ୍ା କରାହେଇଥିଲା", + "options": [ + { + "id": "ID_473168257", + "text": "Took treatment", + "language": "%", + "display-or": "ହଁ", + "options": [ + { + "id": "1grbt54tt3su55qqfdbnmhr1vu", + "text": "[Describe]", + "input-type": "text", + "language": "%", + "display-or": "କେଉଁପରି" + }, + { + "id": "ID_1011048331", + "text": "How long did you take the treatment?", + "input-type": "duration", + "language": "Treatment duration", + "display-or": "କେତେ ସମୟ ନେଇଥିଲା" + } + ] + }, + { + "id": "ID_1673676697", + "text": "Did not take treatment", + "display-or": "ନାଁ" + } + ] + } + ] + }, + { + "id": "50rcn4m78a1baik3sm5b4solsf", + "text": "Cancer/Tumour", + "display-or": "କର୍କଟ ବା କ୍ଯାନସର", + "options": [ + { + "id": "ID_1789247298", + "text": "Cancer/Tumour type", + "display": "Describe the disease", + "input-type": "text", + "display-or": "ବର୍ଣ୍ଣନା" + }, + { + "id": "ID_131276372", + "text": "Since", + "display": "When were you diagnosed?", + "input-type": "date", + "display-or": "କେବେ ଜଣାପଡ଼ିଲା" + }, + { + "id": "ID_1460526165", + "text": "Current medication", + "display-or": "ଏବେ କଣ ଓ ଔଷଧ ଖାଉଛନ୍ତି", + "options": [ + { + "id": "ID_1815440872", + "text": "[Describe]", + "input-type": "text", + "language": "%", + "display-or": "କେଉଁପରି" + }, + { + "id": "ID_1363444390", + "text": "Not taking any medication", + "display-or": "ନାଁ" + } + ] + } + ] + }, + { + "id": "ID_795133263", + "text": "HIV/AIDS", + "display-or": "ଏଡ୍ସ", + "options": [ + { + "id": "ID_138631831", + "text": "Since", + "display": "When were you diagnosed?", + "input-type": "date", + "display-or": "କେତେ ଜଣାପଡ଼ିଲା" + }, + { + "id": "ID_1680905163", + "text": "Current medication", + "display-or": "ଏବେ କଣ ଓ ଔଷଧ ଖାଉଛନ୍ତି", + "options": [ + { + "id": "ID_1324404695", + "text": "[Describe]", + "input-type": "text", + "language": "%", + "display-or": "କେଉଁପରି" + }, + { + "id": "ID_1584603543", + "text": "Not taking any medication", + "display-or": "ନାଁ" + } + ] + } + ] + }, + { + "id": "5b04qcal4vufiuiughhpt03qi2", + "text": "Operation", + "display-or": "ଅପରେସନ", + "options": [ + { + "id": "6n6qdfi3hnt49qrrscul658kfl", + "text": "Location/Type", + "display": "What was the operation?", + "display-or": "କୋଉଠି ହୋଇଥିଲା", + "options": [ + { + "id": "0gfqoo018929uap939vu824kub", + "text": "Head (Eyes/Ears/Nose/Mouth)", + "display-or": "ମୁଣ୍ଡ (ଅାଖି, କାନ, ନାକ, ମୁହଁ)" + }, + { + "id": "03nejfqipjq4c23mnt1qbldubo", + "text": "Neck", + "display-or": "ବେକ" + }, + { + "id": "1nfbsi9tkga3kdbv76g5g30lsa", + "text": "Chest (Heart/Lung/Breast)", + "display-or": "ଛାତି (ହାର୍ଟ, ଫୁସ୍ଫୁସ୍, ସ୍ରନ)" + }, + { + "id": "6kn2b76huhl9u3bu43prloda3t", + "text": "Abdomen (Stomach/Liver/Bile/Kidney/Colon)", + "display-or": "ପେଟ (ପାକସ୍ଥଳୀ, ଯକୃତ ବୃକକ୍, ଅଗ୍ନାଶୟ, କ୍ଷୁଦ୍ରାନ୍ତ ଓ ବୃହଦାନ୍ତ" + }, + { + "id": "3ponp65pt9bq34bdeq8gfgs25m", + "text": "Back/Spine", + "display-or": "ପିଠି ଓ ମେରୁଦଣ୍ଡ, ପ୍ଳିସା" + }, + { + "id": "2crafqisr99g2t85728nmpda9s", + "text": "Hip", + "display-or": "ଅଣଟା" + }, + { + "id": "2hojliuelejcmv1m1ki2qardfl", + "text": "Arms (Elbows/Wrist)", + "display-or": "ହାତ, ବାହୁ" + }, + { + "id": "7v5fg9qha5ftfpocc5p3j3llin", + "text": "Legs (Knees/Feet)", + "display-or": "ଗୋଡ଼, ପାଦ, ଜଘଂ" + }, + { + "id": "0gaej2j5rll5ts1o3f8nm0iml4", + "text": "Prostate", + "display-or": "ପ୍ରୋଷ୍ଟେଟ୍" + }, + { + "id": "4obc47pd9rkcp60ae9hh3lljvr", + "text": "C-Section", + "display-or": "ପିଲାଜନ୍ମ ଅପରେସନ" + }, + { + "id": "2pdjbliq1pbkvh1vjcffrtsku6", + "text": "Hysterectomy", + "display-or": "ଜରାୟୁ" + }, + { + "id": "ID_843281245", + "text": "Other [Describe]", + "input-type": "text", + "display-or": "ଅାଉ କିପରି" + } + ] + }, + { + "id": "ID_904676221", + "text": "Occured on", + "display": "When did it occur?", + "input-type": "date", + "display-or": "କେବେ ହୋଇଥିଲା" + } + ] + }, + { + "id": "533u2k4n4971j34dcvljkv53up", + "text": "Accident", + "display-or": "ଦୁର୍ଘଟଣା", + "options": [ + { + "id": "ID_948346954", + "text": "Occured on", + "display": "When did it occur?", + "input-type": "date", + "display-or": "କେବେ ହୋଇଥିଲା" + } + ] + }, + { + "id": "ID_1217722719", + "text": "Hospitalization", + "display-or": "hospital ରେ ଭର୍ତି ହୋଇଥିଲା", + "options": [ + { + "id": "ID_601054142", + "text": "Occured on", + "display": "When did it occur?", + "input-type": "date", + "display-or": "କେବେ ହୋଇଥିଲା" + }, + { + "id": "ID_1902903650", + "text": "Reason", + "input-type": "text", + "display-or": "କାରଣ" + }, + { + "id": "ID_1440129311", + "text": "Duration", + "display": "How long were you hospitalized?", + "input-type": "duration", + "display-or": "କେତେ ସମୟ ଭର୍ତି ହୋଇଥିଲା" + } + ] + } + ] +} \ No newline at end of file diff --git a/app/src/main/assets/patHist.json b/app/src/main/assets/patHist.json new file mode 100644 index 0000000000..9fb30a2f14 --- /dev/null +++ b/app/src/main/assets/patHist.json @@ -0,0 +1,819 @@ +{ + "id": "3bdlnqpm78un86npauhh5oobq5", + "text": "Patient History", + "options": [ + { + "id": "ID_1421528652", + "text": "Pregnancy status", + "display-or": "ଗର୍ଭ", + "options": [ + { + "id": "ID_686727285", + "text": "Patient is unmarried", + "display-or": "ଅବିବାହିତ" + }, + { + "id": "ID_1767078340", + "text": "Yes", + "language": "Pregnant", + "display-or": "ହଁ", + "options": [ + { + "id": "ID_505838034", + "text": "Last menstruation period", + "input-type": "date", + "display-or": "ଶେଷ ମାସିକିଅା କେବେ" + } + ] + }, + { + "id": "ID_629184183", + "text": "No", + "language": "Not pregnant", + "display-or": "ନାହିଁ" + }, + { + "id": "ID_1296076911", + "text": "Don't know", + "language": "Pregnancy status not known", + "display-or": "ଜଣା ନାହିଁ" + } + ] + }, + { + "id": "ID_1216797604", + "text": "Allergies", + "display": "Do you have any allergies?", + "display-or": "କେଉଁ ଆଲର୍ଜି ଅଛି କ?", + "options": [ + { + "id": "ID_1182630066", + "text": "Yes [Describe]", + "input-type": "text", + "language": "%", + "display-or": "ହଁ କେଉଁପରି" + }, + { + "id": "ID_1336561607", + "text": "No known allergies", + "display-or": "ନାଁ" + } + ] + }, + { + "id": "ID_488941477", + "text": "Alcohol use", + "display-or": "ମଦ", + "options": [ + { + "id": "ID_858796823", + "text": "Yes", + "display-or": "ହଁ", + "options": [ + { + "id": "ID_1464551289", + "text": "[Enter since when]", + "input-type": "duration", + "display-or": "କେବେ ଠାରୁ", + "language": "Since:" + }, + { + "id": "ID_541643837", + "text": "Frequency", + "input-type": "text", + "display": "How often do you take alcohol?", + "display-or": "କେତେ ଥର ନିଅ" + }, + { + "id": "ID_449910899", + "text": "Number of drinks consumed in one go", + "display-or": "ଥର କରେ କେତେ ନିଅ?", + "options": [ + { + "id": "ID_353665659", + "text": "1-2" + }, + { + "id": "ID_1083178746", + "text": "3-4" + }, + { + "id": "ID_339759237", + "text": "5-6" + }, + { + "id": "ID_1073159208", + "text": ">=7" + } + ] + } + ] + }, + { + "id": "ID_1066408122", + "text": "No/Denied", + "display-or": "ନ/ ମନ କରିବ" + } + ] + }, + { + "id": "ID_1479282969", + "text": "Smoking history", + "display-or": "ଧୂଅାଁ ଧୂମ୍ରପାନ", + "options": [ + { + "id": "ID_318732760", + "text": "Never-smoker", + "language": "Patient denied/has no h/o smoking", + "display-or": "କେବେ ନୁହେଁ" + }, + { + "id": "ID_1599020946", + "text": "Current-smoker", + "language": "Patient is a smoker", + "display-or": "ଏବେ ଧୁମ୍ରପାନ କରୁ ଛ", + "options": [ + { + "id": "ID_815751980", + "text": "[Enter since when]", + "input-type": "duration", + "language": "Since:", + "display-or": "କେବେଠାରୁ" + }, + { + "id": "ID_1655069807", + "text": "How many cigarettes per day do you smoke?", + "input-type": "number", + "language": "No. of cigarettes smoked/day:", + "display-or": "ଦିନକୁ କେତେଟା" + } + ] + }, + { + "id": "ID_803362413", + "text": "Ex-smoker", + "language": "Patient was a smoker", + "display-or": "ଆଗରୁ ଧୁମ୍ରପାନ କରୁଥିଲା", + "options": [ + { + "id": "ID_22359699", + "text": "How many cigarettes per day did you smoke?", + "input-type": "number", + "language": "No. of cigarettes smoked/day:", + "display-or": "ଦିନକୁ କେତେଟା" + }, + { + "id": "ID_370617072", + "text": "From", + "input-type": "date", + "display-or": "କେବେଠାରୁ" + }, + { + "id": "ID_1148758817", + "text": "To", + "input-type": "date", + "display-or": "କେଉଁ ପର୍ଯ୍ଯନ୍ତ" + } + ] + } + ] + }, + { + "id": "ID_1294148047", + "text": "Drug history", + "display": "Have you recently taken any kind of medicine (including ayurvedic/homeopathic/unani/herbal)?", + "display-or": "ତମେ ଆଗର କେବେ ଔଷଦ ନାଇଛ କି?", + "options": [ + { + "id": "ID_1388678356", + "text": "No", + "language": "No recent medication", + "display-or": "ନାଁ" + }, + { + "id": "ID_465969786", + "text": "Yes", + "language": "%", + "display-or": "ହଁ", + "options": [ + { + "id": "ID_1905877530", + "text": "Medication name 1", + "input-type": "text", + "display-or": "ଔଷଧ ନାମ 1", + "options": [ + { + "id": "ID_1689701069", + "text": "From", + "input-type": "date", + "display-or": "କେବେଠାରୁ" + }, + { + "id": "ID_1008011661", + "text": "To", + "input-type": "date", + "display-or": "କେଉଁ ପର୍ଯ୍ଯନ୍ତ" + } + ] + }, + { + "id": "ID_519893607", + "text": "Medication name 2", + "input-type": "text", + "display-or": "ଔଷଧ ନାମ 2", + "options": [ + { + "id": "ID_1617161985", + "text": "From", + "input-type": "date", + "display-or": "କେବେଠାରୁ" + }, + { + "id": "ID_64950422", + "text": "To", + "input-type": "date", + "display-or": "କେଉଁ ପର୍ଯ୍ଯନ୍ତ" + } + ] + }, + { + "id": "ID_1502080913", + "text": "Medication name 3", + "input-type": "text", + "display-or": "ଔଷଧ ନାମ 3", + "options": [ + { + "id": "ID_738451674", + "text": "From", + "input-type": "date", + "display-or": "କେବେଠାରୁ" + }, + { + "id": "ID_113852535", + "text": "To", + "input-type": "date", + "display-or": "କେଉଁ ପର୍ଯ୍ଯନ୍ତ" + } + ] + }, + { + "id": "ID_1501586422", + "text": "Medication name 4", + "input-type": "text", + "display-or": "ଔଷଧ ନାମ 4", + "options": [ + { + "id": "ID_1287862648", + "text": "From", + "input-type": "date", + "display-or": "କେବେଠାରୁ" + }, + { + "id": "ID_1590292190", + "text": "To", + "input-type": "date", + "display-or": "କେଉଁ ପର୍ଯ୍ଯନ୍ତ" + } + ] + }, + { + "id": "ID_255486354", + "text": "Medication name 5", + "input-type": "text", + "display-or": "ଔଷଧ ନାମ 5", + "options": [ + { + "id": "ID_1955040003", + "text": "From", + "input-type": "date", + "display-or": "କେବେଠାରୁ" + }, + { + "id": "ID_1832509360", + "text": "To", + "input-type": "date", + "display-or": "କେଉଁ ପର୍ଯ୍ଯନ୍ତ" + } + ] + }, + { + "id": "ID_1705452987", + "text": "Medication Adherence", + "display": "How often do you have trouble taking medicines the way you have been told to take them?", + "display-or": "ଔଷଦ ନେବା ସମୟ ରେ ଅସୁବିଧା ସେମାନଂକୁ ପଚାରିଥିଲେ କି?", + "options": [ + { + "id": "ID_621583351", + "text": "I always take them as prescribed", + "language": "Patient always takes medicine as prescribed", + "display-or": "ମୁ ସବୁ ବେଳେ ସେମାଙ୍କର ଚିଠା ନିଏ" + }, + { + "id": "ID_1330901869", + "text": "Sometimes I take them as prescribed", + "language": "Patient sometimes takes medicines as prescribed", + "display-or": "ବେଳେ ବେଳେ ସେମାଙ୍କର ଚିଠା ନିଏ" + }, + { + "id": "ID_1896221092", + "text": "I seldom take them as prescribed", + "language": "Patient seldom takes medicine as prescribed", + "display-or": "କିଛି ସମୟରେ ନିଏ" + } + ] + } + ] + } + ] + }, + { + "id": "553uunvdc4uq9oe860n2mtbd62", + "text": "High Blood Pressure", + "display-or": "ଉଚ୍ଚ ରକ୍ତଚାପ", + "options": [ + { + "id": "4gnb2kln9nvarkf1hn54iih13b", + "text": "Diagnosed on ", + "input-type": "date", + "display-or": "କେତେ ଜଣାପଡ଼ିଲା" + }, + { + "id": "ID_413173969", + "text": "Current medication", + "display-or": "କଣ ଔଷଧ ଖାଉଛନ୍ତି", + "options": [ + { + "id": "ID_188140409", + "text": "[Describe]", + "input-type": "text", + "language": "%", + "display-or": "ହଁ କେଉଁପରି" + }, + { + "id": "ID_559800345", + "text": "Not taking any medication", + "display-or": "ନାଁ" + } + ] + } + ] + }, + { + "id": "2t624p0ss7caug21hd4efumj4n", + "text": "Heart Problems", + "display-or": "ହାର୍ଟ ପ୍ରୋବ୍ଲେମ", + "options": [ + { + "id": "ID_1743003464", + "text": "Problem description", + "input-type": "text", + "language": "%", + "display": "What was the problem?", + "display-or": "ଅସୁବିଧା କଣ ହେଉଥିଲା" + }, + { + "id": "0fq5omh0fjmcot6v89tmmujs45", + "text": "Occured/Diagnosed on", + "input-type": "date", + "display-or": "କେତେ ଜଣାପଡ଼ିଲା" + }, + { + "id": "5f1pjn5mukmjrsvfnkp24nlq0q", + "text": "Treatment", + "display": "How was it treated?", + "display-or": "କେମିତି ଚିକିସତ୍ା କରାହେଇଥିଲା", + "options": [ + { + "id": "1rsrtassckdufd1v66g679huai", + "text": "Surgery", + "display-or": "ଅପରେସନ" + }, + { + "id": "3ih5vrd5crs57nrsfnsl9arcot", + "text": "Angioplasty", + "display-or": "ଅାଞ୍ଜିଓପ୍ଳାଷ୍ଟି" + }, + { + "id": "6g0frvbl14quckj6e0i2hcc7e1", + "text": "Medication", + "display-or": "ଔଷଧ" + }, + { + "id": "ID_938378473", + "text": "Other [Describe]", + "input-type": "text", + "language": "%", + "display-or": "ଅାଉ କିପରି" + } + ] + }, + { + "id": "ID_615919605", + "text": "Current medication", + "display-or": "ଏବେ କ’ଣ ଔଷଧ ଖାଉଛନ୍ତି", + "options": [ + { + "id": "ID_1320661699", + "text": "[Describe]", + "input-type": "text", + "language": "%", + "display-or": "କେଉଁପରି" + }, + { + "id": "ID_531462972", + "text": "Not taking any medication", + "display-or": "ନାଁ" + } + ] + } + ] + }, + { + "id": "52dkambh5lhqmlg9bkghn1gicb", + "text": "Stroke", + "display-or": "ପରଲିସିସ attack", + "options": [ + { + "id": "ID_545498382", + "text": "Occured on", + "input-type": "date", + "display-or": "କେବେ ହୋଇଥିଲା" + }, + { + "id": "ID_1222999660", + "text": "Treatment", + "display": "How was it treated?", + "display-or": "କେମିତି ଚିକିସତ୍ା କରାହେଇଥିଲା", + "options": [ + { + "id": "ID_1622266745", + "text": "Surgery", + "display-or": "ଅପରେସନ" + }, + { + "id": "ID_1348167551", + "text": "Medication", + "display-or": "ଔଷଧ" + }, + { + "id": "ID_1424803469", + "text": "Other [Describe]", + "input-type": "text", + "language": "%", + "display-or": "ଅନ୍ୟାନ୍ୟ" + } + ] + }, + { + "id": "ID_1162336019", + "text": "Current medication", + "display-or": "ଏବେ କ’ଣ ଔଷଧ ଖାଉଛନ୍ତି", + "options": [ + { + "id": "ID_1104534286", + "text": "[Describe]", + "input-type": "text", + "language": "%", + "display-or": "କେଉଁପରି" + }, + { + "id": "ID_187354967", + "text": "Not taking any medication", + "display-or": "ନାଁ" + } + ] + } + ] + }, + { + "id": "62id4878o7nteih18eiup3j92c", + "text": "Diabetes", + "display-or": "ମଧୁମେହ", + "options": [ + { + "id": "52bvud72kt13igfoauucsubnuv", + "text": "Since", + "display": "When were you diagnosed?", + "display-or": "କେବେଠାରୁ", + "input-type": "date" + }, + { + "id": "ID_1870024323", + "text": "Current medication", + "display-or": "ଏବେ କ’ଣ ଔଷଧ ଖାଉଛନ୍ତି", + "options": [ + { + "id": "ID_274560179", + "text": "[Describe]", + "input-type": "text", + "language": "%", + "display-or": "କେଉଁପରି" + }, + { + "id": "ID_1247339075", + "text": "Not taking any medication", + "display-or": "ନାଁ" + } + ] + }, + { + "id": "25b4es720c3ehote8hv9824tck", + "text": "Last measured Blood Sugar and HbA1C", + "display-or": "ଶେଷ ପରୀକ୍ଷାର ସୁଗାର ଓ ଐଭଇ1ଉ କେତେ ଥିଲା", + "options": [ + { + "id": "ID_1804659027", + "text": "Not known", + "display-or": "ନୋଟ କଁଅବଂ" + }, + { + "id": "ID_701392638", + "text": "[Enter if known]", + "input-type": "text", + "display-or": "ନାଁ" + } + ] + } + ] + }, + { + "id": "6f3rb25rb5q5jvgffdv2jvr8rv", + "text": "Asthma", + "display-or": "ନିଶ୍ବାଶ ନେବା ରେ କଷ୍ଟ", + "options": [ + { + "id": "ID_479323452", + "text": "Since", + "display": "When were you diagnosed?", + "input-type": "date", + "display-or": "କେବେ ଜଣା ପଡ଼ିଥିଲା" + }, + { + "id": "ID_1533422168", + "text": "Current medication", + "display-or": "ଏବେ କ’ଣ ଔଷଧ ଖାଉଛନ୍ତି", + "options": [ + { + "id": "ID_71438631", + "text": "[Describe]", + "input-type": "text", + "language": "%", + "display-or": "କେଉଁପରି" + }, + { + "id": "ID_1961136611", + "text": "Not taking any medication", + "display-or": "ନାଁ" + } + ] + } + ] + }, + { + "id": "38l21icefr40paikr5t8n4s46r", + "text": "Tuberculosis", + "display-or": "ଯକ୍ଷ୍ମା", + "options": [ + { + "id": "ID_856359070", + "text": "Since", + "display": "When were you diagnosed?", + "input-type": "date", + "display-or": "କେବେ ଜଣାପଡ଼ିଲା" + }, + { + "id": "6q6oio9kdl9qm1ng0pnaa4t32g", + "text": "Treatment", + "display": "Did you take treatment?", + "display-or": "କେମିତି ଚିକିସତ୍ା କରାହେଇଥିଲା", + "options": [ + { + "id": "ID_473168257", + "text": "Took treatment", + "language": "%", + "display-or": "ହଁ", + "options": [ + { + "id": "1grbt54tt3su55qqfdbnmhr1vu", + "text": "[Describe]", + "input-type": "text", + "language": "%", + "display-or": "କେଉଁପରି" + }, + { + "id": "ID_1011048331", + "text": "How long did you take the treatment?", + "input-type": "duration", + "language": "Treatment duration", + "display-or": "କେତେ ସମୟ ନେଇଥିଲା" + } + ] + }, + { + "id": "ID_1673676697", + "text": "Did not take treatment", + "display-or": "ନାଁ" + } + ] + } + ] + }, + { + "id": "50rcn4m78a1baik3sm5b4solsf", + "text": "Cancer/Tumour", + "display-or": "କର୍କଟ ବା କ୍ଯାନସର", + "options": [ + { + "id": "ID_1789247298", + "text": "Cancer/Tumour type", + "display": "Describe the disease", + "input-type": "text", + "display-or": "ବର୍ଣ୍ଣନା" + }, + { + "id": "ID_131276372", + "text": "Since", + "display": "When were you diagnosed?", + "input-type": "date", + "display-or": "କେବେ ଜଣାପଡ଼ିଲା" + }, + { + "id": "ID_1460526165", + "text": "Current medication", + "display-or": "ଏବେ କଣ ଓ ଔଷଧ ଖାଉଛନ୍ତି", + "options": [ + { + "id": "ID_1815440872", + "text": "[Describe]", + "input-type": "text", + "language": "%", + "display-or": "କେଉଁପରି" + }, + { + "id": "ID_1363444390", + "text": "Not taking any medication", + "display-or": "ନାଁ" + } + ] + } + ] + }, + { + "id": "ID_795133263", + "text": "HIV/AIDS", + "display-or": "ଏଡ୍ସ", + "options": [ + { + "id": "ID_138631831", + "text": "Since", + "display": "When were you diagnosed?", + "input-type": "date", + "display-or": "କେତେ ଜଣାପଡ଼ିଲା" + }, + { + "id": "ID_1680905163", + "text": "Current medication", + "display-or": "ଏବେ କଣ ଓ ଔଷଧ ଖାଉଛନ୍ତି", + "options": [ + { + "id": "ID_1324404695", + "text": "[Describe]", + "input-type": "text", + "language": "%", + "display-or": "କେଉଁପରି" + }, + { + "id": "ID_1584603543", + "text": "Not taking any medication", + "display-or": "ନାଁ" + } + ] + } + ] + }, + { + "id": "5b04qcal4vufiuiughhpt03qi2", + "text": "Operation", + "display-or": "ଅପରେସନ", + "options": [ + { + "id": "6n6qdfi3hnt49qrrscul658kfl", + "text": "Location/Type", + "display": "What was the operation?", + "display-or": "କୋଉଠି ହୋଇଥିଲା", + "options": [ + { + "id": "0gfqoo018929uap939vu824kub", + "text": "Head (Eyes/Ears/Nose/Mouth)", + "display-or": "ମୁଣ୍ଡ (ଅାଖି, କାନ, ନାକ, ମୁହଁ)" + }, + { + "id": "03nejfqipjq4c23mnt1qbldubo", + "text": "Neck", + "display-or": "ବେକ" + }, + { + "id": "1nfbsi9tkga3kdbv76g5g30lsa", + "text": "Chest (Heart/Lung/Breast)", + "display-or": "ଛାତି (ହାର୍ଟ, ଫୁସ୍ଫୁସ୍, ସ୍ରନ)" + }, + { + "id": "6kn2b76huhl9u3bu43prloda3t", + "text": "Abdomen (Stomach/Liver/Bile/Kidney/Colon)", + "display-or": "ପେଟ (ପାକସ୍ଥଳୀ, ଯକୃତ ବୃକକ୍, ଅଗ୍ନାଶୟ, କ୍ଷୁଦ୍ରାନ୍ତ ଓ ବୃହଦାନ୍ତ" + }, + { + "id": "3ponp65pt9bq34bdeq8gfgs25m", + "text": "Back/Spine", + "display-or": "ପିଠି ଓ ମେରୁଦଣ୍ଡ, ପ୍ଳିସା" + }, + { + "id": "2crafqisr99g2t85728nmpda9s", + "text": "Hip", + "display-or": "ଅଣଟା" + }, + { + "id": "2hojliuelejcmv1m1ki2qardfl", + "text": "Arms (Elbows/Wrist)", + "display-or": "ହାତ, ବାହୁ" + }, + { + "id": "7v5fg9qha5ftfpocc5p3j3llin", + "text": "Legs (Knees/Feet)", + "display-or": "ଗୋଡ଼, ପାଦ, ଜଘଂ" + }, + { + "id": "0gaej2j5rll5ts1o3f8nm0iml4", + "text": "Prostate", + "display-or": "ପ୍ରୋଷ୍ଟେଟ୍" + }, + { + "id": "4obc47pd9rkcp60ae9hh3lljvr", + "text": "C-Section", + "display-or": "ପିଲାଜନ୍ମ ଅପରେସନ" + }, + { + "id": "2pdjbliq1pbkvh1vjcffrtsku6", + "text": "Hysterectomy", + "display-or": "ଜରାୟୁ" + }, + { + "id": "ID_843281245", + "text": "Other [Describe]", + "input-type": "text", + "display-or": "ଅାଉ କିପରି" + } + ] + }, + { + "id": "ID_904676221", + "text": "Occured on", + "display": "When did it occur?", + "input-type": "date", + "display-or": "କେବେ ହୋଇଥିଲା" + } + ] + }, + { + "id": "533u2k4n4971j34dcvljkv53up", + "text": "Accident", + "display-or": "ଦୁର୍ଘଟଣା", + "options": [ + { + "id": "ID_948346954", + "text": "Occured on", + "display": "When did it occur?", + "input-type": "date", + "display-or": "କେବେ ହୋଇଥିଲା" + } + ] + }, + { + "id": "ID_1217722719", + "text": "Hospitalization", + "display-or": "hospital ରେ ଭର୍ତି ହୋଇଥିଲା", + "options": [ + { + "id": "ID_601054142", + "text": "Occured on", + "display": "When did it occur?", + "input-type": "date", + "display-or": "କେବେ ହୋଇଥିଲା" + }, + { + "id": "ID_1902903650", + "text": "Reason", + "input-type": "text", + "display-or": "କାରଣ" + }, + { + "id": "ID_1440129311", + "text": "Duration", + "display": "How long were you hospitalized?", + "input-type": "duration", + "display-or": "କେତେ ସମୟ ଭର୍ତି ହୋଇଥିଲା" + } + ] + } + ] +} \ No newline at end of file diff --git a/app/src/main/assets/physExam-or-translation.json b/app/src/main/assets/physExam-or-translation.json new file mode 100644 index 0000000000..141cdfcee8 --- /dev/null +++ b/app/src/main/assets/physExam-or-translation.json @@ -0,0 +1,3747 @@ +{ + "id": "476q4jppos6tg7t3qug97udg17", + "text": "Physical Exam", + "options": [ + { + "id": "7hrmfqn0krat7sjobfh9rjr5i0", + "text": "General exams", + "language": "General Exams:", + "display-or": "ସାଧାରଣ ପରୀକ୍ଷା", + "options": [ + { + "id": "0blae61v5pgt9hcv3fni2ad6nd", + "text": "Eyes: Jaundice", + "display-or": "ଅାଖି: ହଳଦିଅା", + "options": [ + { + "id": "5saf8na9hgasnsda8khh7jgqdm", + "text": "Is there jaundice?", + "job-aid-type": "image", + "job-aid-file": "jaundiceexample", + "language": "%", + "display-or": "କାମଳ ଅଛକି?", + "options": [ + { + "id": "0tniotfjt5upifs5ndt3grbstg", + "text": "Yes", + "language": "jaundice seen", + "display-or": "ହଁ" + }, + { + "id": "3gnt6celojtod43p771dq8ivr0", + "text": "No", + "language": "no jaundice seen", + "display-or": "ନାଁ" + }, + { + "id": "ID_1214278407", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "ଫଟ ନିଅ" + } + ] + } + ] + }, + { + "id": "ID_415887386", + "text": "Eyes: Pallor", + "display-or": "ଅାଖି: ଧଳା", + "options": [ + { + "id": "3lntlnfs0va65rqdo136utmfmf", + "text": "Is there pallor?", + "job-aid-type": "video", + "job-aid-file": "conjunctivaexample", + "language": "%", + "display-or": "ରକ୍ତ ହୀନତା ଅଛି କି?", + "options": [ + { + "id": "7o55cbfvcet2dtkj43ssip5je9", + "text": "Pale", + "language": "pale pallor", + "display-or": "ଅଛି" + }, + { + "id": "2pt0hg68o89t624k0b2ngp16a2", + "text": "Normal", + "language": "normal pallor", + "display-or": "ନାହିଁ" + }, + { + "id": "ID_1954219899", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "ଫଟ ନିଅ" + } + ] + } + ] + }, + { + "id": "0gfk4826emivm01aoeltg2lrfb", + "text": "Arm", + "display-or": "ବାହୁ", + "options": [ + { + "id": "6qtsmnaurf40drgsbpf55dbbef", + "text": "Pinch skin", + "display-or": "ଚମଡ଼ା ପଶିଯିବା", + "options": [ + { + "id": "2ba1sf5pis2bk3lbe6hqjvm13c", + "text": "Normal", + "language": "pinch test normal", + "display-or": "ହଁ" + }, + { + "id": "0u9urrb01daa0g0u9hi5bc2dr5", + "text": "Slow", + "language": "appears slow on pinch test", + "display-or": "ନାଁ" + } + ] + } + ] + }, + { + "id": "4skk1vd3pgmhh4v0qmt1vff91m", + "text": "Nail abnormality", + "display-or": "ହାତ", + "options": [ + { + "id": "5s4jcisk6ipicrd2k55uvef0gg", + "text": "Is there any nail abnormality?", + "job-aid-type": "image", + "job-aid-file": "abnormalnails", + "language": "%", + "display-or": "ନଖ ଫୁଲିଛି କି?", + "options": [ + { + "id": "31mlk01davo6blu1as82mim2u3", + "text": "Nails are normal", + "language": "nails normal", + "display-or": "ଫୁଲା ଅଛି" + }, + { + "id": "3fp5hubboifaqe6hn9bsck3rq3", + "text": "Clubbing", + "language": "clubbing", + "display-or": "ନଖ ଚତ୍ମୁଚି ଭଳି ପଶି ଯାଇଛି" + }, + { + "id": "6iq8nsiocdpje2eslgao0g5c4s", + "text": "Spoon Nails", + "language": "spoon nails", + "display-or": "ରଙ୍ଗ ପରିବର୍ତ୍ତନ ହେଉଛ" + }, + { + "id": "6luvtcj14erouol995jtnm4rf7", + "text": "Discolored", + "language": "discolored nails", + "display-or": "ଠିକ୍ ଅଛି" + }, + { + "id": "ID_428480652", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "ଫଟ ନିଅ" + } + ] + } + ] + }, + { + "id": "ID_888899761", + "text": "Nail anemia", + "display-or": "ନଖ ର ଆନେମିଆ", + "options": [ + { + "id": "ID_1109515145", + "text": "Are the nails pale?", + "language": "%", + "display-or": "ନଖ ରେ ଫିକା ରଂଗ", + "options": [ + { + "id": "ID_1933772393", + "text": "Nails are pale", + "display-or": "ଫିକା ରଂଗ" + }, + { + "id": "ID_377766203", + "text": "Nails are not pale", + "display-or": "ଫିକା ରଂଗ ନାହିଁ" + }, + { + "id": "ID_646885323", + "text": "Take a picture", + "input-type": "camera", + "display-or": "ଫଟ ନିଅ" + } + ] + } + ] + }, + { + "id": "0lhp3ulsufnavi3f7o0bdg66s3", + "text": "Ankle", + "display-or": "ଗୋଇଠି", + "options": [ + { + "id": "3ufr8egutqs65irlr8u2gi8iid", + "text": "Is there ankle oedema?", + "job-aid-type": "image", + "job-aid-file": "ankleedemaexample", + "language": "%", + "display-or": "ଗୋଇଠି ଫୁଲିଛି କି?", + "options": [ + { + "id": "7266ke3fpvk3kv2bplvf7cqcl2", + "text": "In left", + "language": "pedal oedema in left foot", + "display-or": "ବାମ" + }, + { + "id": "ID_287551897", + "text": "In right", + "language": "pedal oedema in right foot", + "display-or": "ଡାହାଣ" + }, + { + "id": "ID_1390923199", + "text": "Both", + "language": "pedal oedema in both feet", + "display-or": "ଉଭୟ ପଟ" + }, + { + "id": "7s72difltncg15eq8uk51djqv6", + "text": "No oedema", + "language": "no pedal oedema", + "display-or": "ନାହିଁ" + }, + { + "id": "ID_1292783417", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "ଫଟ ନିଅ" + } + ] + } + ] + } + ] + }, + { + "id": "6ckop7kklhdihk474m4f0t58vc", + "text": "Head", + "language": "Head:", + "display-or": "ମୁଣ୍ଡ", + "options": [ + { + "id": "2oumf1tm37dejb5619lr2gb0c2", + "text": "Injury", + "display-or": "ଅଘାତ", + "language": "%", + "options": [ + { + "id": "365fe3npmo15fs1idpt9qq4v4i", + "text": "Inspect the head from all sides and look for injuries.", + "language": "%", + "display-or": "ଆଘାତ ପାଇଁ ପୁରା ମୁଂଡ କୁ ଦେଖ", + "options": [ + { + "id": "46ggknqga16skrkurisdrkmlga", + "text": "No injury", + "display-or": "ଅାଘାତ ନାହିଁ" + }, + { + "id": "2mtljhbu43q7fn4nj8rn6c1f00", + "text": "Injury at side of head", + "display-or": "ଅାଘାତ କଙ୍ଗ଼ରେ" + }, + { + "id": "3uukeqlno2pg63i0ftshkllst5", + "text": " Injury in the middle of head", + "display-or": "ଅାଘାତ ମଝିରେ" + }, + { + "id": "ID_1624337048", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "ଫଟ ନିଅ" + } + ] + } + ] + }, + { + "id": "0rr3s1emht4njnse07f3o7rsde", + "text": "Swelling", + "display-or": "ଫୁଲିବା", + "language": "%", + "options": [ + { + "id": "5ge0k8tpp7b8dukmd0pm88mu8f", + "text": "Are there any swellings?", + "language": "%", + "display-or": "ଫୁଲା ଅଛିକି?", + "options": [ + { + "id": "3p1cueosmgjfeab59c38smq1rs", + "text": "No swelling", + "display-or": "ଫୁଲା ନାହିଁ" + }, + { + "id": "7l32ahbdi2fkbb8od9l1u0coju", + "text": "Swelling at side of head", + "display-or": "ଫୁଲା କଙ୍ଗ଼ରେ" + }, + { + "id": "4dqpsgo07bkjp5ks5hgbqpvp6g", + "text": "Swelling at middle of head", + "display-or": "ଫୁଲା ମଝିରେ" + }, + { + "id": "ID_1097524513", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "ଫଟ ନିଅ" + } + ] + } + ] + } + ] + }, + { + "id": "3q5em0r7dg0frq12aobko11338", + "text": "Ear", + "language": "Ear:", + "display-or": "କାନ", + "options": [ + { + "id": "2fbasmki3ofs2bri4sk2vlenb6", + "text": "Bleeding", + "display-or": "ରକ୍ତବୋହିବା", + "language": "%", + "options": [ + { + "id": "096lo55ndv4h6fe645nt299mt5", + "text": "Is there any bleeding from ear?", + "language": "%", + "display-or": "ରକ୍ତ ବୋହୁଛିକି?", + "options": [ + { + "id": "2i5v2oc3gdosvo5m9n227p4bo5", + "text": "Yes", + "language": "bleeding seen from ear", + "display-or": "ହଁ" + }, + { + "id": "74gfff8rpeuss6218bb4lma3dr", + "text": "No", + "language": "no bleeding seen from the ear", + "display-or": "ନାଁ" + }, + { + "id": "ID_1278760897", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "ଫଟ ନିଅ" + } + ] + } + ] + }, + { + "id": "1pmas2h9k9hq3q5qqdmlk1nmh5", + "text": "Discharge", + "display-or": "କାନରୁ ପାଣି ବାହାରିବା", + "language": "%", + "options": [ + { + "id": "3ib4lpsg2rub7iorp5qlcm4086", + "text": "Is there any discharge from the ear?", + "language": "%", + "display-or": "କାନରୁ ପାଣି ବାହାରୁଚି କି?", + "options": [ + { + "id": "4turgn4sskcj3hvlvb78gu8il9", + "text": "Yes", + "language": "discharge seen from ear", + "display-or": "ହଁ" + }, + { + "id": "60581gqn41acafejd4ai1491l0", + "text": "No", + "language": "no discharge seen from the ear", + "display-or": "ନାଁ" + }, + { + "id": "ID_1447435625", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "ଫଟ ନିଅ" + } + ] + } + ] + }, + { + "id": "ID_865794463", + "text": "Redness", + "display-or": "ନାଲିପଡିବା", + "language": "%", + "options": [ + { + "id": "ID_1329408645", + "text": "Is there any redness in the ear?", + "display-or": "କାନ ନାଲି ପଡିଛି କି ?", + "language": "%", + "options": [ + { + "id": "ID_1109132835", + "text": "Yes", + "language": "Redness seen in ear", + "display-or": "ହଁ" + }, + { + "id": "ID_1349928351", + "text": "No", + "language": "No redness seen in ear", + "display-or": "ନାଁ" + }, + { + "id": "ID_260586471", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "ଫଟ ନିଅ" + } + ] + } + ] + }, + { + "id": "ID_1401870323", + "text": "Swelling", + "display-or": "ଫୁଲିବା", + "language": "%", + "options": [ + { + "id": "ID_1965239296", + "text": "Are there any swellings in the ear?", + "display-or": "ଫୁଲିଛି କି ? ଯଦି ହଁ ଫୋଟ ନିଅ", + "language": "%", + "options": [ + { + "id": "ID_1130685792", + "text": "Yes", + "language": "no discharge seen from the ear", + "display-or": "ହଁ" + }, + { + "id": "ID_1436663527", + "text": "No", + "language": "Swelling not seen", + "display-or": "ନାଁ" + }, + { + "id": "ID_1602694544", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "ଫଟ ନିଅ" + } + ] + } + ] + } + ] + }, + { + "id": "2qqfs0jt4knpcaubtav7p59i84", + "text": "Eyes", + "language": "Eyes:", + "display-or": "ଅାଖି", + "options": [ + { + "id": "5kpauqr2clsrjg20htagccpf1r", + "text": "Pupillary movement", + "display-or": "କଳା ଡ଼ୋଳାକୁ", + "language": "%", + "options": [ + { + "id": "1a51vkv5a5mgu91ae0kk19kbil", + "text": "Shine a torch and look for pupillary movements", + "language": "%", + "display-or": "ଟର୍ଚ୍ଚରେ କଳା ଡ଼ୋଳାକୁ ପରୀକ୍ଷା କର", + "options": [ + { + "id": "2cl2p4oqmas4jqc4cl9oj1ce43", + "text": "Moving", + "language": "pupils moving", + "display-or": "ଖୋଲା ବନ୍ଦ ହେଉଛିି" + }, + { + "id": "4lp77jenv79emvs3g9q62d5hir", + "text": "Not moving", + "language": "pupils not moving", + "display-or": "ହେଉନାହିଁ" + } + ] + } + ] + }, + { + "id": "ID_1971891989", + "text": "Redness", + "display-or": "ନାଲିପଡିବା", + "language": "%", + "options": [ + { + "id": "ID_674365352", + "text": "Is there any redness in the eye(s)?", + "language": "%", + "display-or": "ଆଖିରେ ଲାଲ ପଡିଛି କି ?", + "options": [ + { + "id": "ID_1992202071", + "text": "Yes", + "language": "redness seen", + "display-or": "ହଁ" + }, + { + "id": "ID_270777114", + "text": "No", + "language": "no redness seen", + "display-or": "ନାଁ" + }, + { + "id": "ID_769598133", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "ଫଟ ନିଅ" + } + ] + } + ] + }, + { + "id": "ID_15402514", + "text": "Discharge", + "display-or": "ବାହାରିବା /ଝରିବା", + "language": "%", + "options": [ + { + "id": "ID_566968371", + "text": "Is there any discharge from the eye?", + "language": "%", + "display-or": "ଆଖୀ ରୁ କିଛି ଝଡ଼ୁଛି କି ? ଯଦି ହଁ ଫୋଟ ନିଅ", + "options": [ + { + "id": "ID_540815308", + "text": "Yes", + "language": "discharge seen", + "display-or": "ହଁ" + }, + { + "id": "ID_1481304305", + "text": "No", + "language": "no discharge", + "display-or": "ନାଁ" + }, + { + "id": "ID_1815382231", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "ଫଟ ନିଅ" + } + ] + } + ] + }, + { + "id": "ID_1143132576", + "text": "Swelling", + "display-or": "ଫୁଲିବା", + "language": "%", + "options": [ + { + "id": "ID_1250004705", + "text": "Is there any swelling of eyelid?", + "language": "%", + "display-or": "ଆଖି ପତାରେ ଫୁଲ ଅଛି ଲି?", + "options": [ + { + "id": "ID_122639287", + "text": "Yes", + "language": "Swelling seen", + "display-or": "ହଁ" + }, + { + "id": "ID_1444285590", + "text": "No", + "language": "No swelling seen", + "display-or": "ନାଁ" + }, + { + "id": "ID_1039325175", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "ଫଟ ନିଅ" + } + ] + } + ] + } + ] + }, + { + "id": "2dj3h6ujd39inj4t3odadnci0g", + "text": "Face", + "language": "Face:", + "display-or": "ମୁହଁ", + "options": [ + { + "id": "4kdr5q7hfltqa7jbrup14hdmir", + "text": "Swollen Face", + "display-or": "ମୁହଁ ଫୁଲିଛି କି?", + "language": "%", + "options": [ + { + "id": "28h85njs3ksiv480ik83hukua6", + "text": "Does the face appear swollen/puffy?", + "language": "%", + "display-or": "ମୁହଁଫୁଲା", + "options": [ + { + "id": "5fm4bpqfvupes9b5bu12fljiun", + "text": "Normal", + "language": "face appears normal", + "display-or": "ଫୁଲିଛି" + }, + { + "id": "4smb46om7l01kp76rk9qa5uu00", + "text": "Swollen", + "language": "face appears swollen", + "display-or": "ଫୁଲିନି" + }, + { + "id": "ID_387823315", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "ଫଟ ନିଅ" + } + ] + } + ] + } + ] + }, + { + "id": "6uitbkmgtq2oc68rhcui460g5r", + "text": "Mouth", + "language": "Mouth:", + "display-or": "ପାଟି", + "options": [ + { + "id": "6d8fdfle3o8h0pbqie1uvrmi2i", + "text": "Tongue Dryness", + "language": "%", + "display-or": "ଜିଭ ଶୁଖିଲା", + "options": [ + { + "id": "5j44qfvarua6569agutns5s590", + "text": "Is the tongue dry?", + "language": "%", + "display-or": "ଜିଭ ଶୁଖିଛି କି?", + "options": [ + { + "id": "06o03fpl9bs58km60o3r5k12nk", + "text": "Yes", + "language": "tongue is dry", + "display-or": "ହଁ" + }, + { + "id": "09rc564f4ctqqr5q0gtr2l0hvk", + "text": "No", + "language": "tongue is not dry", + "display-or": "ନାଁ" + } + ] + } + ] + }, + { + "id": "1s49fteqimutf8uj0eftnvntgk", + "text": "Discolouration of teeth", + "language": "%", + "display-or": "ଦାନ୍ତର ରଙ୍ଗ ପରିବର୍ତ୍ତନ", + "options": [ + { + "id": "22oq936aiq3ijdibnlu0a2otu0", + "text": "Open mouth, shine a torch to affected part and look for black spots on teeth/discoloured teeth", + "language": "%", + "display-or": "ଦାନ୍ତରେ ରଙ୍ଗ ପରିର୍ବ୍ତନ ହୋଇଛି କି?", + "options": [ + { + "id": "5tdoq169l36c0fdqngu5rdlt3p", + "text": "Teeth normal", + "language": "teeth are normal", + "display-or": "ଦାନ୍ତ ଠିକ୍ ଅଛି" + }, + { + "id": "47g8kpjfrdiijbt3jj7abue6mp", + "text": "Teeth have black spots", + "language": "black spots on teeth", + "display-or": "ଦାନ୍ତ କଳା ପଡ଼ିଛି" + }, + { + "id": "0vp1kncq7je5esav1oqe3smuto", + "text": "Teeth discoloured", + "language": "discoloured teeth", + "display-or": "ଦାନ୍ତ ରଙ୍ଗ ପରିବର୍ତ୍ତନ ହେଉଛି" + }, + { + "id": "ID_1578504135", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "ଫଟ ନିଅ" + } + ] + } + ] + }, + { + "id": "5l5v4nm5g9f1fchkd163hmg7ql", + "text": "Swelling of Gums", + "language": "%", + "display-or": "ମାଢି ଫୁଲିବା", + "options": [ + { + "id": "1afo09f1e5ijjoum5sb3utlter", + "text": "Look for swelling on gums", + "language": "%", + "display-or": "ମାଢି ଫୁଲିଛି କି?", + "options": [ + { + "id": "2l29uq49a8qk33g9ns8bfujo3u", + "text": "Yes", + "language": "gums swollen", + "display-or": "ହଁ" + }, + { + "id": "5dthi1ct8mq1snkua7oln8kb15", + "text": "No", + "language": "gums are not swollen", + "display-or": "ନାଁ" + }, + { + "id": "ID_1573386216", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "ଫଟ ନିଅ" + } + ] + } + ] + }, + { + "id": "ID_1772055565", + "text": "Gum bleeding", + "language": "%", + "display-or": "ମାଢ଼ିରୁ ରକ୍ତ", + "options": [ + { + "id": "ID_1525908874", + "text": "Is there bleeding from gums?", + "language": "%", + "display-or": "ମାଢ଼ିରୁ ରକ୍ତ ବାହାରୁଛି କି ?", + "options": [ + { + "id": "ID_1297637014", + "text": "Yes", + "language": "bleeding seen from gums", + "display-or": "ହଁ" + }, + { + "id": "ID_366660133", + "text": "No", + "language": "no bleeding seen from gums", + "display-or": "ନାଁ" + }, + { + "id": "ID_1320828522", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "ଫଟ ନିଅ" + } + ] + } + ] + }, + { + "id": "58cou8gf81umet06njv4oc1n6c", + "text": "Back of throat (redness, swelling)", + "language": "%", + "display-or": "ଗଳାରେ ନାଲି ପଡ଼ିବା", + "options": [ + { + "id": "6an5fe6s4b9n8c2fkmbmrc9l0o", + "text": "Ask patient to open mouth and stick tongue out. Shine a torch to examine the back of throat and look for swelling/redness", + "language": "%", + "display-or": "ଗଳା କୁ ଟର୍ଚ୍ଚରେ ପରୀକ୍ଷା କର (ଦେଖ ନାଲି ପଡ଼ିଛି ବା ଫୁଲିଛି)", + "options": [ + { + "id": "2ha0ob31n8csdscu6g8ren1tll", + "text": "Normal", + "language": "back of throat normal", + "display-or": "ଠିକ୍ ଅଛି" + }, + { + "id": "7j2f56orqds0jguel4tcb2hk6p", + "text": "Redness", + "language": "redness in back of throat", + "display-or": "ନାଲି ପଡ଼ିଛି" + }, + { + "id": "1tllmv1vhq187gn8isto9nv6qo", + "text": "Swelling", + "language": "swelling in back of throat", + "display-or": "ଫୁଲିଛି" + }, + { + "id": "ID_1881322286", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "ଫଟ ନିଅ" + } + ] + } + ] + }, + { + "id": "ID_829831396", + "text": "Oral thrush", + "language": "%", + "display-or": "ପାଟିରେ ଧଳା ଚିହ୍ନ", + "options": [ + { + "id": "ID_1860492995", + "text": "Are there white coating/patches on the tongue, mouth, inner cheeks or the back of the throat?", + "language": "%", + "display-or": "ଧଳା ଚିହ୍ନ -ଜିଭରେ ,ପାଟିରେ ,ଗାଲଭିତରେ ,ଗଳାରେ", + "options": [ + { + "id": "ID_1480041052", + "text": "Yes", + "language": "white patches seen in the mouth", + "display-or": "ହଁ" + }, + { + "id": "ID_65009506", + "text": "No", + "language": "no white patches seen in the mouth", + "display-or": "ନା" + }, + { + "id": "ID_1854090323", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "ଫଟ ନିଅ" + } + ] + } + ] + } + ] + }, + { + "id": "686dv52dr7uagp5s74qs85fpo0", + "text": "Neck", + "language": "Neck:", + "display-or": "ବେକ", + "options": [ + { + "id": "4o6f7q0eskkg9kq0v0r0a6h9fh", + "text": "Thyroid swelling", + "display-or": "ଥାଇରଏଡ଼୍ ଫୁଲିବା", + "options": [ + { + "id": "6sd6af4f1qgucbe17bq482fo2t", + "text": "Is there visible swelling in the front of the neck?", + "job-aid-type": "image", + "job-aid-file": "thyroidswelling", + "display-or": "ବେକରେ ସାମ୍ନା ପଟୁ କିଛି ଫୁଲିଛି କି?", + "language": "%", + "options": [ + { + "id": "0og1s6ekirbe84jutgjr54ctdt", + "text": "Yes", + "language": "swelling in front of neck", + "display-or": "ହଁ", + "options": [ + { + "id": "ID_336426537", + "text": "Ask the patient to swallow with neck straight. Does the swelling move?", + "language": "%", + "display-or": "ଗଲା ଉପରକୁ ଉଠାଇ ଗିଳିବା ପାଇଁ କୋହ. ଫୁଲା ଗତି କରୁଛି କି?", + "options": [ + { + "id": "ID_1317721761", + "text": "Moves", + "language": "Swelling moves with swallowing", + "display-or": "ଗତି କରୁଛି" + }, + { + "id": "ID_1229096889", + "text": "Does not move", + "language": "Swelling does not move with swallowing", + "display-or": "ଗତି କରୁ ନାହିଁ" + } + ] + } + ] + }, + { + "id": "58sqse0lbig862ucj8b2fho5l1", + "text": "No", + "language": "no swelling in front of neck", + "display-or": "ନାଁ" + } + ] + } + ] + } + ] + }, + { + "id": "136efe9j0u2qed5vmqflgih15k", + "text": "Breast", + "language": "Breast:", + "display-or": "ସ୍ତନ", + "options": [ + { + "id": "ID_1049121031", + "text": "Examination instructions", + "language": "%", + "display-or": "ପରୀକ୍ଷା", + "options": [ + { + "id": "ID_244722854", + "text": "The following examination is only to be performed by a FEMALE health worker and only if the patient is comfortable.", + "language": "%", + "display-or": "ମହିଳା କର୍ମୀଙ୍କ ଦ୍ୱାରା ପରୀକ୍ଷା" + } + ] + }, + { + "id": "5u0bj8eju18p6rkq37kjhrjtkl", + "text": "Lumps", + "display-or": "ସ୍ତନ ପରୀକ୍ଷା", + "language": "%", + "options": [ + { + "id": "00te1cpnds5pivja14k0u168r2", + "text": "Perform breast exam to look for lumps", + "language": "%", + "display-or": "ସ୍ତନରେ କିଛି ଫୁଲିଛି କି?", + "options": [ + { + "id": "59qdj23qcl1rhv0blnj7blth4e", + "text": "Possible lumps detected in breast exam", + "display-or": "ଫୁଲା ଅଛି" + }, + { + "id": "ID_1757348571", + "text": "No lumps detected in breast exam", + "display-or": "ନାହିଁଁ" + } + ] + } + ] + }, + { + "id": "2pkvamf5g9p9b37elcll8bb75e", + "text": "Scars", + "display-or": "ଘା, ଚିହ୍ନ", + "language": "%", + "options": [ + { + "id": "3cbr9frtkdep6m0kj3v2ed85ot", + "text": "Any scar on the breast?", + "language": "%", + "display-or": "ସ୍ତନରେ କିଛି ଘା ଚିହ୍ନ ଅଛି କି?", + "options": [ + { + "id": "2cmrhupbq2u0idjjl53386lbi9", + "text": "Yes", + "language": "scarring seen", + "display-or": "ହଁ" + }, + { + "id": "27n2ugg2ji5p7jbb1sr3i6iqcb", + "text": "No", + "language": "no scarring seen", + "display-or": "ନାଁ" + } + ] + } + ] + }, + { + "id": "5rbakfs6u9q4vdqkc3eq1gvrr2", + "text": "Ulcer", + "display-or": "ଘା", + "language": "%", + "options": [ + { + "id": "6kgena4h22ag7inhj44fj70hdk", + "text": "Any ulcer on the breast?", + "language": "%", + "display-or": "ସ୍ତନରେ ଘା ହେଉଛି କି?", + "options": [ + { + "id": "70s23tdhr8qcrudm1mv9uqevjk", + "text": "Yes", + "language": "ulcer seen", + "display-or": "ହଁ" + }, + { + "id": "56rds41aluohab9440cdgj4ir7", + "text": "No", + "language": "no ulcer seen", + "display-or": "ନାଁ" + } + ] + } + ] + }, + { + "id": "3munln03g404amqheuqnrvpj9v", + "text": "Skin colour", + "display-or": "ଚର୍ମର ରଙ୍ଗ", + "language": "%", + "options": [ + { + "id": "3p9un6lapk9nu0ggq5833pef5l", + "text": "Is the colour of the entire skin normal?", + "language": "%", + "display-or": "ଚମଡ଼ାର ରଂଗ ସାଧାରଣ ଅଛି କି?", + "options": [ + { + "id": "1i5uleucmsbla5hqe8c1b1kcjq", + "text": "Normal", + "language": "skin colour appears normal", + "display-or": "ହେଉଛି" + }, + { + "id": "0a39jvob5jl0nm4cgdqouimsrp", + "text": "Discoloured", + "language": "skin appears discoloured", + "display-or": "ହେଉନି" + } + ] + } + ] + }, + { + "id": "3vun4a13c8hufvmiocqvkp86s9", + "text": "Nipple", + "display-or": "ନିପୁଲ୍", + "language": "%", + "options": [ + { + "id": "51nu6ldj5r0d24qm5ejehp7nlc", + "text": "Is the nipple normal?", + "language": "%", + "display-or": "ନିପୁଲ ସାଧାରଣ ଅଛି କି?", + "options": [ + { + "id": "119qm4q8gsrgo5708d903gbl2f", + "text": "Normal", + "language": "nipple is normal", + "display-or": "ସାଧାରଣ" + }, + { + "id": "2liv77l49rc9eak1o6pjvekidl", + "text": "Cracked", + "language": "nipple is cracked", + "display-or": "ନିପୁଲ ଫାଟିଛି" + }, + { + "id": "27g0v4om5vepgqgtt4q2n30v73", + "text": "Inverted", + "language": "nipple is inverted", + "display-or": "ଭିତରକୁ ପଶି ଯାଇଛି" + } + ] + } + ] + }, + { + "id": "ID_1300484864", + "text": "Discharge", + "display-or": "ଝରିବା", + "options": [ + { + "id": "ID_995366833", + "text": "Is there any discharge?", + "language": "%", + "display-or": "କିଛି ଝରୁଛି କି ?", + "options": [ + { + "id": "ID_1252412077", + "text": "No discharge", + "display-or": "ଶ୍ରାବ ନାହଁ" + }, + { + "id": "ID_969059384", + "text": "Pus", + "display-or": "ପୁଜ" + }, + { + "id": "ID_495334060", + "text": "Blood", + "display-or": "ରକ୍ତ" + }, + { + "id": "ID_1646767141", + "text": "Mixed blood and pus", + "display-or": "ମିଶା" + }, + { + "id": "ID_1846089709", + "text": "Thin discharge", + "display-or": "ପାଣି" + }, + { + "id": "ID_1718786231", + "text": "Dry", + "display-or": "ଶୁଖିଲା" + } + ] + } + ] + } + ] + }, + { + "id": "2t2vdn6piv6ohlmdi7bvbf5rk5", + "text": "Abdomen", + "language": "Abdomen:", + "display-or": "ପେଟ", + "options": [ + { + "id": "1s1a0gi6oo6fqeqq35nu3vfv6p", + "text": "Scars", + "display-or": "ଘା, ଚିହ୍ନ", + "language": "%", + "options": [ + { + "id": "0m63c82jb2ouqchb71cjc19c96", + "text": "Are there visible scars?", + "language": "%", + "display-or": "ଘା ଚିହ୍ନ ଦେଖାଯାଉଛି କି?", + "options": [ + { + "id": "51jlqttpefo5bvt47itt4gle4h", + "text": "Yes", + "language": "scarring seen", + "display-or": "ହଁ", + "options": [ + { + "id": "1li24o0i5q99c9lrvlc5oelegk", + "text": "Where is it?", + "job-aid-type": "image", + "job-aid-file": "abdominalregions9", + "language": "location of the scar -", + "display-or": "କେଉଁଠି ହେଉଛି", + "options": [ + { + "id": "5nph6mlpkgt8okr829nk64utg6", + "text": "Upper(R)", + "language": "Upper(R)", + "display-or": "ଡାହାଣ ଉପରକୁ" + }, + { + "id": "5e2rlrnskocg50nmqv93di0vqo", + "text": "Middle(L)", + "language": "Middle(L)", + "display-or": "ବାମ ମଝି" + }, + { + "id": "6dleo64ml0na3p5sbgi675jt5l", + "text": "Middle(C)", + "language": "Middle(C)", + "display-or": "ନାଭି ଚାରିକଡ଼େ" + }, + { + "id": "03e7qiiv4m2i5l78v10il5lqnc", + "text": "Middle(R)", + "language": "Middle(R)", + "display-or": "ଡ଼ାହାଣ ମଝି" + }, + { + "id": "32ragocnprafru5c6pb0sqr0a4", + "text": "Lower(L)", + "language": "Lower(L)", + "display-or": "ବାମ ତଳ" + }, + { + "id": "7e6feg5tspmoqem0lfreksutd6", + "text": "Lower(C)", + "language": "Lower(C)", + "display-or": "ନାଭି ତଳକୁ" + }, + { + "id": "5n4c3c79j2vdamdj37hbq7qc5v", + "text": "Lower(R)", + "language": "Lower(R)", + "display-or": "ଡାହାଣ ତଳ" + }, + { + "id": "ID_990408086", + "text": "Upper (C) - Epigastric", + "display-or": "ନାଭି ଉପରକୁ", + "language": "Upper(C)" + }, + { + "id": "ID_207392971", + "text": "Upper (L) - Left Hypochondrium", + "display-or": "ବାମ ଉପରକୁ", + "language": "Upper (L)" + }, + { + "id": "19n7k3i1naihf0i700ss0tg1j9", + "text": "All Over", + "language": "All Over", + "display-or": "ଚାରିଅାଡ଼େ" + } + ] + } + ] + }, + { + "id": "2479hlr44iinotc9ib0qulp6tg", + "text": "No", + "language": "no scarring", + "display-or": "ନାଁ" + }, + { + "id": "ID_3192771", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "ଫଟ ନିଅ" + } + ] + } + ] + }, + { + "id": "2vkfpsqlkinig2gdr6i2fnmasl", + "text": "Distension", + "display-or": "ଫୁଲେଇବା", + "language": "%", + "options": [ + { + "id": "1mi79jc0g9egsuuti7ftf7bjs1", + "text": "Is there abdominal bloating?", + "language": "%", + "display-or": "ପେଟ ଫମ୍ପେଇଛି କି?", + "options": [ + { + "id": "0cstdbsl4iu6mroj46l3jsmpa2", + "text": "Yes", + "language": "distension seen", + "display-or": "ହଁ" + }, + { + "id": "13evgg6ga91gderevdpl7p0jb3", + "text": "No", + "language": "no distension", + "display-or": "ନାଁ" + }, + { + "id": "ID_698130164", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "ଫଟ ନିଅ" + } + ] + } + ] + }, + { + "id": "6vo75prj7lpj69v0rah9ptprj5", + "text": "Tenderness", + "display-or": "ଦରଜ ହେବା", + "language": "%", + "options": [ + { + "id": "3fa3uu2tg8s5iebcnuqsegn77t", + "text": "Is there abdominal tenderness?", + "job-aid-type": "image", + "job-aid-file": "abdominalregions9", + "language": "%", + "display-or": "ପେଟଳୁ ଚିପିକି ଦେଖ", + "options": [ + { + "id": "ID_1047975607", + "text": "Yes", + "language": "tenderness seen", + "display-or": "ହଁ", + "options": [ + { + "id": "ID_766474265", + "text": "Select the location where there is tenderness", + "language": "location", + "display-or": "କେଉଁ ଜାଗାରେ", + "options": [ + { + "id": "3tlg21c2326gbu1rm4qk53fpit", + "text": "Upper(L)", + "language": "Upper(L)", + "display-or": "ବାମ ଉପରକୁ" + }, + { + "id": "3an1q5ef0qcrsvipj34tk11291", + "text": "Upper(C)", + "language": "Upper(C)", + "display-or": "ନାଭି ଉପରକୁ" + }, + { + "id": "2vr8qoh5uj8i7r6e5ukuinufr8", + "text": "Upper(R)", + "language": "Upper(R)", + "display-or": "ଡାହାଣ ଉପରକୁ" + }, + { + "id": "0lnop7ueoaiua22vlik3e45nfe", + "text": "Middle(L)", + "language": "Middle(L)", + "display-or": "ବାମ ମଝି" + }, + { + "id": "58b89krpqba3tluclbsqv6nun4", + "text": "Middle(C)", + "language": "Middle(C)", + "display-or": "ନାଭି ଚାରିକଡ଼େ" + }, + { + "id": "5e7cptqtqdgpoc5snvues5lk79", + "text": "Middle(R)", + "language": "Middle(R)", + "display-or": "ଡ଼ାହାଣ ମଝି" + }, + { + "id": "4aou5edcakccp507v28hasgi5u", + "text": "Lower(L)", + "language": "Lower(L)", + "display-or": "ବାମ ତଳ" + }, + { + "id": "022ur9sfnq5q2743gnu7g81ae5", + "text": "Lower(C)", + "language": "Lower(C)", + "display-or": "ନାଭି ତଳକୁ" + }, + { + "id": "0f6bcg1tc7ibbughrlh56rdje7", + "text": "Lower(R)", + "language": "Lower(R)", + "display-or": "ଡାହାଣ ତଳ" + }, + { + "id": "7kon53anrnpqsfpug5qhc0p21b", + "text": "All Over", + "language": "All Over", + "display-or": "ଚାରିଅାଡ଼େ" + } + ] + } + ] + }, + { + "id": "221ndbofeiel4kuld16pj90rq0", + "text": "No tenderness", + "language": "no tenderness", + "display-or": "ନାଁ" + } + ] + } + ] + }, + { + "id": "6qqkebtga4qqa32to7pcgv5fvl", + "text": "Lumps", + "display-or": "ଫୁଲା", + "options": [ + { + "id": "3v5o8q9h4lkbo5fqqac685jj6d", + "text": "Are there lumps?", + "language": "%", + "display-or": "ପେଟରେ କିଛି ଫୁଲା ଦେଖାଯାଉଛି", + "options": [ + { + "id": "1giutjar0lk0cf2kshdr5jgeoa", + "text": "Yes", + "language": "lumps seen", + "display-or": "ହଁ", + "options": [ + { + "id": "4r5l9qt33bn19so3bs3c4uiith", + "text": "Where is it?", + "job-aid-type": "image", + "job-aid-file": "abdominalregions9", + "language": "location", + "display-or": "କେଉଁଠି ହେଉଛି", + "options": [ + { + "id": "24cg8m2o428u0fjekqcs0lnth8", + "text": "Upper(C)", + "language": "Upper(C)", + "display-or": "ନାଭି ଉପରକୁ" + }, + { + "id": "4f58923orn503u76vbsr91h8r4", + "text": "Upper(R)", + "language": "Upper(R)", + "display-or": "ଡାହାଣ ଉପରକୁ" + }, + { + "id": "58ur1g23ab7c38cq2c2a65m885", + "text": "Middle(L)", + "language": "Middle(L)", + "display-or": "ବାମ ମଝି" + }, + { + "id": "2osvevb8k2kkc5a51sggg8ukmj", + "text": "Middle(C)", + "language": "Middle(C)", + "display-or": "ନାଭି ଚାରିକଡ଼େ" + }, + { + "id": "0pptnpanb7l67facgo4fa613qa", + "text": "Middle(R)", + "language": "Middle(R)", + "display-or": "ଡ଼ାହାଣ ମଝି" + }, + { + "id": "7a6l9madq3r3jj8009j0ilkf1n", + "text": "Lower(L)", + "language": "Lower(L)", + "display-or": "ବାମ ତଳ" + }, + { + "id": "314j563q6gi88jisshinkcaknv", + "text": "Lower(C)", + "language": "Lower(C)", + "display-or": "ନାଭି ତଳକୁ" + }, + { + "id": "061jbl7bcvkauvrk1geuok7c2u", + "text": "Lower(R)", + "language": "Lower(R)", + "display-or": "ଡାହାଣ ତଳ" + }, + { + "id": "6tc2t1aj3f3t8fisb6t1sqqga1", + "text": "All Over", + "language": "All Over", + "display-or": "ଚାରିଅାଡ଼େ" + } + ] + }, + { + "id": "527hras4h7oie28sm42d1gs4nf", + "text": "How many?", + "language": "%", + "display-or": "କେତେଟା ଅଛି", + "options": [ + { + "id": "7vg06ntaaksg4h0al3lhet48ce", + "text": "Enter number of lumps", + "input-type": "number", + "language": "No. of lumps", + "display-or": "ସଂଖ୍ଯା" + } + ] + }, + { + "id": "7n2ig7ajg32k1innt1b61c6fv8", + "text": "What is its shape?", + "language": "%", + "display-or": "କେମିତି ଦେଖାଯାଉଛି", + "options": [ + { + "id": "4hl0jv0g5sk7uo7p0b02boe73p", + "text": "Round", + "language": "round in shape", + "display-or": "ଗୋଲାକାର" + }, + { + "id": "5bg1db5hethbbfs5k51k2vrdgs", + "text": "Irregular", + "language": "irregular in shape", + "display-or": "ଅନିୟମିତ" + } + ] + }, + { + "id": "0cggktq1vrlvbal7o6gvt43tdf", + "text": "How is the surface?", + "language": "%", + "display-or": "ଉପର କେମିତି ଲାଗୁଛି", + "options": [ + { + "id": "2vjtjpeqncg47qsqqrssn8mtg5", + "text": "Smooth", + "language": "smooth surface", + "display-or": "ସମାନ" + }, + { + "id": "57g2vcu0cninftqki0fkh2huma", + "text": "Irregular", + "language": "irregular surface", + "display-or": "ଅଙ୍କାବଙ୍କା" + } + ] + }, + { + "id": "1ujal0nlol5pb9f37cen62d91n", + "text": "How does it feel?", + "language": "%", + "display-or": "ହାତକୁ କେମିତି", + "options": [ + { + "id": "344f4n28so8mk6v77943tc2o0f", + "text": "Hard", + "language": "feels hard", + "display-or": "ଟାଣ" + }, + { + "id": "3c7e65ukge3gt63pcavoqnr2vt", + "text": "Soft", + "language": "feels soft", + "display-or": "ନରମ" + }, + { + "id": "4ugdg490r6odffk2cd8bdgph48", + "text": "Medium", + "language": "feels medium", + "display-or": "ମଝି ମଝିଅା" + } + ] + }, + { + "id": "19d2d6vrbs9558bv5ub1i9uf1o", + "text": "Painful or not?", + "language": "%", + "display-or": "ଦରଜ ହେଉଛି କି ନା?", + "options": [ + { + "id": "1mjkj9nn7a678ju1oeffiehba3", + "text": "Yes", + "language": "tender", + "display-or": "ହଁ" + }, + { + "id": "31204sdffp724anvvo67cgdanu", + "text": "No", + "language": "not tender", + "display-or": "ନାଁ" + } + ] + }, + { + "id": "1nnme423cok1h5rdhfnkh7hlke", + "text": "Any change in colour of skin?", + "language": "%", + "display-or": "ଉପର ଚମଡ଼ାର ରଙ୍ଗ ପରିବର୍ତ୍ତନ ଦେଖା ଯାଉଛି କି?", + "options": [ + { + "id": "0j882oc11948g1ulqdhmtvgai6", + "text": "Yes", + "language": "discolouration of skin", + "display-or": "ହଁ" + }, + { + "id": "0oeemol3epsjche6h7i4i9dsa8", + "text": "No", + "language": "no skin discolouration", + "display-or": "ନାଁ" + } + ] + }, + { + "id": "3qnfa95mrm3ufktmqr4ktv32f0", + "text": "Any swelling above or below the lump?", + "language": "%", + "display-or": "ଉପରେ କିମ୍ବା ତଳେ କିଛି ଫୁଳା ଅଛି କି?", + "options": [ + { + "id": "393ghhvtvu48j1s94ah6m9623j", + "text": "Swelling Above", + "language": "swelling above lump", + "display-or": "ଉପରେ" + }, + { + "id": "607hl7jb8vogfo7e8kvi7aplsm", + "text": "Swelling Below", + "language": "swelling below lump", + "display-or": "ତଳେ" + }, + { + "id": "3edclgk96hu48kr26l2a544398", + "text": "No Swelling", + "language": "no swelling", + "display-or": "ନାହିଁଁ" + } + ] + }, + { + "id": "5saimdim8ao0gg5v00h3gnq1k6", + "text": "Is it moving related to adjacent tissues?", + "language": "%", + "display-or": "ଫୁଲା ଟା ଏପଟ ହେଉଛି ନା ସ୍ଥିର ହେଉଛି", + "options": [ + { + "id": "3cog1pco9kl43mmh6cmg69h9qe", + "text": "Lump mobile", + "language": "lump mobile", + "display-or": "ଫୁଲା ଗତି କରୁ ଛି" + }, + { + "id": "5f07fmnfhm94a2ukqrsm6gglah", + "text": "Lump fixed", + "language": "lump fixed", + "display-or": "ଫୁଲା ସ୍ଥିର ଅଛି" + } + ] + }, + { + "id": "6j0jn1rbniamo13jehauhd3ctn", + "text": "Put a hand on the swelling and ask the patient to cough. Can you see and feel if there is a change in size?", + "language": "%", + "display-or": "ହାଥରେ ଫୁଲା କୁ ଛୁକି କରି ରୋଗୀ କୁ କଷିବା ପାଇଁ କୋହ. ଫୁଲା ର ଆକାର ରେ କିଛି ପରିବର୍ତନ ଅନୁଭବ କରୁ ଛ କି?", + "options": [ + { + "id": "5van4tdr4qnkmfqeb4lkse7t47", + "text": "Does not change", + "language": "size of lump does not change with coughing", + "display-or": "ପରିବର୍ତନ ନାହିଁ" + }, + { + "id": "4ardlukeoecfq3vh1fqr8smu0n", + "text": "Increases with coughing", + "language": "size of lump increases with coughing", + "display-or": "କଷିଲା ବେଳ ବଡୁଛି" + } + ] + }, + { + "id": "1obk7oaaf549nbkbntbo6u02s9", + "text": "Now ask the patient to lie down. Is the swelling going down/reduces in size?", + "language": "%", + "display-or": "ରୋଗୀ କୁ ଶୁଆଇ ଦିଅ. ଫୁଲା ର ଆକାର ରେ କିଛି ପରିବର୍ତନ ଅନୁଭବ କରୁ ଛ କି?", + "options": [ + { + "id": "3llsvgi66eo0vpm56udb9ca05i", + "text": "does not change", + "language": "size of lump does not reduce with lying down", + "display-or": "ପରିବର୍ତନ ନାହିଁ" + }, + { + "id": "5j0molvlt1v1qmg59a13b4q2j7", + "text": "reduce with lying down", + "language": "size of lump reduces with lying down", + "display-or": "କାମୁଛି" + } + ] + } + ] + }, + { + "id": "4dm6afeg11b56vsl5e5q77d5mg", + "text": "No", + "language": "no lumps", + "display-or": "ନାଁ" + }, + { + "id": "ID_337376517", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "ଫଟ ନିଅ" + } + ] + } + ] + } + ] + }, + { + "id": "3pd5np20m5l29ffljkk9fganrb", + "text": "Hands", + "language": "Hands Power test:", + "display-or": "ହାତ", + "options": [ + { + "id": "7e6d81sn7amlih0a1b6ieikabv", + "text": "Nails cyanosis", + "display-or": "ନଖ ନୀଳ", + "options": [ + { + "id": "0opiknc208aavnjirjdvnlf3t5", + "text": "Does the nail beds appear bluish?", + "language": "%", + "display-or": "ନଖ ନୀଳ ପଡ଼ିଛି ? ଯଦି ଅଛି ଫଟ ନିଅ", + "options": [ + { + "id": "19fv146mt55pbqrdsii0pdbggg", + "text": "Normal", + "language": "nails normal", + "display-or": "ନୀଳ ପଡ଼ିଛି" + }, + { + "id": "1462enod5ftjc98u3303rfmc3p", + "text": "Bluish", + "language": "nails bluish", + "display-or": "ନୀଳ ରଂଗ" + }, + { + "id": "ID_558488511", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "ଫଟ ନିଅ" + } + ] + } + ] + }, + { + "id": "5knvilm6k3ib0v2iaa3jfdfpcd", + "text": "Power 1", + "display-or": "ତାକତ୍ 1", + "language": "Gripping two fingers tightly", + "options": [ + { + "id": "78pgivnbga1brc9g1dhdf2t5ro", + "text": "Ask the patient to hold your two fingers tightly; one side at a time and examine strength of grip", + "language": "%", + "display-or": "ନିଜର ଅାଙ୍ଗୁଠିକୁ ରୋଗୀର ହାତ ମୁଠାରେ ଦେଇ ଜୋରରେ ଟାଣି ଦେଖ", + "options": [ + { + "id": "70gntrpgdvodhvjk2o6qm0n9og", + "text": "Grip equal on both sides", + "language": "grip equal on both sides", + "display-or": "ଦୁଇପଟ ସମାନ" + }, + { + "id": "5f2v78f2dcqlkef27pdrd52lhg", + "text": "Grip weak on left side", + "language": "grip weak on left side", + "display-or": "ବାମପଟ ଦୁର୍ବଳ" + }, + { + "id": "1mttk3kafnmv33su45bdrq9chg", + "text": "Grip weak on right side", + "language": "grip weak on right side", + "display-or": "ଡ଼ାହାଣ ପଟେ ଦୁର୍ବଳ" + } + ] + } + ] + }, + { + "id": "ID_330495095", + "text": "Power 2", + "display-or": "ତାକତ୍ 2", + "language": "Holding a paper tightly between thumb and curled fingers", + "options": [ + { + "id": "ID_949719690", + "text": "Ask the patient to hold a paper tight between thumb and curled fingers. Is the patient able to hold the paper?", + "display-or": "ଦୁଇ ଆଙ୍ଗୁଠି କୁ ଟାଇଟ ରେ ପେପର ଧରିବା ପାଇଁ ପଚାର. ପେପର କା ଉଠାଇ ପାରୁ ଛି କି", + "language": "%", + "options": [ + { + "id": "ID_1538068182", + "text": "Grip equal on both sides", + "language": "grip equal on both sides", + "display-or": "ଦୁଇପଟ ସମାନ" + }, + { + "id": "ID_1238338500", + "text": "Grip weak on left side", + "language": "grip weak on left side", + "display-or": "ବାମପଟ ଦୁର୍ବଳ" + }, + { + "id": "ID_1624892803", + "text": "Grip weak on right side", + "language": "grip weak on right side", + "display-or": "ଡ଼ାହାଣ ପଟେ ଦୁର୍ବଳ" + } + ] + } + ] + }, + { + "id": "ID_1617808715", + "text": "Power 3", + "display-or": "ତାକତ୍ 3", + "language": "Ability to spread 4 fingers apart when they are held together", + "options": [ + { + "id": "ID_1745755999", + "text": "Hold the patient's 4 fingers and ask him/her to spread them. Is the patient able to spread them?", + "display-or": "ଚାରି ଆଙ୍ଗୁଠି କୁ ଟାଇଟ ରେ ଧରି ତାକୁ ବିସ୍ତାର କରିବା ପାଇଁ ପଚାର. ଯଦି ସ୍ସେ ବିସ୍ତାର କରି ପାରୁ ଛି କି?", + "language": "%", + "options": [ + { + "id": "ID_1921328165", + "text": "Strength equal on both sides", + "language": "grip equal on both sides", + "display-or": "ଦୁଇପଟ ସମାନ" + }, + { + "id": "ID_260856531", + "text": "Strength weak on left side", + "language": "grip weak on left side", + "display-or": "ବାମପଟ ଦୁର୍ବଳ" + }, + { + "id": "ID_642837135", + "text": "Strength weak on right side", + "language": "grip weak on right side", + "display-or": "ଡ଼ାହାଣ ପଟେ ଦୁର୍ବଳ" + } + ] + } + ] + } + ] + }, + { + "id": "2h25kbabblri8uukidmf29gcfc", + "text": "Leg", + "language": "Leg:", + "display-or": "ଗୋଡ଼", + "options": [ + { + "id": "65067vtfn058cbt8hnu6pmh6fb", + "text": "Movement", + "display-or": "ହଲଚଲ୍", + "language": "SLR leg function test", + "options": [ + { + "id": "3un4m5pcnn97p8mckim5il3qpe", + "text": "(SLR) Patient lies supine. Have them raise one leg at a time (straight at the knee) and look for pain at any point", + "language": "%", + "display-or": "ରୋଗୀକୁ ଉପର ମୁହାଁ ଶୁଅାଇ ଆଣ୍ଠୁ ସିଧା କରି ଗୋଡ଼ ଉଠାଇବାକୁ କୁହ", + "options": [ + { + "id": "3lem6cmmm9054so6j11b6qg4m7", + "text": "SLR normal", + "language": "SLR normal", + "display-or": "SLR ଠିକ ଅଛି" + }, + { + "id": "3nhnpmgv3t9r51o1trrteqoauv", + "text": "pain halfway on left side", + "language": "pain halfway on left side", + "display-or": "ଉପର କୁ ଅଧା ଉଠାଇଲେ ବାମ ଗୋଡ ରୁ ଦରଜ" + }, + { + "id": "7pcua6o29rks3mcbhvft2stted", + "text": "pain halfway on right side", + "language": "pain halfway on right side", + "display-or": "ଉପର କୁ ଅଧା ଉଠାଇଲେ ଡାହାଣ ଗୋଡ ରୁ ଦରଜ" + }, + { + "id": "63ceb4ocdfd55o7jimgcmnvejo", + "text": "pain halfway on both side", + "language": "pain halfway on both side", + "display-or": "ଉପର କୁ ଅଧା ଉଠାଇଲେ ଉଭୟ ଗୋଡ ରୁ ଦରଜ" + }, + { + "id": "31u9knlrh2i6i18osnbdgef5e9", + "text": "pain at the beginning on left side", + "language": "pain at the beginning on left side", + "display-or": "ବାମ ଗୋଡ ଉଠେଇବା ମାତ୍ରେ ଦରଜ" + }, + { + "id": "7jf9306h47h94mrtm05an9cqna", + "text": "pain at the beginning on right side", + "language": "pain at the beginning on right side", + "display-or": "ଡାହାଣ ଗୋଡ ଉଠେଇବା ମାତ୍ରେ ଦରଜ" + }, + { + "id": "212ohnhik1gq8d23cs7a9st1ek", + "text": "pain at the beginning on both side", + "language": "pain at the beginning on both side", + "display-or": "ଉଭୟ ଗୋଡ ଉଠେଇବା ମାତ୍ରେ ଦରଜ" + }, + { + "id": "0if1r44q1t85he192dpmcckeqc", + "text": "pain near complete point on left side", + "language": "pain near complete point on left side", + "display-or": "ବାମ ଗୋଡ ସିଧା ଉଠିବା ମାତ୍ରେ ଦରଜ" + }, + { + "id": "5tj7tq4o83e3ukrr1aabsqklc2", + "text": "pain near complete point on right side", + "language": "pain near complete point on right side", + "display-or": "ଡାହାଣ ଗୋଡ ସିଧା ଉଠିବା ମାତ୍ରେ ଦରଜ" + }, + { + "id": "00v9urb4v0g32t7frttq3ub816", + "text": "pain near complete point on left both sides", + "language": "pain near complete point on left both sides", + "display-or": "ଉଭୟ ଗୋଡ ସିଧା ଉଠିବା ମାତ୍ରେ ଦରଜ" + } + ] + } + ] + }, + { + "id": "2vj27i02o06g49o6lrgevvnbmg", + "text": "Strength", + "display-or": "ତାକତ୍", + "options": [ + { + "id": "2plsq2r8tbuuh82a8tlmj0hipl", + "text": "Ask patient to raise one leg at a time against your hand", + "language": "%", + "display-or": "ଗୋଡ଼ ଉପରେ ପ୍ରେସର୍ ଦେଇ ଗୋଡ଼ ଉଠାଇବାକୁ କୁହଁ", + "options": [ + { + "id": "0ggq4g3veqb0fmi1q65j7m12i1", + "text": "Both legs equal", + "language": "both legs have equal strength", + "display-or": "ଦୁଇପଟ ସମାନ" + }, + { + "id": "7gfs3rj0jrg4vb6toj75u9rbcs", + "text": "Right leg weak", + "language": "weakness in Rt leg side", + "display-or": "ବାମପଟ ଦୁର୍ବଳ" + }, + { + "id": "06uq9bpr5fvpqbopems3sp3ojd", + "text": "Left leg weak", + "language": "weakness in Lt leg side", + "display-or": "ଡ଼ାହାଣ ପଟେ ଦୁର୍ବଳ" + } + ] + } + ] + } + ] + }, + { + "id": "4t5irnpds12ae3dtqls039q91m", + "text": "Back", + "language": "Back:", + "display-or": "ପିଠି", + "options": [ + { + "id": "5o7bitv8bit3bih36n2u5jhbqo", + "text": "Swelling", + "display-or": "ଫୁଲା", + "language": "%", + "options": [ + { + "id": "2spae93dsou9800p22plm30mms", + "text": "Is there any swelling?", + "language": "%", + "display-or": "ପିଠିରେ କିଛି ଫୁଲିଛି କି?", + "options": [ + { + "id": "7teqb3u97mgvvp223pba22qlre", + "text": "Yes", + "language": "swelling seen", + "display-or": "ହଁ" + }, + { + "id": "0835k7lrrmrvdou1b0ra9v5d75", + "text": "No", + "language": "no swelling seen", + "display-or": "ନାଁ" + }, + { + "id": "ID_1031740959", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "ଫଟ ନିଅ" + } + ] + } + ] + }, + { + "id": "1oclpd2g1ir8boipefejto1tos", + "text": "Redness", + "display-or": "ନାଲି ପଡ଼ିବା", + "language": "%", + "options": [ + { + "id": "7bi6ere3gb37b6mau3485lcj4i", + "text": "Is there any redness on the skin?", + "language": "%", + "display-or": "କିଛି ନାଲି ପଡ଼ିଛିକି?", + "options": [ + { + "id": "14d7lj25s1r4ss420u0mvk7idp", + "text": "Yes", + "language": "redness seen", + "display-or": "ହଁ" + }, + { + "id": "3b2v2j6trqn0473j674tn0070a", + "text": "No", + "language": "no redness seen", + "display-or": "ନାଁ" + }, + { + "id": "ID_615116267", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "ଫଟ ନିଅ" + } + ] + } + ] + }, + { + "id": "7i1v4uc60th626f4qm60nd9p4j", + "text": "Deformity", + "display-or": "ଅଙ୍କା ବଙ୍କା", + "language": "%", + "options": [ + { + "id": "2s5k8bl1f5usse06ngpufo41im", + "text": "Is the spine deformed?", + "language": "%", + "display-or": "କିଛି ଅଙ୍କାବଙ୍କା ଜଚ୍ଚାପଡ଼ୁଛି ?", + "options": [ + { + "id": "3rodnkiabsbp1givc4n0tucjcb", + "text": "Yes", + "language": "spine appears deformed", + "input-type": "camera", + "display-or": "ହଁ" + }, + { + "id": "4ccsi3a0v2spul2r4gbke9cbps", + "text": "No", + "language": "no visible spinal deformity", + "display-or": "ନାଁ" + }, + { + "id": "ID_800416816", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "ଫଟ ନିଅ" + } + ] + } + ] + }, + { + "id": "7dg7b81tn9rjsk21k5ujvb0rit", + "text": "Tenderness", + "display-or": "ଦରଜ ହେବା", + "language": "%", + "options": [ + { + "id": "2ion6tdgfsahqk1jiga40eq92c", + "text": "Feel the back at midline and along the sides of midline and look for tenderness", + "language": "%", + "display-or": "ପିଠିରେ ଚିପିଲେ ଦରଜ ଜଚ୍ଚାପଡ଼ୁଛି", + "options": [ + { + "id": "64s1qn0ouep97u2gurbn34eocl", + "text": "Yes", + "language": "tenderness observed", + "display-or": "ହଁ" + }, + { + "id": "6952m0cbt6send8qhid17svbq7", + "text": "No", + "language": "no back tenderness", + "display-or": "ନାଁ" + } + ] + } + ] + }, + { + "id": "ID_73016408", + "text": "Movement", + "display-or": "ଗତି କଲେ", + "language": "%", + "options": [ + { + "id": "ID_566200292", + "text": "Can the patient bend forward from his waist?", + "language": "%", + "display-or": "ରୋଗୀ ତାର ଅଂଟା କୁ ବାଙ୍କା କରି ପାରିବ କି", + "options": [ + { + "id": "ID_360140513", + "text": "Yes", + "language": "Patient can bend forward properly from the waist", + "display-or": "ହଁ" + }, + { + "id": "ID_1367247304", + "text": "No", + "language": "Patient cannot bend forward properly from the waist", + "display-or": "ନାଁ" + } + ] + } + ] + } + ] + }, + { + "id": "ID_119118100", + "text": "Joint", + "language": "Joint:", + "display-or": "ଗଣ୍ଠି", + "options": [ + { + "id": "4o2igq05u9989rp4lvlsatj2cp", + "text": "Examination instructions", + "language": "%", + "display-or": "ପରୀକ୍ଷା", + "options": [ + { + "id": "15fqgqi5n6m8q6kencbks5ocgi", + "text": "For the following joint examinations; please always compare with other side", + "language": "%", + "display-or": "ଗଣ୍ଠି ଯଦି ଫୁଲିଛି ? ଯଦି ଅଛି ଫଟ ନିଅ (ଅାରପଟ ଗଣ୍ଠି ସହ ତୁଳନା କରି ଦେଖ)" + } + ] + }, + { + "id": "4llikp278a8ojdd7tedjf7ucj4", + "text": "Swelling", + "language": "%", + "display-or": "ଗଣ୍ଠି ଫୁଲା", + "options": [ + { + "id": "78er12e1u2keqfouj43ha838p0", + "text": "Is the joint swollen?", + "language": "%", + "display-or": "ଗଣ୍ଠି ଫୁଲିଛି କି?", + "options": [ + { + "id": "4unn3ia170uqjk0rpgv06vafjc", + "text": "Yes", + "language": "joint is swollen", + "display-or": "ନାଁ" + }, + { + "id": "13j1m203lv1l6nq20dbbgiubeu", + "text": "No", + "language": "joint is not swollen", + "display-or": "ନାଁ" + }, + { + "id": "ID_875541771", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "ଫଟ ନିଅ" + } + ] + } + ] + }, + { + "id": "72e4qbkllccgpnso2d1l0a211k", + "text": "Redness", + "language": "%", + "display-or": "ଗଣ୍ଠି ନାଲିପଡ଼ିବା", + "options": [ + { + "id": "4cqi6go4pht94kflcif8aq1ssa", + "text": "Is there any redness on the skin over the joint?", + "language": "%", + "display-or": "ଗଣ୍ଠି ଉପରେ ନାଲି ପଡ଼ିଛି?", + "options": [ + { + "id": "7hue873fuuf5hq62t01pn88dfr", + "text": "Yes", + "language": "redness observed around joint", + "display-or": "ହଁ" + }, + { + "id": "4c1qo42psti5nt2ehskod5i791", + "text": "No", + "language": "no redness around joint", + "display-or": "ନାଁ" + }, + { + "id": "ID_1845537441", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "ଫଟ ନିଅ" + } + ] + } + ] + }, + { + "id": "7j4hr4dsf7t3te9hpam91p8r36", + "text": "Deformity", + "language": "%", + "display-or": "ଗଣ୍ଠି ଅଙ୍କାବଙ୍କା", + "options": [ + { + "id": "6tjhkp7eme15m62clh18ig00id", + "text": "Does the joint appear deformed?", + "language": "%", + "display-or": "ଗଣ୍ଠି ଅଙ୍କାବଙ୍କା ହେଉଛିକି?", + "options": [ + { + "id": "1b7hu0rerlq4jq1ph7552nkvod", + "text": "Yes", + "language": "deformity around joint", + "display-or": "ହଁ" + }, + { + "id": "0o29b1v4bs20d9n4l4g2n5ffd6", + "text": "No", + "language": "no deformity around joint", + "display-or": "ନାଁ" + }, + { + "id": "ID_132172140", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "ଫଟ ନିଅ" + } + ] + } + ] + }, + { + "id": "32s41m6u1rqq5g1872ol22ct3i", + "text": "Tenderness", + "language": "%", + "display-or": "ଗଣ୍ଠି ଦରଜ", + "options": [ + { + "id": "3fthifbu0va74st1hf7uhof7lk", + "text": "Feel the joint on all sides and look for tenderness", + "language": "%", + "display-or": "ଗଣ୍ଠି କୁ ଚିପିଲେ ଦରଜ ଜଚ୍ଚାପଡ଼ୁଛି", + "options": [ + { + "id": "7frcokaaec3b45o3c0pog2nkrv", + "text": "Yes", + "language": "tenderness seen", + "display-or": "ହଁ" + }, + { + "id": "0vcqd99cmo9f57cbu8u20j2ee8", + "text": "No", + "language": "non-tender", + "display-or": "ନାଁ" + }, + { + "id": "ID_880026668", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "ଫଟ ନିଅ" + } + ] + } + ] + }, + { + "id": "7vkb9bulgdnmhc7pktl8dg45p0", + "text": "Movement Pain", + "language": "%", + "display-or": "ହଲଚଲ ରେ ଗଣ୍ଠି କଷ୍ଟ", + "options": [ + { + "id": "5dinhlria692hqhmee61588t5v", + "text": "Move the joint through its normal range and are there pain at any point?", + "language": "%", + "display-or": "ଗଣ୍ଠି କ ହଲଚଲ୍ କଲେ କଷ୍ଟ ହେଉଛି କି?", + "options": [ + { + "id": "3gdb15d522q6sdfdbtlnbr97gu", + "text": "Yes", + "language": "pain during movement", + "display-or": "ହଁ" + }, + { + "id": "22cg7t8tqrtnu8kn9o1oi9i67i", + "text": "No", + "language": "no pain during movement", + "display-or": "ନାଁ" + }, + { + "id": "ID_1515587880", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "ଫଟ ନିଅ" + } + ] + } + ] + }, + { + "id": "1bh00k3631s2i8sigv2e0eakvt", + "text": "Movement range", + "language": "%", + "display-or": "ଗଣ୍ଠିକେତେଦୂର ଗତିଶୀଳ", + "options": [ + { + "id": "1i3lu7rrv9b0uho2o96v964tm6", + "text": "Is full range of movement present?", + "language": "%", + "display-or": "ଗଣ୍ଠି ହଲେଇଲେ କେତେବାଟ ହଲୁଛି", + "options": [ + { + "id": "6nubtkl0t9i8cua837uu1f6nuk", + "text": "Yes", + "language": "full range of movement is seen", + "display-or": "ହଁ" + }, + { + "id": "5gkkmjag787qnjoq8s0mp8csrv", + "text": "No", + "language": "range of movement is restricted", + "display-or": "ନାଁ" + }, + { + "id": "ID_1859080464", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "ଫଟ ନିଅ" + } + ] + } + ] + } + ] + }, + { + "id": "6o3orbls1q04f07cv7nf8sfcps", + "text": "Any Location", + "language": "Any location:", + "display-or": "ଅନ୍ୟାନ୍ୟ ଜାଗା", + "options": [ + { + "id": "34vqigq1rri15t22qoe2btkume", + "text": "Skin Rash", + "language": "Skin Rash:", + "display-or": "ଚମର୍ର୍ର ଚିହ୍ନ", + "options": [ + { + "id": "2bla4uvbpp2fv6ojnfenjodqul", + "text": "Is there any rash?", + "language": "%", + "display-or": "ଚର୍ମରେ କିଛି ଚିହ୍ନ ଅଛି କି?", + "options": [ + { + "id": "589u54qk7l2u9hed63drg8akgk", + "text": "Yes", + "language": "rash seen", + "display-or": "ହଁ", + "options": [ + { + "id": "4pap5bnnkpfphml5lffvghpi1c", + "text": "How many rashes are there?", + "language": "%", + "display-or": "କେତେ ସଂଖ୍ଯା", + "options": [ + { + "id": "0lv2li905er00qodi01rs6oigu", + "text": "Enter number", + "input-type": "number", + "language": "No. of rashes", + "display-or": "ସଂଖ୍ୟା ଲେଖ" + } + ] + }, + { + "id": "7q5r86eu50k1d369k63i6plh4t", + "text": "How is the surface of the rash?", + "language": "%", + "display-or": "ଉପର କେମିତି ଅଛି", + "options": [ + { + "id": "2ts8gtpb4h158fce5g78o59mm1", + "text": "Smooth", + "language": "surface is smooth", + "display-or": "ସମାନ" + }, + { + "id": "2iarl1gqhk08f3qpulihr1l4j5", + "text": "Rough", + "language": "surface is irregular", + "display-or": "ଅଙ୍କାବଙ୍କା" + } + ] + }, + { + "id": "1lpin3jjkc2u0tuqom8spshbqd", + "text": "What is the colour of the rash?", + "language": "%", + "display-or": "ରଙ୍ଗ କେମିତି", + "options": [ + { + "id": "4ctvh2ga00p2qm33koijd1f18u", + "text": "Describe", + "input-type": "text", + "language": "Colour of the rash", + "display-or": "ବର୍ଣନା କର" + } + ] + }, + { + "id": "ID_907152865", + "text": "Is the rash on the palms and soles?", + "language": "%", + "display-or": "ପାଦ ଓ ପାପୁଲି", + "options": [ + { + "id": "ID_1524644195", + "text": "Yes", + "language": "rash present on palms and soles", + "display-or": "ହଁ" + }, + { + "id": "ID_1041474623", + "text": "No", + "language": "rash not present on palms and soles", + "display-or": "ନାଁ" + } + ] + }, + { + "id": "ID_1174246731", + "text": "Is there dry, dead skin that appears to be falling off?", + "language": "%", + "display-or": "ଚିହ୍ନ", + "options": [ + { + "id": "ID_599631097", + "text": "Yes", + "language": "skin appears to be dead, dry or peeling off (eschar seen)", + "display-or": "ହଁ" + }, + { + "id": "ID_128832798", + "text": "No", + "language": "no eschar", + "display-or": "ନାଁ" + } + ] + } + ] + }, + { + "id": "55d0k2iookm3bedg3vjkptmhco", + "text": "No", + "language": "no rash", + "display-or": "ନାଁ" + }, + { + "id": "ID_1918521940", + "text": "Put a ruler next to the rash and take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "ଚିହ୍ନ ଉପରେ ରୁଲୱେର ପକାଅ ତାର ଫୋଟୋ ନିଅ" + } + ] + } + ] + }, + { + "id": "ID_111711492", + "text": "Skin Bruise", + "language": "Skin Bruise:", + "display-or": "ଚର୍ମ ରେ ନୀଳ ଘା ଚିହ୍ନ", + "options": [ + { + "id": "ID_1536234608", + "text": "Are there bruises? If yes, take a picture", + "language": "%", + "display-or": "ସେହି ଜାଗା ରେ ଘା ଚିହ୍ନ ଅଛି କି? ତାର ଫଟ ନିଅ", + "options": [ + { + "id": "ID_1163933268", + "text": "Yes", + "language": "bruises seen", + "display-or": "ହଁ", + "options": [ + { + "id": "ID_255586404", + "text": "How many?", + "language": "%", + "display-or": "କେତେ ଥର", + "options": [ + { + "id": "ID_1158378356", + "text": "Enter number of bruises", + "input-type": "number", + "language": "No. of bruises", + "display-or": "କେତେ ଥର" + } + ] + } + ] + }, + { + "id": "ID_1336289065", + "text": "No", + "language": "no bruises seen", + "display-or": "ନାଁ" + }, + { + "id": "ID_983168251", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "ଫଟ ନିଅ" + } + ] + } + ] + }, + { + "id": "ID_1749120040", + "text": "Injury Discolouration", + "language": "Injury discolouration:", + "display-or": "ଅାଘାତର ରଙ୍ଗ", + "options": [ + { + "id": "27dbrb51lp0aa5a74bgupicelh", + "text": "Is there any discoloured area?", + "language": "%", + "display-or": "ରଙ୍ଗ ପରିବର୍ତ୍ତନ ହେଉଛି କି ?", + "options": [ + { + "id": "6r3lmbl4ua2bc4ik5lthrlt398", + "text": "Yes", + "language": "discolouration seen", + "display-or": "ହଁ" + }, + { + "id": "0hnmvcshh7c39gn40uv2ahvaaq", + "text": "No", + "language": "no discolouration seen", + "display-or": "ନାଁ" + }, + { + "id": "ID_860168656", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "ଫଟ ନିଅ" + } + ] + } + ] + }, + { + "id": "5ppf2cn408f2psn455srhlh77j", + "text": "Injury Cut", + "language": "Injury cut:", + "display-or": "ଆଘାତ ରେ କ୍ଷତ", + "options": [ + { + "id": "7jr2vgc8f4agke58mdj3uo85p1", + "text": "Is there any cut?", + "language": "%", + "display-or": "କ୍ଷତ ଚିହ୍ନ ଅଛି କି?", + "options": [ + { + "id": "69je855af2lbv9dh46a5ek9hid", + "text": "Yes", + "language": "skin cut seen", + "display-or": "ହଁ" + }, + { + "id": "1si0aalh00f7pi7trm5i71pjms", + "text": "No", + "language": "no skin cut", + "display-or": "ନାଁ" + }, + { + "id": "ID_1623868209", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "ଫଟ ନିଅ" + } + ] + } + ] + }, + { + "id": "39pfoj2pvmjl37j941bl78gm87", + "text": "Injury Abrasion", + "language": "Injury abrasion:", + "display-or": "ମଳିଚମ ଛାଡ଼ିବା", + "options": [ + { + "id": "1d3gb6ub23obtvhf1gkp7lukhv", + "text": "Is there any abrasion?", + "language": "%", + "display-or": "ମଳି ଚର୍ମ ଛାଡ଼ିଛି କି?", + "options": [ + { + "id": "27evgnahjmv73l5q867jb1vmi5", + "text": "Yes", + "language": "abrasion seen", + "display-or": "ହଁ" + }, + { + "id": "2nb52of6a4u3hpp6k4no5jqgph", + "text": "No", + "language": "no abrasion", + "display-or": "ନାଁ" + }, + { + "id": "ID_1829148837", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "ଫଟ ନିଅ" + } + ] + } + ] + }, + { + "id": "0li81lki3l7qgdob8n28djl6d1", + "text": "Ulcer", + "language": "Ulcer:", + "display-or": "ଘା", + "options": [ + { + "id": "0fv1oqmiciu8rrk03jvc0vf1s1", + "text": "Is there an ulcer?", + "language": "%", + "display-or": "ଘା ହେଇଛିକି ?", + "options": [ + { + "id": "02pvjpospai94ppnvucipe41ig", + "text": "Yes", + "language": "ulcer seen", + "display-or": "ହଁ", + "options": [ + { + "id": "53c44bred47fth5l5mka20nrhg", + "text": "Put a ruler next to the ulcer and estimate its size", + "language": "%", + "display-or": "ସ୍କେଲ ରେ ଘା ର ମାପ ନିଅ", + "options": [ + { + "id": "2v1m35qrajbajt80rtgrrt280l", + "text": "Enter size in cm x cm", + "input-type": "area", + "language": "size of ulcer", + "display-or": "ସାଇଜ଼ ଲେଖ (cm ରେ)" + } + ] + }, + { + "id": "02ph9ohp70g24tnl435ai208pg", + "text": "Is there any discharge?", + "language": "Discharge", + "display-or": "କିଛି ବାହରୁଚି କି ?", + "options": [ + { + "id": "ID_412588416", + "text": "No discharge", + "display-or": "ବାହାରୁ ନାହିଁ" + }, + { + "id": "22c8uusl7qkiuk8ljlga5pfm8v", + "text": "Pus", + "display-or": "ପୁଜ" + }, + { + "id": "5s9ke64t9oifo0uk0fk32ko9vi", + "text": "blood", + "display-or": "ରକ୍ତ" + }, + { + "id": "5p38tbvokndkamgmnt54lqrk0a", + "text": "mixed blood and pus", + "display-or": "ମିଶା" + }, + { + "id": "20duhp97dl8tf00ogrt7ns8f5v", + "text": "thin discharge", + "display-or": "ପାଣି" + } + ] + }, + { + "id": "73ucsmcmf6k499285r1sqbt362", + "text": "What is the colour of the surface?", + "language": "Colour of the surface is", + "display-or": "ରଙ୍ଗ ପରିବର୍ତ୍ତନ ହେଉଛି କି ?", + "options": [ + { + "id": "6jtmkaeaencqjpbrs3adl5o6ql", + "text": "Clean", + "display-or": "ସଫା" + }, + { + "id": "05bodpk8i80k9numdlm6qnl7cd", + "text": "Dirty", + "display-or": "ମେଇଲା" + }, + { + "id": "1sccnq9qeloi6ifuati0vh253k", + "text": "Pink", + "display-or": "ଗୋଲାପୀ" + }, + { + "id": "3qjvivl83sg5h6pt8bgvnlht7h", + "text": "Black", + "display-or": "କଲା" + }, + { + "id": "434uaf0v8qgp14jqeckdsgv6qd", + "text": "Green", + "display-or": "ସବୁଜ" + }, + { + "id": "3at4cf3j8kjfbotfirbc34sg2m", + "text": "Mixed", + "display-or": "ମିଶାମୂଶୀ" + } + ] + }, + { + "id": "3ka259e4gg3ta4hoqrdjkoapvf", + "text": "What is the edge like?", + "language": "Edge of the ulcer is", + "display-or": "କଡ଼ କିପରି ଦେଖାଯାଉଛି?", + "options": [ + { + "id": "38d2pm4eu9tcfd5vq4oc9qdvvb", + "text": "flat with ulcer surface", + "display-or": "ଘା ସହ ସମାନ" + }, + { + "id": "7fs6ejakafvelafld9dacaginu", + "text": "raised from ulcer", + "display-or": "ଘା ଠାରୁ ଉଠିକି ଅଛି" + } + ] + } + ] + }, + { + "id": "59nb92ovmpta94vja2iinh6svg", + "text": "No", + "language": "no ulcer", + "display-or": "ନାଁ" + }, + { + "id": "ID_189445601", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "ଫଟ ନିଅ" + } + ] + } + ] + }, + { + "id": "5mcqteh5srhqk4gt7g9ajf14n2", + "text": "Boils", + "language": "Boils:", + "display-or": "ବଥ", + "options": [ + { + "id": "5mvingjmvaltgiutbp7rkm15a1", + "text": "Are there boils?", + "language": "%", + "display-or": "ବଥ ହେଉଛି କି?", + "options": [ + { + "id": "5lqnh30vm6fj52g1811i90ffgo", + "text": "Yes", + "language": "boils seen", + "display-or": "ହଁ", + "options": [ + { + "id": "ID_81500472", + "text": "Put a ruler next to the ulcer and estimate its size", + "language": "%", + "display-or": "ସ୍କେଲ ରେ ଘା ର ମାପ ନିଅ", + "options": [ + { + "id": "ID_791818605", + "text": "Enter size in cm x cm", + "input-type": "area", + "language": "size of ulcer", + "display-or": "ସାଇଜ଼ ଲେଖ (cm ରେ)" + } + ] + }, + { + "id": "42355536t2q70svss969f2j08k", + "text": "Is there any discharge?", + "language": "%", + "display-or": "କିଛି ବାହାରୁଛି କି?", + "options": [ + { + "id": "ID_1069893571", + "text": "No discharge", + "display-or": "ବାହାରୁ ନାହିଁ" + }, + { + "id": "ID_1807366232", + "text": "Pus", + "display-or": "ପୁଜ" + }, + { + "id": "ID_840730493", + "text": "blood", + "display-or": "ରକ୍ତ" + }, + { + "id": "ID_1466984919", + "text": "mixed blood and pus", + "display-or": "ମିଶା" + }, + { + "id": "ID_1433039925", + "text": "thin discharge", + "display-or": "ପାଣି" + } + ] + }, + { + "id": "1ic1278mhtt40hsm7cevbj7v8f", + "text": "What is the colour of skin over the boil?", + "language": "%", + "display-or": "ବଥ ଉପର ରଙ୍ଗ", + "options": [ + { + "id": "0h4dektbegfs2effept78ist2g", + "text": "Red", + "language": "Skin over the boil looks red", + "display-or": "ନାଲି" + }, + { + "id": "5aceeph8rjeddkmcf94bvg0709", + "text": "Normal", + "language": "Skin over the boil looks normal", + "display-or": "ଠିକ୍ ଅଛି" + } + ] + }, + { + "id": "58e8cdlhlqpl0uh5j2e40gvt9s", + "text": "What is the edge like?", + "language": "edge is", + "display-or": "କଡ଼ କିପରି ଦେଖାଯାଉଛି", + "options": [ + { + "id": "5sqih9mnkjbp5s1q7u0aapb41l", + "text": "flat with boil surface", + "display-or": "ବଥ ସହ ସମାନ" + }, + { + "id": "16keptqbnb2fplft0v6a6s4gq8", + "text": "raised from boil", + "display-or": "ବଥ ଉପରେ" + } + ] + } + ] + }, + { + "id": "5ghsl8ilvbkk9v7qcbeq98tnqd", + "text": "No", + "language": "no boils", + "display-or": "ନାଁ" + }, + { + "id": "ID_656972133", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "ଫଟ ନିଅ" + } + ] + } + ] + }, + { + "id": "ID_1656343876", + "text": "Burn", + "language": "Burns:", + "display-or": "ପୋଡା", + "options": [ + { + "id": "ID_719160856", + "text": "Is there a burn? If yes, take a picture", + "language": "%", + "display-or": "ସେହି ଜାଗା ରେ ପୋଡା ଚିହ୍ନ ଅଛି କି? ତାର ଫଟ ନିଅ", + "options": [ + { + "id": "ID_1675617420", + "text": "Yes", + "language": "burn seen", + "display-or": "ହଁ", + "options": [ + { + "id": "ID_320536498", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "ଫଟ ନିଅ" + }, + { + "id": "ID_147415043", + "text": "Are there blisters?", + "language": "%", + "display-or": "ଛଲୀ ଅଛି କି?", + "options": [ + { + "id": "ID_1069331692", + "text": "Yes", + "language": "blisters present", + "display-or": "ହଁ" + }, + { + "id": "ID_555975713", + "text": "No", + "language": "no blisters present", + "display-or": "ନା" + } + ] + }, + { + "id": "ID_401443840", + "text": "What is the colour of the skin over the burn?", + "language": "%", + "display-or": "ପୁଡା ଜାଗା ରେ ଉପର ରଙ୍ଗ କେମିତି ଅଛି", + "options": [ + { + "id": "ID_409059360", + "text": "Red", + "language": "skin over the burn is red", + "display-or": "ଲାଲ" + }, + { + "id": "ID_1007685774", + "text": "White", + "language": "skin over the burn is white", + "display-or": "ଧଳା" + }, + { + "id": "ID_1929663883", + "text": "Black", + "language": "skin over the burn is black", + "display-or": "କଲା" + } + ] + }, + { + "id": "ID_36521679", + "text": "Does blanching of the skin occur when it is lightly pressed?", + "language": "%", + "display-or": "ଟିକେ ଦବେଇଲା ପରେ ଧଳା ରଙ୍ଗ ହୋଇଛି କି?", + "options": [ + { + "id": "ID_1025144299", + "text": "Yes", + "language": "blanching of skin occurs when it is lightly pressed", + "display-or": "ହଁ" + }, + { + "id": "ID_453851935", + "text": "No", + "language": "no blanching of the skin occurs when it is lightly pressed", + "display-or": "ନା" + } + ] + }, + { + "id": "ID_874737723", + "text": "Is there dry, dead skin that appears to be falling off over the burn sites?", + "language": "%", + "display-or": "ପୋଡା ଜାଗା ରେ ଶୁଖିଲା କିମ୍ବା ମୃତ ଚମଡା ଅଛି କି?", + "options": [ + { + "id": "ID_1512204949", + "text": "Yes", + "language": "eschar present over the burn sites", + "display-or": "ହଁ" + }, + { + "id": "ID_1920887878", + "text": "No", + "language": "no eschar present over the burn sites", + "display-or": "ନା" + } + ] + }, + { + "id": "ID_1624426837", + "text": "Where is the burn?", + "language": "location of burn", + "display-or": "ପୋଡା କେଉଁ ଠାରେ ଅଛି?", + "options": [ + { + "id": "ID_1112431131", + "text": "Head", + "display-or": "ମୁଣ୍ଡ" + }, + { + "id": "ID_638950915", + "text": "Neck", + "display-or": "ବେକ" + }, + { + "id": "ID_1095936223", + "text": "Chest", + "display-or": "ଛାତି" + }, + { + "id": "ID_93371746", + "text": "Abdomen", + "display-or": "ପେଟ" + }, + { + "id": "ID_555053547", + "text": "Back (upper)", + "display-or": "ଉପର ପଛରେ" + }, + { + "id": "ID_726155829", + "text": "Back (lower)", + "display-or": "ତଳ ପଛରେ" + }, + { + "id": "ID_1737522795", + "text": "Leg (Right)", + "display-or": "ଡାହାଣ ଗୋଡ" + }, + { + "id": "ID_577618069", + "text": "Leg (Left)", + "display-or": "ବାମ ଗୋଡ" + }, + { + "id": "ID_1133152393", + "text": "Arm (Right)", + "display-or": "ଡାହାଣ କାନ୍ଧ" + }, + { + "id": "ID_1016834319", + "text": "Arm (Left)", + "display-or": "ବାମ କାନ୍ଧ" + }, + { + "id": "ID_633927685", + "text": "Genitalia", + "display-or": "ଗୁପ୍ତାଙ୍ଗ ଜାଗା ରେ" + }, + { + "id": "ID_322832963", + "text": "Other [Describe]", + "input-type": "number", + "language": "%", + "display-or": "ଅନ୍ୟାନ୍ୟ (ବର୍ଣନା କର)" + } + ] + }, + { + "id": "ID_273636690", + "text": "Put a ruler next to the ulcer and estimate its size", + "language": "%", + "display-or": "ସ୍କେଲ ରେ ଘା ର ମାପ ନିଅ", + "options": [ + { + "id": "ID_1674767883", + "text": "Enter size in cm x cm", + "input-type": "area", + "language": "size of ulcer", + "display-or": "ସାଇଜ଼ ଲେଖ (cm ରେ)" + } + ] + } + ] + }, + { + "id": "ID_1201952505", + "text": "No", + "language": "no burn", + "display-or": "ନାଁ" + }, + { + "id": "ID_147726711", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "ଫଟ ନିଅ" + } + ] + } + ] + }, + { + "id": "ID_1745964304", + "text": "Lumps", + "language": "Lumps:", + "display-or": "ଫୁଲା", + "options": [ + { + "id": "ID_1847908741", + "text": "Are there lumps?", + "language": "%", + "display-or": "ଫୁଲା ଅଛକି ?", + "options": [ + { + "id": "ID_1157293613", + "text": "Yes", + "language": "lumps seen", + "display-or": "ହଁ", + "options": [ + { + "id": "ID_1058142720", + "text": "Where is it?", + "job-aid-type": "image", + "job-aid-file": "abdominalregions9", + "language": "Location", + "display-or": "କେଉଁ ଜାଗା ରେ", + "options": [ + { + "id": "ID_1935801557", + "text": "Upper (R) - Right Hypochondrium", + "display-or": "ଡାହାଣ ଉପରକୁ" + }, + { + "id": "ID_845387253", + "text": "Upper (C) - Epigastric", + "display-or": "ନାଭି ଉପରକୁ" + }, + { + "id": "ID_1036073432", + "text": "Upper (L) - Left Hypochondrium", + "display-or": "ବାମ ଉପରକୁ" + }, + { + "id": "ID_568631554", + "text": "Middle (R) - Right Lumbar", + "display-or": "ଡ଼ାହାଣ ମଝି" + }, + { + "id": "ID_962169419", + "text": "Middle (C) - Umbilical", + "display-or": "ନାଭି ଚାରିକଡ଼େ" + }, + { + "id": "ID_1324037145", + "text": "Middle (L) - Left Lumbar", + "display-or": "ବାମ ମଝି" + }, + { + "id": "ID_1239783765", + "text": "Lower (R) - Right Illiac Fossa", + "display-or": "ଡ଼ାହାଣ ତଳ" + }, + { + "id": "ID_644410306", + "text": "Lower (C) - Hypogastric/Suprapubic", + "display-or": "ନାଭି ତଳକୁ" + }, + { + "id": "ID_562710446", + "text": "Lower (R) - Left Illiac Fossa", + "display-or": "ବାମ ତଳ" + }, + { + "id": "ID_917293565", + "text": "All over", + "display-or": "ଚାରିଅାଡ଼େ" + } + ] + }, + { + "id": "ID_923360490", + "text": "How many?", + "language": "%", + "display-or": "କେତେଟା ଫୁଲା", + "options": [ + { + "id": "ID_1885607537", + "text": "Enter number of lumps", + "input-type": "number", + "language": "No. of lumps", + "display-or": "କେତେ ଥର" + } + ] + }, + { + "id": "ID_1674874012", + "text": "What is its shape?", + "language": "%", + "display-or": "କେମିତି ଦେଖାଯାଉଛି", + "options": [ + { + "id": "ID_66314640", + "text": "Round", + "language": "round in shape", + "display-or": "ଗୋଲାକାର" + }, + { + "id": "ID_577096038", + "text": "Irregular", + "language": "irregular in shape", + "display-or": "ଅନିୟମିତ" + } + ] + }, + { + "id": "ID_1016461605", + "text": "How is the surface?", + "language": "%", + "display-or": "ଉପର କେମିତି ଲାଗୁଛି", + "options": [ + { + "id": "ID_1834678900", + "text": "Smooth", + "language": "smooth surface", + "display-or": "ସମାନ" + }, + { + "id": "ID_50938361", + "text": "Irregular", + "language": "irregular surface", + "display-or": "ଅଙ୍କାବଙ୍କା" + } + ] + }, + { + "id": "ID_755823613", + "text": "How does it feel?", + "language": "%", + "display-or": "ହାତକୁ କେମିତି ଜଚ୍ଚାଯାଉଛି", + "options": [ + { + "id": "ID_205997455", + "text": "Hard", + "language": "feels hard", + "display-or": "ଟାଣ" + }, + { + "id": "ID_1622508753", + "text": "Soft", + "language": "feels soft", + "display-or": "ନରମ" + }, + { + "id": "ID_1659191837", + "text": "Medium", + "language": "feels medium", + "display-or": "ମଝି ମଝିଅା" + } + ] + }, + { + "id": "ID_861684184", + "text": "Is it painful?", + "language": "%", + "display-or": "କାଟୁଛିନ ନା ନାହିଁ", + "options": [ + { + "id": "ID_1917441256", + "text": "Yes", + "language": "tender", + "display-or": "ହଁ" + }, + { + "id": "ID_96959175", + "text": "No", + "language": "not tender", + "display-or": "ନାଁ" + } + ] + }, + { + "id": "ID_736481497", + "text": "Any change in colour of skin?", + "language": "%", + "display-or": "ଚର୍ମର ରଙ୍ଗ ପରିବର୍ତ୍ତନ ହେଉଛି ନା ନାହି:", + "options": [ + { + "id": "ID_1366940185", + "text": "Yes", + "language": "skin discolouration observed", + "display-or": "ହଁ" + }, + { + "id": "ID_1606240793", + "text": "No", + "language": "no skin discolouration", + "display-or": "ନାଁ" + } + ] + }, + { + "id": "ID_766757379", + "text": "Any swelling above or below the lump?", + "language": "%", + "display-or": "ଉପରେ ବା ତଳେ କିଛି ଫୁଲୁଛି", + "options": [ + { + "id": "ID_79821874", + "text": "Swelling Above", + "language": "swelling observed above lump", + "display-or": "ଫୁଲା ଉପରେ" + }, + { + "id": "ID_427308946", + "text": "Swelling Below", + "language": "swelling observed below lump", + "display-or": "ଫୁଲା ତଳ ରେ" + }, + { + "id": "ID_263821258", + "text": "No Swelling", + "language": "no swelling", + "display-or": "ଫୁଲା ନାହିଁ" + } + ] + }, + { + "id": "ID_1676132010", + "text": "Is it moving related to adjacent tissues?", + "language": "%", + "display-or": "ଏପଟ ସେପଟ ହେଉଛି ନା ସ୍ଥିର ଅଛି", + "options": [ + { + "id": "ID_446798586", + "text": "Lump mobile", + "language": "lump mobile", + "display-or": "ଏପଟ ସେପଟ" + }, + { + "id": "ID_1539892741", + "text": "Lump fixed", + "language": "lump fixed", + "display-or": "ସ୍ଥିର" + } + ] + } + ] + }, + { + "id": "ID_519704332", + "text": "No", + "language": "no lumps", + "display-or": "ନାଁ" + }, + { + "id": "ID_240247673", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "ଫଟ ନିଅ" + } + ] + } + ] + } + ] + }, + { + "id": "443s6tckt68auclocrhgmu3oak", + "text": "Chest", + "language": "Chest:", + "display-or": "ଛାତି" + }, + { + "id": "ID_1731331523", + "text": "Physical Growth", + "language": "Physical Growth:", + "display-or": "ଶାରୀରିକ ବୃଦ୍ଧି", + "options": [ + { + "id": "ID_398242924", + "text": "MUAC", + "display-or": "ବାହୁର ପରିଧି", + "options": [ + { + "id": "ID_713016910", + "text": "Measure the Mid-Upper Arm Circumference using MUAC tape in all children 6 months or older", + "language": "%", + "display-or": "ବାହୁର ପରିଧି ମାପ ଛଅମାସରୁ ଉର୍ଧ ପିଲାଙ୍କର", + "options": [ + { + "id": "ID_1527581775", + "text": "Reading 1 (cms)", + "input-type": "number", + "display-or": "ସେମି" + }, + { + "id": "ID_7253791", + "text": "Reading 2 (cms)", + "input-type": "number", + "display-or": "ସେମି" + }, + { + "id": "ID_126974836", + "text": "Reading 3 (cms)", + "input-type": "number", + "display-or": "ସେମି" + } + ] + } + ] + }, + { + "id": "ID_234959031", + "text": "Head circumference", + "display-or": "ମୁଣ୍ଡ ପରିଧି", + "options": [ + { + "id": "ID_955216765", + "text": "Check head circumference for children under 2 years old", + "language": "%", + "display-or": "ଦୁଇ ବର୍ଷ ରୁ ଉର୍ଧ ପିଲାଙ୍କର ମୁଣ୍ଡର ପରିଧି ମାପ", + "options": [ + { + "id": "ID_1826595527", + "text": "Reading 1 (cms)", + "input-type": "number", + "display-or": "ସେମି" + }, + { + "id": "ID_1918803237", + "text": "Reading 2 (cms)", + "input-type": "number", + "display-or": "ସେମି" + }, + { + "id": "ID_903827329", + "text": "Reading 3 (cms)", + "input-type": "number", + "display-or": "ସେମି" + } + ] + } + ] + } + ] + }, + { + "id": "ID_1012406340", + "text": "Sick Child", + "language": "General (Child):", + "display-or": "ଅଶ୍ୱସ୍ଥ ପିଲା", + "options": [ + { + "id": "ID_1737676309", + "text": "Lethargy", + "display-or": "ମନ୍ଦ", + "language": "%", + "options": [ + { + "id": "ID_985717210", + "text": "Does the child appear to have sleepiness or deep unresponsiveness and inactivity?", + "language": "%", + "display-or": "ପିଲା ସୋଇପଡୁଛି ଡାକିଲେ ସୁନୁନୀ ବା ମନ୍ଦ ହୋଇ ପଡି ରହୁଛି", + "options": [ + { + "id": "ID_540044916", + "text": "Yes", + "language": "child appears lethargic", + "display-or": "ହଁ" + }, + { + "id": "ID_285880772", + "text": "No", + "language": "child appears normal", + "display-or": "ନାଁ" + } + ] + } + ] + }, + { + "id": "ID_1645083795", + "text": "Stridor", + "language": "%", + "display-or": "ଘର ଗର ଶବ୍ଦ", + "options": [ + { + "id": "ID_1096191699", + "text": "Does the child make high-pitched or wheezing sound while breathing?", + "language": "%", + "display-or": "ଛୁ ନିଶ୍ଵାସ ନେବା ସମୟରେ କିଛି ଶବ୍ଦ ଆସୁଛି କି?", + "options": [ + { + "id": "ID_688750682", + "text": "Yes", + "language": "The child makes wheezing sounds while breathing", + "display-or": "ହଁ" + }, + { + "id": "ID_1194369032", + "text": "No", + "language": "The child does not make wheezing sounds while breathing", + "display-or": "ନାଁ" + } + ] + } + ] + } + ] + }, + { + "id": "ID_1605849907", + "text": "Umbilicus", + "language": "Umbilicus (Child):", + "display-or": "ନାଭି", + "options": [ + { + "id": "ID_734775590", + "text": "Redness", + "display-or": "ନାଲି ପଡିବ", + "language": "%", + "options": [ + { + "id": "ID_1388720177", + "text": "Is there any redness on the umbilicus?", + "language": "%", + "display-or": "ନାଭି ନାଲି ପଡିଛି କି", + "options": [ + { + "id": "ID_367925807", + "text": "Yes", + "language": "umbilicus appears red", + "display-or": "ହଁ" + }, + { + "id": "ID_31326722", + "text": "No", + "language": "umbilicus appears normal", + "display-or": "ନାଁ" + } + ] + } + ] + }, + { + "id": "ID_728234620", + "text": "Discharge", + "display-or": "ଝରିବା / ବାହାରିବା", + "options": [ + { + "id": "ID_1410387018", + "text": "Is there any discharge?", + "language": "%", + "display-or": "ନାଭିରୁ କିଛି ଝରୁଛି କି", + "options": [ + { + "id": "ID_1771691820", + "text": "Yes", + "display-or": "ହଁ", + "language": "discharge seen" + }, + { + "id": "ID_1679510920", + "text": "No", + "display-or": "ନାଁ", + "language": "no discharge seen" + } + ] + } + ] + }, + { + "id": "ID_1533497046", + "text": "Shape", + "language": "%", + "display-or": "ଆକାର", + "options": [ + { + "id": "ID_762347474", + "text": "Is the umbilicus flat or everted?", + "language": "umbilicus is", + "display-or": "ସମାନ ଅଛି ନ ଓଲଟି ଯାଇଛି", + "options": [ + { + "id": "ID_1872064387", + "text": "Flat", + "language": "umbilicus appears flat", + "display-or": "ସମାନ" + }, + { + "id": "ID_1066170750", + "text": "Everted", + "language": "umbilicus appears everted", + "display-or": "ଓଲଟି ବା" + }, + { + "id": "ID_732598035", + "text": "Normal", + "display-or": "ଠିକ", + "language": "umbilicus appears normal in shape" + } + ] + } + ] + } + ] + }, + { + "id": "ID_1482587319", + "text": "Arm", + "language": "Arm:", + "display-or": "ବାହୁ", + "options": [ + { + "id": "ID_1169860179", + "text": "Blood Glucose (FBS)", + "display-or": "ବ୍ଲଡ଼ ଗ୍ଲୁକୋଜ (ଖାଲି ପେଟ ର)", + "options": [ + { + "id": "ID_1617400576", + "text": "Measure the patient's blood sugar on an empty stomach (not taken meals for at least 8 hours)", + "language": "%", + "display-or": "ଖାଲି ପେଟ ରେ ରୋଗୀ ର ବ୍ଲଡ଼ ଶୁଂଗର ମାପ. (୮ ଘଣ୍ଟା ରୁ ଅଧିକ ଖାଦ୍ୟ ନ ଖାଇଥିବା)", + "options": [ + { + "id": "ID_1112722162", + "text": "Enter value (mmol/L)", + "input-type": "number", + "language": "%", + "display-or": "(ପରିମାଣ ଲେଖ)" + } + ] + } + ] + }, + { + "id": "ID_533783615", + "text": "Blood Glucose (PP)", + "display-or": "ବ୍ଲଡ଼ ଗ୍ଲୁକୋଜ (ଖାଇବା ପରେ)", + "options": [ + { + "id": "ID_540721051", + "text": "Measure the patient's blood sugar after meals", + "language": "%", + "display-or": "ଖାଇବା ପରେ ରୋଗୀ ର ବ୍ଲଡ଼ ଶୁଂଗର ମାପ", + "options": [ + { + "id": "ID_1960849292", + "text": "Enter value (mmol/L)", + "input-type": "number", + "language": "%", + "display-or": "(ପରିମାଣ ଲେଖ)" + } + ] + } + ] + }, + { + "id": "ID_469211442", + "text": "Hemoglobin", + "display-or": "ହିମାଗ୍ଲୋବିନ", + "options": [ + { + "id": "ID_1396265479", + "text": "Use a digital hemoglobinometer to measure blood hemoglobin", + "language": "%", + "display-or": "ହେମୋଗ୍ଲୋବିନ ମିଟର", + "options": [ + { + "id": "ID_354200525", + "text": "Enter value", + "input-type": "number", + "language": "%", + "display-or": "(ପରିମାଣ ଲେଖ)" + } + ] + } + ] + }, + { + "id": "ID_272228552", + "text": "Lying BP", + "display-or": "ସୋଇ କରି BP ମାପ", + "options": [ + { + "id": "ID_1160349142", + "text": "Take the patient's BP lying down", + "language": "%", + "display-or": "ସୋଇ କରି ରୋଗୀ ର BP ମାପ", + "options": [ + { + "id": "ID_1262593440", + "text": "Enter systolic BP", + "input-type": "text", + "language": "Systolic:", + "display-or": "Systolic BP ଲେଖ" + }, + { + "id": "ID_1151021967", + "text": "Enter diastolic BP", + "input-type": "text", + "language": "Diastolic:", + "display-or": "diastolic BP ଲେଖ" + } + ] + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/app/src/main/assets/physExam.json b/app/src/main/assets/physExam.json new file mode 100644 index 0000000000..d8c2227722 --- /dev/null +++ b/app/src/main/assets/physExam.json @@ -0,0 +1,3835 @@ +{ + "id": "476q4jppos6tg7t3qug97udg17", + "text": "Physical Exam", + "options": [ + { + "id": "7hrmfqn0krat7sjobfh9rjr5i0", + "text": "General exams", + "language": "General Exams:", + "display-or": "?????? ???????", + "options": [ + { + "id": "0blae61v5pgt9hcv3fni2ad6nd", + "text": "Eyes: Jaundice", + "display-or": "????: ??????", + "options": [ + { + "id": "5saf8na9hgasnsda8khh7jgqdm", + "text": "Is there jaundice?", + "job-aid-type": "image", + "job-aid-file": "jaundiceexample", + "language": "%", + "display-or": "???? ?????", + "options": [ + { + "id": "0tniotfjt5upifs5ndt3grbstg", + "text": "Yes", + "language": "jaundice seen", + "display-or": "??" + }, + { + "id": "3gnt6celojtod43p771dq8ivr0", + "text": "No", + "language": "no jaundice seen", + "display-or": "???" + }, + { + "id": "ID_1214278407", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "?? ???" + } + ] + } + ] + }, + { + "id": "ID_415887386", + "text": "Eyes: Pallor", + "display-or": "????: ???", + "options": [ + { + "id": "3lntlnfs0va65rqdo136utmfmf", + "text": "Is there pallor?", + "job-aid-type": "video", + "job-aid-file": "conjunctivaexample", + "language": "%", + "display-or": "???? ????? ??? ???", + "options": [ + { + "id": "7o55cbfvcet2dtkj43ssip5je9", + "text": "Pale", + "language": "pale pallor", + "display-or": "???" + }, + { + "id": "2pt0hg68o89t624k0b2ngp16a2", + "text": "Normal", + "language": "normal pallor", + "display-or": "?????" + }, + { + "id": "ID_1954219899", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "?? ???" + } + ] + } + ] + }, + { + "id": "0gfk4826emivm01aoeltg2lrfb", + "text": "Arm", + "display-or": "????", + "options": [ + { + "id": "6qtsmnaurf40drgsbpf55dbbef", + "text": "Pinch skin", + "display-or": "????? ???????", + "options": [ + { + "id": "2ba1sf5pis2bk3lbe6hqjvm13c", + "text": "Normal", + "language": "pinch test normal", + "display-or": "??" + }, + { + "id": "0u9urrb01daa0g0u9hi5bc2dr5", + "text": "Slow", + "language": "appears slow on pinch test", + "display-or": "???" + } + ] + } + ] + }, + { + "id": "4skk1vd3pgmhh4v0qmt1vff91m", + "text": "Nail abnormality", + "display-or": "???", + "options": [ + { + "id": "5s4jcisk6ipicrd2k55uvef0gg", + "text": "Is there any nail abnormality?", + "job-aid-type": "image", + "job-aid-file": "abnormalnails", + "language": "%", + "display-or": "?? ?????? ???", + "options": [ + { + "id": "31mlk01davo6blu1as82mim2u3", + "text": "Nails are normal", + "language": "nails normal", + "display-or": "???? ???" + }, + { + "id": "3fp5hubboifaqe6hn9bsck3rq3", + "text": "Clubbing", + "language": "clubbing", + "display-or": "?? ??????? ??? ??? ?????" + }, + { + "id": "6iq8nsiocdpje2eslgao0g5c4s", + "text": "Spoon Nails", + "language": "spoon nails", + "display-or": "???? ?????????? ????" + }, + { + "id": "6luvtcj14erouol995jtnm4rf7", + "text": "Discolored", + "language": "discolored nails", + "display-or": "???? ???" + }, + { + "id": "ID_428480652", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "?? ???" + } + ] + } + ] + }, + { + "id": "ID_888899761", + "text": "Nail anemia", + "display-or": "?? ? ??????", + "options": [ + { + "id": "ID_1109515145", + "text": "Are the nails pale?", + "language": "%", + "display-or": "?? ?? ???? ???", + "options": [ + { + "id": "ID_1933772393", + "text": "Nails are pale", + "display-or": "???? ???" + }, + { + "id": "ID_377766203", + "text": "Nails are not pale", + "display-or": "???? ??? ?????" + }, + { + "id": "ID_646885323", + "text": "Take a picture", + "input-type": "camera", + "display-or": "?? ???", + "language": "[picture taken]" + } + ] + } + ] + }, + { + "id": "0lhp3ulsufnavi3f7o0bdg66s3", + "text": "Ankle", + "display-or": "?????", + "options": [ + { + "id": "3ufr8egutqs65irlr8u2gi8iid", + "text": "Is there ankle oedema?", + "job-aid-type": "image", + "job-aid-file": "ankleedemaexample", + "language": "%", + "display-or": "????? ?????? ???", + "options": [ + { + "id": "7266ke3fpvk3kv2bplvf7cqcl2", + "text": "In left", + "language": "pedal oedema in left foot", + "display-or": "???" + }, + { + "id": "ID_287551897", + "text": "In right", + "language": "pedal oedema in right foot", + "display-or": "?????" + }, + { + "id": "ID_1390923199", + "text": "Both", + "language": "pedal oedema in both feet", + "display-or": "??? ??" + }, + { + "id": "7s72difltncg15eq8uk51djqv6", + "text": "No oedema", + "language": "no pedal oedema", + "display-or": "?????" + }, + { + "id": "ID_1292783417", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "?? ???" + } + ] + } + ] + } + ] + }, + { + "id": "6ckop7kklhdihk474m4f0t58vc", + "text": "Head", + "language": "Head:", + "display-or": "?????", + "options": [ + { + "id": "2oumf1tm37dejb5619lr2gb0c2", + "text": "Injury", + "display-or": "????", + "language": "%", + "options": [ + { + "id": "365fe3npmo15fs1idpt9qq4v4i", + "text": "Inspect the head from all sides and look for injuries.", + "language": "%", + "display-or": "???? ???? ???? ???? ?? ???", + "options": [ + { + "id": "46ggknqga16skrkurisdrkmlga", + "text": "No injury", + "display-or": "????? ?????" + }, + { + "id": "2mtljhbu43q7fn4nj8rn6c1f00", + "text": "Injury at side of head", + "display-or": "????? ???????" + }, + { + "id": "3uukeqlno2pg63i0ftshkllst5", + "text": " Injury in the middle of head", + "display-or": "????? ?????" + }, + { + "id": "ID_1624337048", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "?? ???" + } + ] + } + ] + }, + { + "id": "0rr3s1emht4njnse07f3o7rsde", + "text": "Swelling", + "display-or": "??????", + "language": "%", + "options": [ + { + "id": "5ge0k8tpp7b8dukmd0pm88mu8f", + "text": "Are there any swellings?", + "language": "%", + "display-or": "???? ??????", + "options": [ + { + "id": "3p1cueosmgjfeab59c38smq1rs", + "text": "No swelling", + "display-or": "???? ?????" + }, + { + "id": "7l32ahbdi2fkbb8od9l1u0coju", + "text": "Swelling at side of head", + "display-or": "???? ???????" + }, + { + "id": "4dqpsgo07bkjp5ks5hgbqpvp6g", + "text": "Swelling at middle of head", + "display-or": "???? ?????" + }, + { + "id": "ID_1097524513", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "?? ???" + } + ] + } + ] + } + ] + }, + { + "id": "3q5em0r7dg0frq12aobko11338", + "text": "Ear", + "language": "Ear:", + "display-or": "???", + "options": [ + { + "id": "2fbasmki3ofs2bri4sk2vlenb6", + "text": "Bleeding", + "display-or": "??????????", + "language": "%", + "options": [ + { + "id": "096lo55ndv4h6fe645nt299mt5", + "text": "Is there any bleeding from ear?", + "language": "%", + "display-or": "???? ?????????", + "options": [ + { + "id": "2i5v2oc3gdosvo5m9n227p4bo5", + "text": "Yes", + "language": "bleeding seen from ear", + "display-or": "??" + }, + { + "id": "74gfff8rpeuss6218bb4lma3dr", + "text": "No", + "language": "no bleeding seen from the ear", + "display-or": "???" + }, + { + "id": "ID_1278760897", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "?? ???" + } + ] + } + ] + }, + { + "id": "1pmas2h9k9hq3q5qqdmlk1nmh5", + "text": "Discharge", + "display-or": "????? ???? ????????", + "language": "%", + "options": [ + { + "id": "3ib4lpsg2rub7iorp5qlcm4086", + "text": "Is there any discharge from the ear?", + "language": "%", + "display-or": "????? ???? ???????? ???", + "options": [ + { + "id": "4turgn4sskcj3hvlvb78gu8il9", + "text": "Yes", + "language": "discharge seen from ear", + "display-or": "??" + }, + { + "id": "60581gqn41acafejd4ai1491l0", + "text": "No", + "language": "no discharge seen from the ear", + "display-or": "???" + }, + { + "id": "ID_1447435625", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "?? ???" + } + ] + } + ] + }, + { + "id": "ID_865794463", + "text": "Redness", + "display-or": "?????????", + "language": "%", + "options": [ + { + "id": "ID_1329408645", + "text": "Is there any redness in the ear?", + "display-or": "??? ???? ????? ?? ?", + "language": "%", + "options": [ + { + "id": "ID_1109132835", + "text": "Yes", + "language": "Redness seen in ear", + "display-or": "??" + }, + { + "id": "ID_1349928351", + "text": "No", + "language": "No redness seen in ear", + "display-or": "???" + }, + { + "id": "ID_260586471", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "?? ???" + } + ] + } + ] + }, + { + "id": "ID_1401870323", + "text": "Swelling", + "display-or": "??????", + "language": "%", + "options": [ + { + "id": "ID_1965239296", + "text": "Are there any swellings in the ear?", + "display-or": "?????? ?? ? ??? ?? ??? ???", + "language": "%", + "options": [ + { + "id": "ID_1130685792", + "text": "Yes", + "language": "no discharge seen from the ear", + "display-or": "??" + }, + { + "id": "ID_1436663527", + "text": "No", + "language": "Swelling not seen", + "display-or": "???" + }, + { + "id": "ID_1602694544", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "?? ???" + } + ] + } + ] + } + ] + }, + { + "id": "2qqfs0jt4knpcaubtav7p59i84", + "text": "Eyes", + "language": "Eyes:", + "display-or": "????", + "options": [ + { + "id": "5kpauqr2clsrjg20htagccpf1r", + "text": "Pupillary movement", + "display-or": "??? ???????", + "language": "%", + "options": [ + { + "id": "1a51vkv5a5mgu91ae0kk19kbil", + "text": "Shine a torch and look for pupillary movements", + "language": "%", + "display-or": "???????? ??? ??????? ??????? ??", + "options": [ + { + "id": "2cl2p4oqmas4jqc4cl9oj1ce43", + "text": "Moving", + "language": "pupils moving", + "display-or": "???? ???? ??????" + }, + { + "id": "4lp77jenv79emvs3g9q62d5hir", + "text": "Not moving", + "language": "pupils not moving", + "display-or": "????????" + } + ] + } + ] + }, + { + "id": "ID_1971891989", + "text": "Redness", + "display-or": "?????????", + "language": "%", + "options": [ + { + "id": "ID_674365352", + "text": "Is there any redness in the eye(s)?", + "language": "%", + "display-or": "????? ??? ????? ?? ?", + "options": [ + { + "id": "ID_1992202071", + "text": "Yes", + "language": "redness seen", + "display-or": "??" + }, + { + "id": "ID_270777114", + "text": "No", + "language": "no redness seen", + "display-or": "???" + }, + { + "id": "ID_769598133", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "?? ???" + } + ] + } + ] + }, + { + "id": "ID_15402514", + "text": "Discharge", + "display-or": "???????? /?????", + "language": "%", + "options": [ + { + "id": "ID_566968371", + "text": "Is there any discharge from the eye?", + "language": "%", + "display-or": "??? ?? ???? ????? ?? ? ??? ?? ??? ???", + "options": [ + { + "id": "ID_540815308", + "text": "Yes", + "language": "discharge seen", + "display-or": "??" + }, + { + "id": "ID_1481304305", + "text": "No", + "language": "no discharge", + "display-or": "???" + }, + { + "id": "ID_1815382231", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "?? ???" + } + ] + } + ] + }, + { + "id": "ID_1143132576", + "text": "Swelling", + "display-or": "??????", + "language": "%", + "options": [ + { + "id": "ID_1250004705", + "text": "Is there any swelling of eyelid?", + "language": "%", + "display-or": "??? ????? ??? ??? ???", + "options": [ + { + "id": "ID_122639287", + "text": "Yes", + "language": "Swelling seen", + "display-or": "??" + }, + { + "id": "ID_1444285590", + "text": "No", + "language": "No swelling seen", + "display-or": "???" + }, + { + "id": "ID_1039325175", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "?? ???" + } + ] + } + ] + } + ] + }, + { + "id": "2dj3h6ujd39inj4t3odadnci0g", + "text": "Face", + "language": "Face:", + "display-or": "????", + "options": [ + { + "id": "4kdr5q7hfltqa7jbrup14hdmir", + "text": "Swollen Face", + "display-or": "???? ?????? ???", + "language": "%", + "options": [ + { + "id": "28h85njs3ksiv480ik83hukua6", + "text": "Does the face appear swollen/puffy?", + "language": "%", + "display-or": "????????", + "options": [ + { + "id": "5fm4bpqfvupes9b5bu12fljiun", + "text": "Normal", + "language": "face appears normal", + "display-or": "??????" + }, + { + "id": "4smb46om7l01kp76rk9qa5uu00", + "text": "Swollen", + "language": "face appears swollen", + "display-or": "??????" + }, + { + "id": "ID_387823315", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "?? ???" + } + ] + } + ] + } + ] + }, + { + "id": "6uitbkmgtq2oc68rhcui460g5r", + "text": "Mouth", + "language": "Mouth:", + "display-or": "????", + "options": [ + { + "id": "6d8fdfle3o8h0pbqie1uvrmi2i", + "text": "Tongue Dryness", + "language": "%", + "display-or": "??? ??????", + "options": [ + { + "id": "5j44qfvarua6569agutns5s590", + "text": "Is the tongue dry?", + "language": "%", + "display-or": "??? ?????? ???", + "options": [ + { + "id": "06o03fpl9bs58km60o3r5k12nk", + "text": "Yes", + "language": "tongue is dry", + "display-or": "??" + }, + { + "id": "09rc564f4ctqqr5q0gtr2l0hvk", + "text": "No", + "language": "tongue is not dry", + "display-or": "???" + } + ] + } + ] + }, + { + "id": "1s49fteqimutf8uj0eftnvntgk", + "text": "Discolouration of teeth", + "language": "%", + "display-or": "?????? ???? ??????????", + "options": [ + { + "id": "22oq936aiq3ijdibnlu0a2otu0", + "text": "Open mouth, shine a torch to affected part and look for black spots on teeth/discoloured teeth", + "language": "%", + "display-or": "??????? ???? ????????? ????? ???", + "options": [ + { + "id": "5tdoq169l36c0fdqngu5rdlt3p", + "text": "Teeth normal", + "language": "teeth are normal", + "display-or": "????? ???? ???" + }, + { + "id": "47g8kpjfrdiijbt3jj7abue6mp", + "text": "Teeth have black spots", + "language": "black spots on teeth", + "display-or": "????? ??? ??????" + }, + { + "id": "0vp1kncq7je5esav1oqe3smuto", + "text": "Teeth discoloured", + "language": "discoloured teeth", + "display-or": "????? ???? ?????????? ?????" + }, + { + "id": "ID_1578504135", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "?? ???" + } + ] + } + ] + }, + { + "id": "5l5v4nm5g9f1fchkd163hmg7ql", + "text": "Swelling of Gums", + "language": "%", + "display-or": "???? ??????", + "options": [ + { + "id": "1afo09f1e5ijjoum5sb3utlter", + "text": "Look for swelling on gums", + "language": "%", + "display-or": "???? ?????? ???", + "options": [ + { + "id": "2l29uq49a8qk33g9ns8bfujo3u", + "text": "Yes", + "language": "gums swollen", + "display-or": "??" + }, + { + "id": "5dthi1ct8mq1snkua7oln8kb15", + "text": "No", + "language": "gums are not swollen", + "display-or": "???" + }, + { + "id": "ID_1573386216", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "?? ???" + } + ] + } + ] + }, + { + "id": "ID_1772055565", + "text": "Gum bleeding", + "language": "%", + "display-or": "??????? ????", + "options": [ + { + "id": "ID_1525908874", + "text": "Is there bleeding from gums?", + "language": "%", + "display-or": "??????? ???? ???????? ?? ?", + "options": [ + { + "id": "ID_1297637014", + "text": "Yes", + "language": "bleeding seen from gums", + "display-or": "??" + }, + { + "id": "ID_366660133", + "text": "No", + "language": "no bleeding seen from gums", + "display-or": "???" + }, + { + "id": "ID_1320828522", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "?? ???" + } + ] + } + ] + }, + { + "id": "58cou8gf81umet06njv4oc1n6c", + "text": "Back of throat (redness, swelling)", + "language": "%", + "display-or": "????? ???? ??????", + "options": [ + { + "id": "6an5fe6s4b9n8c2fkmbmrc9l0o", + "text": "Ask patient to open mouth and stick tongue out. Shine a torch to examine the back of throat and look for swelling/redness", + "language": "%", + "display-or": "??? ?? ???????? ??????? ?? (??? ???? ?????? ?? ??????)", + "options": [ + { + "id": "2ha0ob31n8csdscu6g8ren1tll", + "text": "Normal", + "language": "back of throat normal", + "display-or": "???? ???" + }, + { + "id": "7j2f56orqds0jguel4tcb2hk6p", + "text": "Redness", + "language": "redness in back of throat", + "display-or": "???? ??????" + }, + { + "id": "1tllmv1vhq187gn8isto9nv6qo", + "text": "Swelling", + "language": "swelling in back of throat", + "display-or": "??????" + }, + { + "id": "ID_1881322286", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "?? ???" + } + ] + } + ] + }, + { + "id": "ID_829831396", + "text": "Oral thrush", + "language": "%", + "display-or": "?????? ??? ?????", + "options": [ + { + "id": "ID_1860492995", + "text": "Are there white coating/patches on the tongue, mouth, inner cheeks or the back of the throat?", + "language": "%", + "display-or": "??? ????? -????? ,?????? ,???????? ,?????", + "options": [ + { + "id": "ID_1480041052", + "text": "Yes", + "language": "white patches seen in the mouth", + "display-or": "??" + }, + { + "id": "ID_65009506", + "text": "No", + "language": "no white patches seen in the mouth", + "display-or": "??" + }, + { + "id": "ID_1854090323", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "?? ???" + } + ] + } + ] + } + ] + }, + { + "id": "686dv52dr7uagp5s74qs85fpo0", + "text": "Neck", + "language": "Neck:", + "display-or": "???", + "options": [ + { + "id": "4o6f7q0eskkg9kq0v0r0a6h9fh", + "text": "Thyroid swelling", + "display-or": "???????? ??????", + "options": [ + { + "id": "6sd6af4f1qgucbe17bq482fo2t", + "text": "Is there visible swelling in the front of the neck?", + "job-aid-type": "image", + "job-aid-file": "thyroidswelling", + "display-or": "????? ?????? ??? ???? ?????? ???", + "language": "%", + "options": [ + { + "id": "0og1s6ekirbe84jutgjr54ctdt", + "text": "Yes", + "language": "swelling in front of neck", + "display-or": "??", + "options": [ + { + "id": "ID_336426537", + "text": "Ask the patient to swallow with neck straight. Does the swelling move?", + "language": "%", + "display-or": "??? ????? ???? ?????? ???? ???. ???? ??? ????? ???", + "options": [ + { + "id": "ID_1317721761", + "text": "Moves", + "language": "Swelling moves with swallowing", + "display-or": "??? ?????" + }, + { + "id": "ID_1229096889", + "text": "Does not move", + "language": "Swelling does not move with swallowing", + "display-or": "??? ??? ?????" + } + ] + } + ] + }, + { + "id": "58sqse0lbig862ucj8b2fho5l1", + "text": "No", + "language": "no swelling in front of neck", + "display-or": "???" + } + ] + } + ] + } + ] + }, + { + "id": "136efe9j0u2qed5vmqflgih15k", + "text": "Breast", + "language": "Breast:", + "display-or": "????", + "options": [ + { + "id": "ID_1049121031", + "text": "Examination instructions", + "language": "%", + "display-or": "???????", + "options": [ + { + "id": "ID_244722854", + "text": "The following examination is only to be performed by a FEMALE health worker and only if the patient is comfortable.", + "language": "%", + "display-or": "????? ???????? ?????? ???????" + } + ] + }, + { + "id": "5u0bj8eju18p6rkq37kjhrjtkl", + "text": "Lumps", + "display-or": "???? ???????", + "language": "%", + "options": [ + { + "id": "00te1cpnds5pivja14k0u168r2", + "text": "Perform breast exam to look for lumps", + "language": "%", + "display-or": "?????? ???? ?????? ???", + "options": [ + { + "id": "59qdj23qcl1rhv0blnj7blth4e", + "text": "Possible lumps detected in breast exam", + "display-or": "???? ???" + }, + { + "id": "ID_1757348571", + "text": "No lumps detected in breast exam", + "display-or": "??????" + } + ] + } + ] + }, + { + "id": "2pkvamf5g9p9b37elcll8bb75e", + "text": "Scars", + "display-or": "??, ?????", + "language": "%", + "options": [ + { + "id": "3cbr9frtkdep6m0kj3v2ed85ot", + "text": "Any scar on the breast?", + "language": "%", + "display-or": "?????? ???? ?? ????? ??? ???", + "options": [ + { + "id": "2cmrhupbq2u0idjjl53386lbi9", + "text": "Yes", + "language": "scarring seen", + "display-or": "??" + }, + { + "id": "27n2ugg2ji5p7jbb1sr3i6iqcb", + "text": "No", + "language": "no scarring seen", + "display-or": "???" + } + ] + } + ] + }, + { + "id": "5rbakfs6u9q4vdqkc3eq1gvrr2", + "text": "Ulcer", + "display-or": "??", + "language": "%", + "options": [ + { + "id": "6kgena4h22ag7inhj44fj70hdk", + "text": "Any ulcer on the breast?", + "language": "%", + "display-or": "?????? ?? ????? ???", + "options": [ + { + "id": "70s23tdhr8qcrudm1mv9uqevjk", + "text": "Yes", + "language": "ulcer seen", + "display-or": "??" + }, + { + "id": "56rds41aluohab9440cdgj4ir7", + "text": "No", + "language": "no ulcer seen", + "display-or": "???" + } + ] + } + ] + }, + { + "id": "3munln03g404amqheuqnrvpj9v", + "text": "Skin colour", + "display-or": "????? ????", + "language": "%", + "options": [ + { + "id": "3p9un6lapk9nu0ggq5833pef5l", + "text": "Is the colour of the entire skin normal?", + "language": "%", + "display-or": "?????? ??? ?????? ??? ???", + "options": [ + { + "id": "1i5uleucmsbla5hqe8c1b1kcjq", + "text": "Normal", + "language": "skin colour appears normal", + "display-or": "?????" + }, + { + "id": "0a39jvob5jl0nm4cgdqouimsrp", + "text": "Discoloured", + "language": "skin appears discoloured", + "display-or": "?????" + } + ] + } + ] + }, + { + "id": "3vun4a13c8hufvmiocqvkp86s9", + "text": "Nipple", + "display-or": "??????", + "language": "%", + "options": [ + { + "id": "51nu6ldj5r0d24qm5ejehp7nlc", + "text": "Is the nipple normal?", + "language": "%", + "display-or": "????? ?????? ??? ???", + "options": [ + { + "id": "119qm4q8gsrgo5708d903gbl2f", + "text": "Normal", + "language": "nipple is normal", + "display-or": "??????" + }, + { + "id": "2liv77l49rc9eak1o6pjvekidl", + "text": "Cracked", + "language": "nipple is cracked", + "display-or": "????? ??????" + }, + { + "id": "27g0v4om5vepgqgtt4q2n30v73", + "text": "Inverted", + "language": "nipple is inverted", + "display-or": "?????? ??? ?????" + } + ] + } + ] + }, + { + "id": "ID_1300484864", + "text": "Discharge", + "display-or": "?????", + "options": [ + { + "id": "ID_995366833", + "text": "Is there any discharge?", + "language": "%", + "display-or": "???? ????? ?? ?", + "options": [ + { + "id": "ID_1252412077", + "text": "No discharge", + "display-or": "????? ????" + }, + { + "id": "ID_969059384", + "text": "Pus", + "display-or": "???" + }, + { + "id": "ID_495334060", + "text": "Blood", + "display-or": "????" + }, + { + "id": "ID_1646767141", + "text": "Mixed blood and pus", + "display-or": "????" + }, + { + "id": "ID_1846089709", + "text": "Thin discharge", + "display-or": "????" + }, + { + "id": "ID_1718786231", + "text": "Dry", + "display-or": "??????" + } + ] + } + ] + } + ] + }, + { + "id": "2t2vdn6piv6ohlmdi7bvbf5rk5", + "text": "Abdomen", + "language": "Abdomen:", + "display-or": "???", + "options": [ + { + "id": "1s1a0gi6oo6fqeqq35nu3vfv6p", + "text": "Scars", + "display-or": "??, ?????", + "language": "%", + "options": [ + { + "id": "0m63c82jb2ouqchb71cjc19c96", + "text": "Are there visible scars?", + "language": "%", + "display-or": "?? ????? ????????? ???", + "options": [ + { + "id": "51jlqttpefo5bvt47itt4gle4h", + "text": "Yes", + "language": "scarring seen", + "display-or": "??", + "options": [ + { + "id": "1li24o0i5q99c9lrvlc5oelegk", + "text": "Where is it?", + "job-aid-type": "image", + "job-aid-file": "abdominalregions9", + "language": "location of the scar -", + "display-or": "?????? ?????", + "options": [ + { + "id": "5nph6mlpkgt8okr829nk64utg6", + "text": "Upper(R)", + "language": "Upper(R)", + "display-or": "????? ?????" + }, + { + "id": "5e2rlrnskocg50nmqv93di0vqo", + "text": "Middle(L)", + "language": "Middle(L)", + "display-or": "??? ???" + }, + { + "id": "6dleo64ml0na3p5sbgi675jt5l", + "text": "Middle(C)", + "language": "Middle(C)", + "display-or": "???? ????????" + }, + { + "id": "03e7qiiv4m2i5l78v10il5lqnc", + "text": "Middle(R)", + "language": "Middle(R)", + "display-or": "?????? ???" + }, + { + "id": "32ragocnprafru5c6pb0sqr0a4", + "text": "Lower(L)", + "language": "Lower(L)", + "display-or": "??? ??" + }, + { + "id": "7e6feg5tspmoqem0lfreksutd6", + "text": "Lower(C)", + "language": "Lower(C)", + "display-or": "???? ????" + }, + { + "id": "5n4c3c79j2vdamdj37hbq7qc5v", + "text": "Lower(R)", + "language": "Lower(R)", + "display-or": "????? ??" + }, + { + "id": "ID_990408086", + "text": "Upper (C) - Epigastric", + "display-or": "???? ?????", + "language": "Upper(C)" + }, + { + "id": "ID_207392971", + "text": "Upper (L) - Left Hypochondrium", + "display-or": "??? ?????", + "language": "Upper (L)" + }, + { + "id": "19n7k3i1naihf0i700ss0tg1j9", + "text": "All Over", + "language": "All Over", + "display-or": "?????????" + } + ] + } + ] + }, + { + "id": "2479hlr44iinotc9ib0qulp6tg", + "text": "No", + "language": "no scarring", + "display-or": "???" + }, + { + "id": "ID_3192771", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "?? ???" + } + ] + } + ] + }, + { + "id": "2vkfpsqlkinig2gdr6i2fnmasl", + "text": "Distension", + "display-or": "???????", + "language": "%", + "options": [ + { + "id": "1mi79jc0g9egsuuti7ftf7bjs1", + "text": "Is there abdominal bloating?", + "language": "%", + "display-or": "??? ???????? ???", + "options": [ + { + "id": "0cstdbsl4iu6mroj46l3jsmpa2", + "text": "Yes", + "language": "distension seen", + "display-or": "??" + }, + { + "id": "13evgg6ga91gderevdpl7p0jb3", + "text": "No", + "language": "no distension", + "display-or": "???" + }, + { + "id": "ID_698130164", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "?? ???" + } + ] + } + ] + }, + { + "id": "6vo75prj7lpj69v0rah9ptprj5", + "text": "Tenderness", + "display-or": "??? ????", + "language": "%", + "options": [ + { + "id": "3fa3uu2tg8s5iebcnuqsegn77t", + "text": "Is there abdominal tenderness?", + "job-aid-type": "image", + "job-aid-file": "abdominalregions9", + "language": "%", + "display-or": "????? ?????? ???", + "options": [ + { + "id": "ID_1047975607", + "text": "Yes", + "language": "tenderness seen", + "display-or": "??", + "options": [ + { + "id": "ID_766474265", + "text": "Select the location where there is tenderness", + "language": "location", + "display-or": "???? ??????", + "options": [ + { + "id": "3tlg21c2326gbu1rm4qk53fpit", + "text": "Upper(L)", + "language": "Upper(L)", + "display-or": "??? ?????" + }, + { + "id": "3an1q5ef0qcrsvipj34tk11291", + "text": "Upper(C)", + "language": "Upper(C)", + "display-or": "???? ?????" + }, + { + "id": "2vr8qoh5uj8i7r6e5ukuinufr8", + "text": "Upper(R)", + "language": "Upper(R)", + "display-or": "????? ?????" + }, + { + "id": "0lnop7ueoaiua22vlik3e45nfe", + "text": "Middle(L)", + "language": "Middle(L)", + "display-or": "??? ???" + }, + { + "id": "58b89krpqba3tluclbsqv6nun4", + "text": "Middle(C)", + "language": "Middle(C)", + "display-or": "???? ????????" + }, + { + "id": "5e7cptqtqdgpoc5snvues5lk79", + "text": "Middle(R)", + "language": "Middle(R)", + "display-or": "?????? ???" + }, + { + "id": "4aou5edcakccp507v28hasgi5u", + "text": "Lower(L)", + "language": "Lower(L)", + "display-or": "??? ??" + }, + { + "id": "022ur9sfnq5q2743gnu7g81ae5", + "text": "Lower(C)", + "language": "Lower(C)", + "display-or": "???? ????" + }, + { + "id": "0f6bcg1tc7ibbughrlh56rdje7", + "text": "Lower(R)", + "language": "Lower(R)", + "display-or": "????? ??" + }, + { + "id": "7kon53anrnpqsfpug5qhc0p21b", + "text": "All Over", + "language": "All Over", + "display-or": "?????????" + } + ] + } + ] + }, + { + "id": "221ndbofeiel4kuld16pj90rq0", + "text": "No tenderness", + "language": "no tenderness", + "display-or": "???" + } + ] + } + ] + }, + { + "id": "6qqkebtga4qqa32to7pcgv5fvl", + "text": "Lumps", + "display-or": "????", + "options": [ + { + "id": "3v5o8q9h4lkbo5fqqac685jj6d", + "text": "Are there lumps?", + "language": "%", + "display-or": "????? ???? ???? ?????????", + "options": [ + { + "id": "1giutjar0lk0cf2kshdr5jgeoa", + "text": "Yes", + "language": "lumps seen", + "display-or": "??", + "options": [ + { + "id": "4r5l9qt33bn19so3bs3c4uiith", + "text": "Where is it?", + "job-aid-type": "image", + "job-aid-file": "abdominalregions9", + "language": "location", + "display-or": "?????? ?????", + "options": [ + { + "id": "24cg8m2o428u0fjekqcs0lnth8", + "text": "Upper(C)", + "language": "Upper(C)", + "display-or": "???? ?????" + }, + { + "id": "4f58923orn503u76vbsr91h8r4", + "text": "Upper(R)", + "language": "Upper(R)", + "display-or": "????? ?????" + }, + { + "id": "58ur1g23ab7c38cq2c2a65m885", + "text": "Middle(L)", + "language": "Middle(L)", + "display-or": "??? ???" + }, + { + "id": "2osvevb8k2kkc5a51sggg8ukmj", + "text": "Middle(C)", + "language": "Middle(C)", + "display-or": "???? ????????" + }, + { + "id": "0pptnpanb7l67facgo4fa613qa", + "text": "Middle(R)", + "language": "Middle(R)", + "display-or": "?????? ???" + }, + { + "id": "7a6l9madq3r3jj8009j0ilkf1n", + "text": "Lower(L)", + "language": "Lower(L)", + "display-or": "??? ??" + }, + { + "id": "314j563q6gi88jisshinkcaknv", + "text": "Lower(C)", + "language": "Lower(C)", + "display-or": "???? ????" + }, + { + "id": "061jbl7bcvkauvrk1geuok7c2u", + "text": "Lower(R)", + "language": "Lower(R)", + "display-or": "????? ??" + }, + { + "id": "6tc2t1aj3f3t8fisb6t1sqqga1", + "text": "All Over", + "language": "All Over", + "display-or": "?????????" + } + ] + }, + { + "id": "527hras4h7oie28sm42d1gs4nf", + "text": "How many?", + "language": "%", + "display-or": "?????? ???", + "options": [ + { + "id": "7vg06ntaaksg4h0al3lhet48ce", + "text": "Enter number of lumps", + "input-type": "number", + "language": "No. of lumps", + "display-or": "??????" + } + ] + }, + { + "id": "7n2ig7ajg32k1innt1b61c6fv8", + "text": "What is its shape?", + "language": "%", + "display-or": "?????? ?????????", + "options": [ + { + "id": "4hl0jv0g5sk7uo7p0b02boe73p", + "text": "Round", + "language": "round in shape", + "display-or": "???????" + }, + { + "id": "5bg1db5hethbbfs5k51k2vrdgs", + "text": "Irregular", + "language": "irregular in shape", + "display-or": "???????" + } + ] + }, + { + "id": "0cggktq1vrlvbal7o6gvt43tdf", + "text": "How is the surface?", + "language": "%", + "display-or": "??? ?????? ??????", + "options": [ + { + "id": "2vjtjpeqncg47qsqqrssn8mtg5", + "text": "Smooth", + "language": "smooth surface", + "display-or": "????" + }, + { + "id": "57g2vcu0cninftqki0fkh2huma", + "text": "Irregular", + "language": "irregular surface", + "display-or": "??????????" + } + ] + }, + { + "id": "1ujal0nlol5pb9f37cen62d91n", + "text": "How does it feel?", + "language": "%", + "display-or": "????? ??????", + "options": [ + { + "id": "344f4n28so8mk6v77943tc2o0f", + "text": "Hard", + "language": "feels hard", + "display-or": "???" + }, + { + "id": "3c7e65ukge3gt63pcavoqnr2vt", + "text": "Soft", + "language": "feels soft", + "display-or": "???" + }, + { + "id": "4ugdg490r6odffk2cd8bdgph48", + "text": "Medium", + "language": "feels medium", + "display-or": "??? ?????" + } + ] + }, + { + "id": "19d2d6vrbs9558bv5ub1i9uf1o", + "text": "Painful or not?", + "language": "%", + "display-or": "??? ????? ?? ???", + "options": [ + { + "id": "1mjkj9nn7a678ju1oeffiehba3", + "text": "Yes", + "language": "tender", + "display-or": "??" + }, + { + "id": "31204sdffp724anvvo67cgdanu", + "text": "No", + "language": "not tender", + "display-or": "???" + } + ] + }, + { + "id": "1nnme423cok1h5rdhfnkh7hlke", + "text": "Any change in colour of skin?", + "language": "%", + "display-or": "??? ?????? ???? ?????????? ???? ????? ???", + "options": [ + { + "id": "0j882oc11948g1ulqdhmtvgai6", + "text": "Yes", + "language": "discolouration of skin", + "display-or": "??" + }, + { + "id": "0oeemol3epsjche6h7i4i9dsa8", + "text": "No", + "language": "no skin discolouration", + "display-or": "???" + } + ] + }, + { + "id": "3qnfa95mrm3ufktmqr4ktv32f0", + "text": "Any swelling above or below the lump?", + "language": "%", + "display-or": "???? ?????? ??? ???? ???? ??? ???", + "options": [ + { + "id": "393ghhvtvu48j1s94ah6m9623j", + "text": "Swelling Above", + "language": "swelling above lump", + "display-or": "????" + }, + { + "id": "607hl7jb8vogfo7e8kvi7aplsm", + "text": "Swelling Below", + "language": "swelling below lump", + "display-or": "???" + }, + { + "id": "3edclgk96hu48kr26l2a544398", + "text": "No Swelling", + "language": "no swelling", + "display-or": "??????" + } + ] + }, + { + "id": "5saimdim8ao0gg5v00h3gnq1k6", + "text": "Is it moving related to adjacent tissues?", + "language": "%", + "display-or": "???? ?? ??? ????? ?? ????? ?????", + "options": [ + { + "id": "3cog1pco9kl43mmh6cmg69h9qe", + "text": "Lump mobile", + "language": "lump mobile", + "display-or": "???? ??? ??? ??" + }, + { + "id": "5f07fmnfhm94a2ukqrsm6gglah", + "text": "Lump fixed", + "language": "lump fixed", + "display-or": "???? ????? ???" + } + ] + }, + { + "id": "6j0jn1rbniamo13jehauhd3ctn", + "text": "Put a hand on the swelling and ask the patient to cough. Can you see and feel if there is a change in size?", + "language": "%", + "display-or": "????? ???? ?? ???? ??? ???? ?? ????? ???? ???. ???? ? ???? ?? ???? ???????? ????? ??? ? ???", + "options": [ + { + "id": "5van4tdr4qnkmfqeb4lkse7t47", + "text": "Does not change", + "language": "size of lump does not change with coughing", + "display-or": "???????? ?????" + }, + { + "id": "4ardlukeoecfq3vh1fqr8smu0n", + "text": "Increases with coughing", + "language": "size of lump increases with coughing", + "display-or": "????? ??? ?????" + } + ] + }, + { + "id": "1obk7oaaf549nbkbntbo6u02s9", + "text": "Now ask the patient to lie down. Is the swelling going down/reduces in size?", + "language": "%", + "display-or": "???? ?? ???? ???. ???? ? ???? ?? ???? ???????? ????? ??? ? ???", + "options": [ + { + "id": "3llsvgi66eo0vpm56udb9ca05i", + "text": "does not change", + "language": "size of lump does not reduce with lying down", + "display-or": "???????? ?????" + }, + { + "id": "5j0molvlt1v1qmg59a13b4q2j7", + "text": "reduce with lying down", + "language": "size of lump reduces with lying down", + "display-or": "??????" + } + ] + } + ] + }, + { + "id": "4dm6afeg11b56vsl5e5q77d5mg", + "text": "No", + "language": "no lumps", + "display-or": "???" + }, + { + "id": "ID_337376517", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "?? ???" + } + ] + } + ] + } + ] + }, + { + "id": "3pd5np20m5l29ffljkk9fganrb", + "text": "Hands", + "language": "Hands Power test:", + "display-or": "???", + "options": [ + { + "id": "7e6d81sn7amlih0a1b6ieikabv", + "text": "Nails cyanosis", + "display-or": "?? ???", + "options": [ + { + "id": "0opiknc208aavnjirjdvnlf3t5", + "text": "Does the nail beds appear bluish?", + "language": "%", + "display-or": "?? ??? ?????? ? ??? ??? ?? ???", + "options": [ + { + "id": "19fv146mt55pbqrdsii0pdbggg", + "text": "Normal", + "language": "nails normal", + "display-or": "??? ??????" + }, + { + "id": "1462enod5ftjc98u3303rfmc3p", + "text": "Bluish", + "language": "nails bluish", + "display-or": "??? ???" + }, + { + "id": "ID_558488511", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "?? ???" + } + ] + } + ] + }, + { + "id": "5knvilm6k3ib0v2iaa3jfdfpcd", + "text": "Power 1", + "display-or": "????? 1", + "language": "Gripping two fingers tightly", + "options": [ + { + "id": "78pgivnbga1brc9g1dhdf2t5ro", + "text": "Ask the patient to hold your two fingers tightly; one side at a time and examine strength of grip", + "language": "%", + "display-or": "???? ?????????? ????? ??? ?????? ??? ????? ???? ???", + "options": [ + { + "id": "70gntrpgdvodhvjk2o6qm0n9og", + "text": "Grip equal on both sides", + "language": "grip equal on both sides", + "display-or": "????? ????" + }, + { + "id": "5f2v78f2dcqlkef27pdrd52lhg", + "text": "Grip weak on left side", + "language": "grip weak on left side", + "display-or": "????? ??????" + }, + { + "id": "1mttk3kafnmv33su45bdrq9chg", + "text": "Grip weak on right side", + "language": "grip weak on right side", + "display-or": "?????? ??? ??????" + } + ] + } + ] + }, + { + "id": "ID_330495095", + "text": "Power 2", + "display-or": "????? 2", + "language": "Holding a paper tightly between thumb and curled fingers", + "options": [ + { + "id": "ID_949719690", + "text": "Ask the patient to hold a paper tight between thumb and curled fingers. Is the patient able to hold the paper?", + "display-or": "??? ??????? ?? ???? ?? ???? ????? ???? ????. ???? ?? ???? ???? ?? ??", + "language": "%", + "options": [ + { + "id": "ID_1538068182", + "text": "Grip equal on both sides", + "language": "grip equal on both sides", + "display-or": "????? ????" + }, + { + "id": "ID_1238338500", + "text": "Grip weak on left side", + "language": "grip weak on left side", + "display-or": "????? ??????" + }, + { + "id": "ID_1624892803", + "text": "Grip weak on right side", + "language": "grip weak on right side", + "display-or": "?????? ??? ??????" + } + ] + } + ] + }, + { + "id": "ID_1617808715", + "text": "Power 3", + "display-or": "????? 3", + "language": "Ability to spread 4 fingers apart when they are held together", + "options": [ + { + "id": "ID_1745755999", + "text": "Hold the patient's 4 fingers and ask him/her to spread them. Is the patient able to spread them?", + "display-or": "???? ??????? ?? ???? ?? ??? ???? ??????? ????? ???? ????. ??? ???? ??????? ??? ???? ?? ???", + "language": "%", + "options": [ + { + "id": "ID_1921328165", + "text": "Strength equal on both sides", + "language": "grip equal on both sides", + "display-or": "????? ????" + }, + { + "id": "ID_260856531", + "text": "Strength weak on left side", + "language": "grip weak on left side", + "display-or": "????? ??????" + }, + { + "id": "ID_642837135", + "text": "Strength weak on right side", + "language": "grip weak on right side", + "display-or": "?????? ??? ??????" + } + ] + } + ] + } + ] + }, + { + "id": "2h25kbabblri8uukidmf29gcfc", + "text": "Leg", + "language": "Leg:", + "display-or": "????", + "options": [ + { + "id": "65067vtfn058cbt8hnu6pmh6fb", + "text": "Movement", + "display-or": "?????", + "language": "SLR leg function test", + "options": [ + { + "id": "3un4m5pcnn97p8mckim5il3qpe", + "text": "(SLR) Patient lies supine. Have them raise one leg at a time (straight at the knee) and look for pain at any point", + "language": "%", + "display-or": "?????? ??? ????? ????? ????? ???? ??? ???? ???????? ???", + "options": [ + { + "id": "3lem6cmmm9054so6j11b6qg4m7", + "text": "SLR normal", + "language": "SLR normal", + "display-or": "SLR ??? ???" + }, + { + "id": "3nhnpmgv3t9r51o1trrteqoauv", + "text": "pain halfway on left side", + "language": "pain halfway on left side", + "display-or": "??? ?? ??? ?????? ??? ??? ?? ???" + }, + { + "id": "7pcua6o29rks3mcbhvft2stted", + "text": "pain halfway on right side", + "language": "pain halfway on right side", + "display-or": "??? ?? ??? ?????? ????? ??? ?? ???" + }, + { + "id": "63ceb4ocdfd55o7jimgcmnvejo", + "text": "pain halfway on both side", + "language": "pain halfway on both side", + "display-or": "??? ?? ??? ?????? ??? ??? ?? ???" + }, + { + "id": "31u9knlrh2i6i18osnbdgef5e9", + "text": "pain at the beginning on left side", + "language": "pain at the beginning on left side", + "display-or": "??? ??? ?????? ?????? ???" + }, + { + "id": "7jf9306h47h94mrtm05an9cqna", + "text": "pain at the beginning on right side", + "language": "pain at the beginning on right side", + "display-or": "????? ??? ?????? ?????? ???" + }, + { + "id": "212ohnhik1gq8d23cs7a9st1ek", + "text": "pain at the beginning on both side", + "language": "pain at the beginning on both side", + "display-or": "??? ??? ?????? ?????? ???" + }, + { + "id": "0if1r44q1t85he192dpmcckeqc", + "text": "pain near complete point on left side", + "language": "pain near complete point on left side", + "display-or": "??? ??? ???? ????? ?????? ???" + }, + { + "id": "5tj7tq4o83e3ukrr1aabsqklc2", + "text": "pain near complete point on right side", + "language": "pain near complete point on right side", + "display-or": "????? ??? ???? ????? ?????? ???" + }, + { + "id": "00v9urb4v0g32t7frttq3ub816", + "text": "pain near complete point on left both sides", + "language": "pain near complete point on left both sides", + "display-or": "??? ??? ???? ????? ?????? ???" + } + ] + } + ] + }, + { + "id": "2vj27i02o06g49o6lrgevvnbmg", + "text": "Strength", + "display-or": "?????", + "options": [ + { + "id": "2plsq2r8tbuuh82a8tlmj0hipl", + "text": "Ask patient to raise one leg at a time against your hand", + "language": "%", + "display-or": "???? ???? ??????? ??? ???? ???????? ????", + "options": [ + { + "id": "0ggq4g3veqb0fmi1q65j7m12i1", + "text": "Both legs equal", + "language": "both legs have equal strength", + "display-or": "????? ????" + }, + { + "id": "7gfs3rj0jrg4vb6toj75u9rbcs", + "text": "Right leg weak", + "language": "weakness in Rt leg side", + "display-or": "????? ??????" + }, + { + "id": "06uq9bpr5fvpqbopems3sp3ojd", + "text": "Left leg weak", + "language": "weakness in Lt leg side", + "display-or": "?????? ??? ??????" + } + ] + } + ] + } + ] + }, + { + "id": "4t5irnpds12ae3dtqls039q91m", + "text": "Back", + "language": "Back:", + "display-or": "????", + "options": [ + { + "id": "5o7bitv8bit3bih36n2u5jhbqo", + "text": "Swelling", + "display-or": "????", + "language": "%", + "options": [ + { + "id": "2spae93dsou9800p22plm30mms", + "text": "Is there any swelling?", + "language": "%", + "display-or": "?????? ???? ?????? ???", + "options": [ + { + "id": "7teqb3u97mgvvp223pba22qlre", + "text": "Yes", + "language": "swelling seen", + "display-or": "??" + }, + { + "id": "0835k7lrrmrvdou1b0ra9v5d75", + "text": "No", + "language": "no swelling seen", + "display-or": "???" + }, + { + "id": "ID_1031740959", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "?? ???" + } + ] + } + ] + }, + { + "id": "1oclpd2g1ir8boipefejto1tos", + "text": "Redness", + "display-or": "???? ??????", + "language": "%", + "options": [ + { + "id": "7bi6ere3gb37b6mau3485lcj4i", + "text": "Is there any redness on the skin?", + "language": "%", + "display-or": "???? ???? ?????????", + "options": [ + { + "id": "14d7lj25s1r4ss420u0mvk7idp", + "text": "Yes", + "language": "redness seen", + "display-or": "??" + }, + { + "id": "3b2v2j6trqn0473j674tn0070a", + "text": "No", + "language": "no redness seen", + "display-or": "???" + }, + { + "id": "ID_615116267", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "?? ???" + } + ] + } + ] + }, + { + "id": "7i1v4uc60th626f4qm60nd9p4j", + "text": "Deformity", + "display-or": "????? ?????", + "language": "%", + "options": [ + { + "id": "2s5k8bl1f5usse06ngpufo41im", + "text": "Is the spine deformed?", + "language": "%", + "display-or": "???? ?????????? ??????????? ?", + "options": [ + { + "id": "3rodnkiabsbp1givc4n0tucjcb", + "text": "Yes", + "language": "spine appears deformed", + "input-type": "camera", + "display-or": "??" + }, + { + "id": "4ccsi3a0v2spul2r4gbke9cbps", + "text": "No", + "language": "no visible spinal deformity", + "display-or": "???" + }, + { + "id": "ID_800416816", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "?? ???" + } + ] + } + ] + }, + { + "id": "7dg7b81tn9rjsk21k5ujvb0rit", + "text": "Tenderness", + "display-or": "??? ????", + "language": "%", + "options": [ + { + "id": "2ion6tdgfsahqk1jiga40eq92c", + "text": "Feel the back at midline and along the sides of midline and look for tenderness", + "language": "%", + "display-or": "?????? ?????? ??? ???????????", + "options": [ + { + "id": "64s1qn0ouep97u2gurbn34eocl", + "text": "Yes", + "language": "tenderness observed", + "display-or": "??" + }, + { + "id": "6952m0cbt6send8qhid17svbq7", + "text": "No", + "language": "no back tenderness", + "display-or": "???" + } + ] + } + ] + }, + { + "id": "ID_73016408", + "text": "Movement", + "display-or": "??? ???", + "language": "%", + "options": [ + { + "id": "ID_566200292", + "text": "Can the patient bend forward from his waist?", + "language": "%", + "display-or": "???? ??? ???? ?? ?????? ??? ????? ??", + "options": [ + { + "id": "ID_360140513", + "text": "Yes", + "language": "Patient can bend forward properly from the waist", + "display-or": "??" + }, + { + "id": "ID_1367247304", + "text": "No", + "language": "Patient cannot bend forward properly from the waist", + "display-or": "???" + } + ] + } + ] + } + ] + }, + { + "id": "ID_119118100", + "text": "Joint", + "language": "Joint:", + "display-or": "?????", + "options": [ + { + "id": "4o2igq05u9989rp4lvlsatj2cp", + "text": "Examination instructions", + "language": "%", + "display-or": "???????", + "options": [ + { + "id": "15fqgqi5n6m8q6kencbks5ocgi", + "text": "For the following joint examinations; please always compare with other side", + "language": "%", + "display-or": "????? ??? ?????? ? ??? ??? ?? ??? (????? ????? ?? ????? ??? ???)" + } + ] + }, + { + "id": "4llikp278a8ojdd7tedjf7ucj4", + "text": "Swelling", + "language": "%", + "display-or": "????? ????", + "options": [ + { + "id": "78er12e1u2keqfouj43ha838p0", + "text": "Is the joint swollen?", + "language": "%", + "display-or": "????? ?????? ???", + "options": [ + { + "id": "4unn3ia170uqjk0rpgv06vafjc", + "text": "Yes", + "language": "joint is swollen", + "display-or": "???" + }, + { + "id": "13j1m203lv1l6nq20dbbgiubeu", + "text": "No", + "language": "joint is not swollen", + "display-or": "???" + }, + { + "id": "ID_875541771", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "?? ???" + } + ] + } + ] + }, + { + "id": "72e4qbkllccgpnso2d1l0a211k", + "text": "Redness", + "language": "%", + "display-or": "????? ??????????", + "options": [ + { + "id": "4cqi6go4pht94kflcif8aq1ssa", + "text": "Is there any redness on the skin over the joint?", + "language": "%", + "display-or": "????? ???? ???? ???????", + "options": [ + { + "id": "7hue873fuuf5hq62t01pn88dfr", + "text": "Yes", + "language": "redness observed around joint", + "display-or": "??" + }, + { + "id": "4c1qo42psti5nt2ehskod5i791", + "text": "No", + "language": "no redness around joint", + "display-or": "???" + }, + { + "id": "ID_1845537441", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "?? ???" + } + ] + } + ] + }, + { + "id": "7j4hr4dsf7t3te9hpam91p8r36", + "text": "Deformity", + "language": "%", + "display-or": "????? ??????????", + "options": [ + { + "id": "6tjhkp7eme15m62clh18ig00id", + "text": "Does the joint appear deformed?", + "language": "%", + "display-or": "????? ?????????? ????????", + "options": [ + { + "id": "1b7hu0rerlq4jq1ph7552nkvod", + "text": "Yes", + "language": "deformity around joint", + "display-or": "??" + }, + { + "id": "0o29b1v4bs20d9n4l4g2n5ffd6", + "text": "No", + "language": "no deformity around joint", + "display-or": "???" + }, + { + "id": "ID_132172140", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "?? ???" + } + ] + } + ] + }, + { + "id": "32s41m6u1rqq5g1872ol22ct3i", + "text": "Tenderness", + "language": "%", + "display-or": "????? ???", + "options": [ + { + "id": "3fthifbu0va74st1hf7uhof7lk", + "text": "Feel the joint on all sides and look for tenderness", + "language": "%", + "display-or": "????? ?? ?????? ??? ???????????", + "options": [ + { + "id": "7frcokaaec3b45o3c0pog2nkrv", + "text": "Yes", + "language": "tenderness seen", + "display-or": "??" + }, + { + "id": "0vcqd99cmo9f57cbu8u20j2ee8", + "text": "No", + "language": "non-tender", + "display-or": "???" + }, + { + "id": "ID_880026668", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "?? ???" + } + ] + } + ] + }, + { + "id": "7vkb9bulgdnmhc7pktl8dg45p0", + "text": "Movement Pain", + "language": "%", + "display-or": "???? ?? ????? ????", + "options": [ + { + "id": "5dinhlria692hqhmee61588t5v", + "text": "Move the joint through its normal range and are there pain at any point?", + "language": "%", + "display-or": "????? ? ????? ??? ???? ????? ???", + "options": [ + { + "id": "3gdb15d522q6sdfdbtlnbr97gu", + "text": "Yes", + "language": "pain during movement", + "display-or": "??" + }, + { + "id": "22cg7t8tqrtnu8kn9o1oi9i67i", + "text": "No", + "language": "no pain during movement", + "display-or": "???" + }, + { + "id": "ID_1515587880", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "?? ???" + } + ] + } + ] + }, + { + "id": "1bh00k3631s2i8sigv2e0eakvt", + "text": "Movement range", + "language": "%", + "display-or": "???????????? ??????", + "options": [ + { + "id": "1i3lu7rrv9b0uho2o96v964tm6", + "text": "Is full range of movement present?", + "language": "%", + "display-or": "????? ?????? ??????? ?????", + "options": [ + { + "id": "6nubtkl0t9i8cua837uu1f6nuk", + "text": "Yes", + "language": "full range of movement is seen", + "display-or": "??" + }, + { + "id": "5gkkmjag787qnjoq8s0mp8csrv", + "text": "No", + "language": "range of movement is restricted", + "display-or": "???" + }, + { + "id": "ID_1859080464", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "?? ???" + } + ] + } + ] + } + ] + }, + { + "id": "6o3orbls1q04f07cv7nf8sfcps", + "text": "Any Location", + "language": "Any location:", + "display-or": "???????? ????", + "options": [ + { + "id": "34vqigq1rri15t22qoe2btkume", + "text": "Skin Rash", + "language": "Skin Rash:", + "display-or": "??????? ?????", + "options": [ + { + "id": "2bla4uvbpp2fv6ojnfenjodqul", + "text": "Is there any rash?", + "language": "%", + "display-or": "?????? ???? ????? ??? ???", + "options": [ + { + "id": "589u54qk7l2u9hed63drg8akgk", + "text": "Yes", + "language": "rash seen", + "display-or": "??", + "options": [ + { + "id": "4pap5bnnkpfphml5lffvghpi1c", + "text": "How many rashes are there?", + "language": "%", + "display-or": "???? ??????", + "options": [ + { + "id": "0lv2li905er00qodi01rs6oigu", + "text": "Enter number", + "input-type": "number", + "language": "No. of rashes", + "display-or": "?????? ???" + } + ] + }, + { + "id": "7q5r86eu50k1d369k63i6plh4t", + "text": "How is the surface of the rash?", + "language": "%", + "display-or": "??? ?????? ???", + "options": [ + { + "id": "2ts8gtpb4h158fce5g78o59mm1", + "text": "Smooth", + "language": "surface is smooth", + "display-or": "????" + }, + { + "id": "2iarl1gqhk08f3qpulihr1l4j5", + "text": "Rough", + "language": "surface is irregular", + "display-or": "??????????" + } + ] + }, + { + "id": "1lpin3jjkc2u0tuqom8spshbqd", + "text": "What is the colour of the rash?", + "language": "%", + "display-or": "???? ??????", + "options": [ + { + "id": "4ctvh2ga00p2qm33koijd1f18u", + "text": "Describe", + "input-type": "text", + "language": "Colour of the rash", + "display-or": "?????? ??" + } + ] + }, + { + "id": "ID_907152865", + "text": "Is the rash on the palms and soles?", + "language": "%", + "display-or": "??? ? ??????", + "options": [ + { + "id": "ID_1524644195", + "text": "Yes", + "language": "rash present on palms and soles", + "display-or": "??" + }, + { + "id": "ID_1041474623", + "text": "No", + "language": "rash not present on palms and soles", + "display-or": "???" + } + ] + }, + { + "id": "ID_1174246731", + "text": "Is there dry, dead skin that appears to be falling off?", + "language": "%", + "display-or": "?????", + "options": [ + { + "id": "ID_599631097", + "text": "Yes", + "language": "skin appears to be dead, dry or peeling off (eschar seen)", + "display-or": "??" + }, + { + "id": "ID_128832798", + "text": "No", + "language": "no eschar", + "display-or": "???" + } + ] + } + ] + }, + { + "id": "55d0k2iookm3bedg3vjkptmhco", + "text": "No", + "language": "no rash", + "display-or": "???" + }, + { + "id": "ID_1918521940", + "text": "Put a ruler next to the rash and take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "????? ???? ?????? ???? ??? ???? ???" + } + ] + } + ] + }, + { + "id": "ID_111711492", + "text": "Skin Bruise", + "language": "Skin Bruise:", + "display-or": "???? ?? ??? ?? ?????", + "options": [ + { + "id": "ID_1536234608", + "text": "Are there bruises? If yes, take a picture", + "language": "%", + "display-or": "???? ???? ?? ?? ????? ??? ??? ??? ?? ???", + "options": [ + { + "id": "ID_1163933268", + "text": "Yes", + "language": "bruises seen", + "display-or": "??", + "options": [ + { + "id": "ID_255586404", + "text": "How many?", + "language": "%", + "display-or": "???? ??", + "options": [ + { + "id": "ID_1158378356", + "text": "Enter number of bruises", + "input-type": "number", + "language": "No. of bruises", + "display-or": "???? ??" + } + ] + } + ] + }, + { + "id": "ID_1336289065", + "text": "No", + "language": "no bruises seen", + "display-or": "???" + }, + { + "id": "ID_983168251", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "?? ???" + } + ] + } + ] + }, + { + "id": "ID_1749120040", + "text": "Injury Discolouration", + "language": "Injury discolouration:", + "display-or": "?????? ????", + "options": [ + { + "id": "27dbrb51lp0aa5a74bgupicelh", + "text": "Is there any discoloured area?", + "language": "%", + "display-or": "???? ?????????? ????? ?? ?", + "options": [ + { + "id": "6r3lmbl4ua2bc4ik5lthrlt398", + "text": "Yes", + "language": "discolouration seen", + "display-or": "??" + }, + { + "id": "0hnmvcshh7c39gn40uv2ahvaaq", + "text": "No", + "language": "no discolouration seen", + "display-or": "???" + }, + { + "id": "ID_860168656", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "?? ???" + } + ] + } + ] + }, + { + "id": "5ppf2cn408f2psn455srhlh77j", + "text": "Injury Cut", + "language": "Injury cut:", + "display-or": "???? ?? ????", + "options": [ + { + "id": "7jr2vgc8f4agke58mdj3uo85p1", + "text": "Is there any cut?", + "language": "%", + "display-or": "???? ????? ??? ???", + "options": [ + { + "id": "69je855af2lbv9dh46a5ek9hid", + "text": "Yes", + "language": "skin cut seen", + "display-or": "??" + }, + { + "id": "1si0aalh00f7pi7trm5i71pjms", + "text": "No", + "language": "no skin cut", + "display-or": "???" + }, + { + "id": "ID_1623868209", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "?? ???" + } + ] + } + ] + }, + { + "id": "39pfoj2pvmjl37j941bl78gm87", + "text": "Injury Abrasion", + "language": "Injury abrasion:", + "display-or": "????? ???????", + "options": [ + { + "id": "1d3gb6ub23obtvhf1gkp7lukhv", + "text": "Is there any abrasion?", + "language": "%", + "display-or": "??? ???? ??????? ???", + "options": [ + { + "id": "27evgnahjmv73l5q867jb1vmi5", + "text": "Yes", + "language": "abrasion seen", + "display-or": "??" + }, + { + "id": "2nb52of6a4u3hpp6k4no5jqgph", + "text": "No", + "language": "no abrasion", + "display-or": "???" + }, + { + "id": "ID_1829148837", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "?? ???" + } + ] + } + ] + }, + { + "id": "0li81lki3l7qgdob8n28djl6d1", + "text": "Ulcer", + "language": "Ulcer:", + "display-or": "??", + "options": [ + { + "id": "0fv1oqmiciu8rrk03jvc0vf1s1", + "text": "Is there an ulcer?", + "language": "%", + "display-or": "?? ??????? ?", + "options": [ + { + "id": "02pvjpospai94ppnvucipe41ig", + "text": "Yes", + "language": "ulcer seen", + "display-or": "??", + "options": [ + { + "id": "53c44bred47fth5l5mka20nrhg", + "text": "Put a ruler next to the ulcer and estimate its size", + "language": "%", + "display-or": "????? ?? ?? ? ??? ???", + "options": [ + { + "id": "2v1m35qrajbajt80rtgrrt280l", + "text": "Enter size in cm x cm", + "input-type": "area", + "language": "size of ulcer", + "display-or": "????? ??? (cm ??)" + } + ] + }, + { + "id": "02ph9ohp70g24tnl435ai208pg", + "text": "Is there any discharge?", + "language": "Discharge", + "display-or": "???? ??????? ?? ?", + "options": [ + { + "id": "ID_412588416", + "text": "No discharge", + "display-or": "?????? ?????" + }, + { + "id": "22c8uusl7qkiuk8ljlga5pfm8v", + "text": "Pus", + "display-or": "???" + }, + { + "id": "5s9ke64t9oifo0uk0fk32ko9vi", + "text": "blood", + "display-or": "????" + }, + { + "id": "5p38tbvokndkamgmnt54lqrk0a", + "text": "mixed blood and pus", + "display-or": "????" + }, + { + "id": "20duhp97dl8tf00ogrt7ns8f5v", + "text": "thin discharge", + "display-or": "????" + } + ] + }, + { + "id": "73ucsmcmf6k499285r1sqbt362", + "text": "What is the colour of the surface?", + "language": "Colour of the surface is", + "display-or": "???? ?????????? ????? ?? ?", + "options": [ + { + "id": "6jtmkaeaencqjpbrs3adl5o6ql", + "text": "Clean", + "display-or": "???" + }, + { + "id": "05bodpk8i80k9numdlm6qnl7cd", + "text": "Dirty", + "display-or": "?????" + }, + { + "id": "1sccnq9qeloi6ifuati0vh253k", + "text": "Pink", + "display-or": "??????" + }, + { + "id": "3qjvivl83sg5h6pt8bgvnlht7h", + "text": "Black", + "display-or": "???" + }, + { + "id": "434uaf0v8qgp14jqeckdsgv6qd", + "text": "Green", + "display-or": "????" + }, + { + "id": "3at4cf3j8kjfbotfirbc34sg2m", + "text": "Mixed", + "display-or": "????????" + } + ] + }, + { + "id": "3ka259e4gg3ta4hoqrdjkoapvf", + "text": "What is the edge like?", + "language": "Edge of the ulcer is", + "display-or": "??? ????? ??????????", + "options": [ + { + "id": "38d2pm4eu9tcfd5vq4oc9qdvvb", + "text": "flat with ulcer surface", + "display-or": "?? ?? ????" + }, + { + "id": "7fs6ejakafvelafld9dacaginu", + "text": "raised from ulcer", + "display-or": "?? ???? ????? ???" + } + ] + } + ] + }, + { + "id": "59nb92ovmpta94vja2iinh6svg", + "text": "No", + "language": "no ulcer", + "display-or": "???" + }, + { + "id": "ID_189445601", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "?? ???" + } + ] + } + ] + }, + { + "id": "5mcqteh5srhqk4gt7g9ajf14n2", + "text": "Boils", + "language": "Boils:", + "display-or": "??", + "options": [ + { + "id": "5mvingjmvaltgiutbp7rkm15a1", + "text": "Are there boils?", + "language": "%", + "display-or": "?? ????? ???", + "options": [ + { + "id": "5lqnh30vm6fj52g1811i90ffgo", + "text": "Yes", + "language": "boils seen", + "display-or": "??", + "options": [ + { + "id": "ID_81500472", + "text": "Put a ruler next to the ulcer and estimate its size", + "language": "%", + "display-or": "????? ?? ?? ? ??? ???", + "options": [ + { + "id": "ID_791818605", + "text": "Enter size in cm x cm", + "input-type": "area", + "language": "size of ulcer", + "display-or": "????? ??? (cm ??)" + } + ] + }, + { + "id": "42355536t2q70svss969f2j08k", + "text": "Is there any discharge?", + "language": "%", + "display-or": "???? ???????? ???", + "options": [ + { + "id": "ID_1069893571", + "text": "No discharge", + "display-or": "?????? ?????" + }, + { + "id": "ID_1807366232", + "text": "Pus", + "display-or": "???" + }, + { + "id": "ID_840730493", + "text": "blood", + "display-or": "????" + }, + { + "id": "ID_1466984919", + "text": "mixed blood and pus", + "display-or": "????" + }, + { + "id": "ID_1433039925", + "text": "thin discharge", + "display-or": "????" + } + ] + }, + { + "id": "1ic1278mhtt40hsm7cevbj7v8f", + "text": "What is the colour of skin over the boil?", + "language": "%", + "display-or": "?? ??? ????", + "options": [ + { + "id": "0h4dektbegfs2effept78ist2g", + "text": "Red", + "language": "Skin over the boil looks red", + "display-or": "????" + }, + { + "id": "5aceeph8rjeddkmcf94bvg0709", + "text": "Normal", + "language": "Skin over the boil looks normal", + "display-or": "???? ???" + } + ] + }, + { + "id": "58e8cdlhlqpl0uh5j2e40gvt9s", + "text": "What is the edge like?", + "language": "edge is", + "display-or": "??? ????? ?????????", + "options": [ + { + "id": "5sqih9mnkjbp5s1q7u0aapb41l", + "text": "flat with boil surface", + "display-or": "?? ?? ????" + }, + { + "id": "16keptqbnb2fplft0v6a6s4gq8", + "text": "raised from boil", + "display-or": "?? ????" + } + ] + } + ] + }, + { + "id": "5ghsl8ilvbkk9v7qcbeq98tnqd", + "text": "No", + "language": "no boils", + "display-or": "???" + }, + { + "id": "ID_656972133", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "?? ???" + } + ] + } + ] + }, + { + "id": "ID_1656343876", + "text": "Burn", + "language": "Burns:", + "display-or": "????", + "options": [ + { + "id": "ID_719160856", + "text": "Is there a burn? If yes, take a picture", + "language": "%", + "display-or": "???? ???? ?? ???? ????? ??? ??? ??? ?? ???", + "options": [ + { + "id": "ID_1675617420", + "text": "Yes", + "language": "burn seen", + "display-or": "??", + "options": [ + { + "id": "ID_320536498", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "?? ???" + }, + { + "id": "ID_147415043", + "text": "Are there blisters?", + "language": "%", + "display-or": "??? ??? ???", + "options": [ + { + "id": "ID_1069331692", + "text": "Yes", + "language": "blisters present", + "display-or": "??" + }, + { + "id": "ID_555975713", + "text": "No", + "language": "no blisters present", + "display-or": "??" + } + ] + }, + { + "id": "ID_401443840", + "text": "What is the colour of the skin over the burn?", + "language": "%", + "display-or": "???? ???? ?? ??? ???? ?????? ???", + "options": [ + { + "id": "ID_409059360", + "text": "Red", + "language": "skin over the burn is red", + "display-or": "???" + }, + { + "id": "ID_1007685774", + "text": "White", + "language": "skin over the burn is white", + "display-or": "???" + }, + { + "id": "ID_1929663883", + "text": "Black", + "language": "skin over the burn is black", + "display-or": "???" + } + ] + }, + { + "id": "ID_36521679", + "text": "Does blanching of the skin occur when it is lightly pressed?", + "language": "%", + "display-or": "???? ?????? ??? ??? ???? ????? ???", + "options": [ + { + "id": "ID_1025144299", + "text": "Yes", + "language": "blanching of skin occurs when it is lightly pressed", + "display-or": "??" + }, + { + "id": "ID_453851935", + "text": "No", + "language": "no blanching of the skin occurs when it is lightly pressed", + "display-or": "??" + } + ] + }, + { + "id": "ID_874737723", + "text": "Is there dry, dead skin that appears to be falling off over the burn sites?", + "language": "%", + "display-or": "???? ???? ?? ?????? ?????? ??? ???? ??? ???", + "options": [ + { + "id": "ID_1512204949", + "text": "Yes", + "language": "eschar present over the burn sites", + "display-or": "??" + }, + { + "id": "ID_1920887878", + "text": "No", + "language": "no eschar present over the burn sites", + "display-or": "??" + } + ] + }, + { + "id": "ID_1624426837", + "text": "Where is the burn?", + "language": "location of burn", + "display-or": "???? ???? ???? ????", + "options": [ + { + "id": "ID_1112431131", + "text": "Head", + "display-or": "?????" + }, + { + "id": "ID_638950915", + "text": "Neck", + "display-or": "???" + }, + { + "id": "ID_1095936223", + "text": "Chest", + "display-or": "????" + }, + { + "id": "ID_93371746", + "text": "Abdomen", + "display-or": "???" + }, + { + "id": "ID_555053547", + "text": "Back (upper)", + "display-or": "??? ????" + }, + { + "id": "ID_726155829", + "text": "Back (lower)", + "display-or": "?? ????" + }, + { + "id": "ID_1737522795", + "text": "Leg (Right)", + "display-or": "????? ???" + }, + { + "id": "ID_577618069", + "text": "Leg (Left)", + "display-or": "??? ???" + }, + { + "id": "ID_1133152393", + "text": "Arm (Right)", + "display-or": "????? ?????" + }, + { + "id": "ID_1016834319", + "text": "Arm (Left)", + "display-or": "??? ?????" + }, + { + "id": "ID_633927685", + "text": "Genitalia", + "display-or": "????????? ???? ??" + }, + { + "id": "ID_322832963", + "text": "Other [Describe]", + "input-type": "number", + "language": "%", + "display-or": "???????? (?????? ??)" + } + ] + }, + { + "id": "ID_273636690", + "text": "Put a ruler next to the ulcer and estimate its size", + "language": "%", + "display-or": "????? ?? ?? ? ??? ???", + "options": [ + { + "id": "ID_1674767883", + "text": "Enter size in cm x cm", + "input-type": "area", + "language": "size of ulcer", + "display-or": "????? ??? (cm ??)" + } + ] + } + ] + }, + { + "id": "ID_1201952505", + "text": "No", + "language": "no burn", + "display-or": "???" + }, + { + "id": "ID_147726711", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "?? ???" + } + ] + } + ] + }, + { + "id": "ID_1745964304", + "text": "Lumps", + "language": "Lumps:", + "display-or": "????", + "options": [ + { + "id": "ID_1847908741", + "text": "Are there lumps?", + "language": "%", + "display-or": "???? ???? ?", + "options": [ + { + "id": "ID_1157293613", + "text": "Yes", + "language": "lumps seen", + "display-or": "??", + "options": [ + { + "id": "ID_1058142720", + "text": "Where is it?", + "job-aid-type": "image", + "job-aid-file": "abdominalregions9", + "language": "Location", + "display-or": "???? ???? ??", + "options": [ + { + "id": "ID_1935801557", + "text": "Upper (R) - Right Hypochondrium", + "display-or": "????? ?????" + }, + { + "id": "ID_845387253", + "text": "Upper (C) - Epigastric", + "display-or": "???? ?????" + }, + { + "id": "ID_1036073432", + "text": "Upper (L) - Left Hypochondrium", + "display-or": "??? ?????" + }, + { + "id": "ID_568631554", + "text": "Middle (R) - Right Lumbar", + "display-or": "?????? ???" + }, + { + "id": "ID_962169419", + "text": "Middle (C) - Umbilical", + "display-or": "???? ????????" + }, + { + "id": "ID_1324037145", + "text": "Middle (L) - Left Lumbar", + "display-or": "??? ???" + }, + { + "id": "ID_1239783765", + "text": "Lower (R) - Right Illiac Fossa", + "display-or": "?????? ??" + }, + { + "id": "ID_644410306", + "text": "Lower (C) - Hypogastric/Suprapubic", + "display-or": "???? ????" + }, + { + "id": "ID_562710446", + "text": "Lower (R) - Left Illiac Fossa", + "display-or": "??? ??" + }, + { + "id": "ID_917293565", + "text": "All over", + "display-or": "?????????" + } + ] + }, + { + "id": "ID_923360490", + "text": "How many?", + "language": "%", + "display-or": "?????? ????", + "options": [ + { + "id": "ID_1885607537", + "text": "Enter number of lumps", + "input-type": "number", + "language": "No. of lumps", + "display-or": "???? ??" + } + ] + }, + { + "id": "ID_1674874012", + "text": "What is its shape?", + "language": "%", + "display-or": "?????? ?????????", + "options": [ + { + "id": "ID_66314640", + "text": "Round", + "language": "round in shape", + "display-or": "???????" + }, + { + "id": "ID_577096038", + "text": "Irregular", + "language": "irregular in shape", + "display-or": "???????" + } + ] + }, + { + "id": "ID_1016461605", + "text": "How is the surface?", + "language": "%", + "display-or": "??? ?????? ??????", + "options": [ + { + "id": "ID_1834678900", + "text": "Smooth", + "language": "smooth surface", + "display-or": "????" + }, + { + "id": "ID_50938361", + "text": "Irregular", + "language": "irregular surface", + "display-or": "??????????" + } + ] + }, + { + "id": "ID_755823613", + "text": "How does it feel?", + "language": "%", + "display-or": "????? ?????? ??????????", + "options": [ + { + "id": "ID_205997455", + "text": "Hard", + "language": "feels hard", + "display-or": "???" + }, + { + "id": "ID_1622508753", + "text": "Soft", + "language": "feels soft", + "display-or": "???" + }, + { + "id": "ID_1659191837", + "text": "Medium", + "language": "feels medium", + "display-or": "??? ?????" + } + ] + }, + { + "id": "ID_861684184", + "text": "Is it painful?", + "language": "%", + "display-or": "??????? ?? ?????", + "options": [ + { + "id": "ID_1917441256", + "text": "Yes", + "language": "tender", + "display-or": "??" + }, + { + "id": "ID_96959175", + "text": "No", + "language": "not tender", + "display-or": "???" + } + ] + }, + { + "id": "ID_736481497", + "text": "Any change in colour of skin?", + "language": "%", + "display-or": "????? ???? ?????????? ????? ?? ????:", + "options": [ + { + "id": "ID_1366940185", + "text": "Yes", + "language": "skin discolouration observed", + "display-or": "??" + }, + { + "id": "ID_1606240793", + "text": "No", + "language": "no skin discolouration", + "display-or": "???" + } + ] + }, + { + "id": "ID_766757379", + "text": "Any swelling above or below the lump?", + "language": "%", + "display-or": "???? ?? ??? ???? ??????", + "options": [ + { + "id": "ID_79821874", + "text": "Swelling Above", + "language": "swelling observed above lump", + "display-or": "???? ????" + }, + { + "id": "ID_427308946", + "text": "Swelling Below", + "language": "swelling observed below lump", + "display-or": "???? ?? ??" + }, + { + "id": "ID_263821258", + "text": "No Swelling", + "language": "no swelling", + "display-or": "???? ?????" + } + ] + }, + { + "id": "ID_1676132010", + "text": "Is it moving related to adjacent tissues?", + "language": "%", + "display-or": "??? ???? ????? ?? ????? ???", + "options": [ + { + "id": "ID_446798586", + "text": "Lump mobile", + "language": "lump mobile", + "display-or": "??? ????" + }, + { + "id": "ID_1539892741", + "text": "Lump fixed", + "language": "lump fixed", + "display-or": "?????" + } + ] + } + ] + }, + { + "id": "ID_519704332", + "text": "No", + "language": "no lumps", + "display-or": "???" + }, + { + "id": "ID_240247673", + "text": "Take a picture", + "input-type": "camera", + "language": "[picture taken]", + "display-or": "?? ???" + } + ] + } + ] + } + ] + }, + { + "id": "443s6tckt68auclocrhgmu3oak", + "text": "Chest", + "language": "Chest:", + "display-or": "????" + }, + { + "id": "ID_1731331523", + "text": "Physical Growth", + "language": "Physical Growth:", + "display-or": "??????? ??????", + "options": [ + { + "id": "ID_398242924", + "text": "MUAC", + "display-or": "????? ?????", + "options": [ + { + "id": "ID_713016910", + "text": "Measure the Mid-Upper Arm Circumference using MUAC tape in all children 6 months or older", + "language": "%", + "display-or": "????? ????? ??? ??????? ???? ????????", + "options": [ + { + "id": "ID_1527581775", + "text": "Reading 1 (cms)", + "input-type": "number", + "display-or": "????" + }, + { + "id": "ID_7253791", + "text": "Reading 2 (cms)", + "input-type": "number", + "display-or": "????" + }, + { + "id": "ID_126974836", + "text": "Reading 3 (cms)", + "input-type": "number", + "display-or": "????" + } + ] + } + ] + }, + { + "id": "ID_234959031", + "text": "Head circumference", + "display-or": "????? ?????", + "options": [ + { + "id": "ID_955216765", + "text": "Check head circumference for children under 2 years old", + "language": "%", + "display-or": "??? ???? ?? ???? ???????? ?????? ????? ???", + "options": [ + { + "id": "ID_1826595527", + "text": "Reading 1 (cms)", + "input-type": "number", + "display-or": "????" + }, + { + "id": "ID_1918803237", + "text": "Reading 2 (cms)", + "input-type": "number", + "display-or": "????" + }, + { + "id": "ID_903827329", + "text": "Reading 3 (cms)", + "input-type": "number", + "display-or": "????" + } + ] + } + ] + } + ] + }, + { + "id": "ID_1012406340", + "text": "Sick Child", + "language": "General (Child):", + "display-or": "??????? ????", + "options": [ + { + "id": "ID_1737676309", + "text": "Lethargy", + "display-or": "????", + "language": "%", + "options": [ + { + "id": "ID_985717210", + "text": "Does the child appear to have sleepiness or deep unresponsiveness and inactivity?", + "language": "%", + "display-or": "???? ???????? ?????? ?????? ?? ???? ??? ??? ?????", + "options": [ + { + "id": "ID_540044916", + "text": "Yes", + "language": "child appears lethargic", + "display-or": "??" + }, + { + "id": "ID_285880772", + "text": "No", + "language": "child appears normal", + "display-or": "???" + } + ] + } + ] + }, + { + "id": "ID_1645083795", + "text": "Stridor", + "language": "%", + "display-or": "?? ?? ????", + "options": [ + { + "id": "ID_1096191699", + "text": "Does the child make high-pitched or wheezing sound while breathing?", + "language": "%", + "display-or": "?? ??????? ???? ????? ???? ???? ????? ???", + "options": [ + { + "id": "ID_688750682", + "text": "Yes", + "language": "The child makes wheezing sounds while breathing", + "display-or": "??" + }, + { + "id": "ID_1194369032", + "text": "No", + "language": "The child does not make wheezing sounds while breathing", + "display-or": "???" + } + ] + } + ] + } + ] + }, + { + "id": "ID_1605849907", + "text": "Umbilicus", + "language": "Umbilicus (Child):", + "display-or": "????", + "options": [ + { + "id": "ID_734775590", + "text": "Redness", + "display-or": "???? ????", + "language": "%", + "options": [ + { + "id": "ID_1388720177", + "text": "Is there any redness on the umbilicus?", + "language": "%", + "display-or": "???? ???? ????? ??", + "options": [ + { + "id": "ID_367925807", + "text": "Yes", + "language": "umbilicus appears red", + "display-or": "??" + }, + { + "id": "ID_31326722", + "text": "No", + "language": "umbilicus appears normal", + "display-or": "???" + } + ] + } + ] + }, + { + "id": "ID_728234620", + "text": "Discharge", + "display-or": "????? / ????????", + "options": [ + { + "id": "ID_1410387018", + "text": "Is there any discharge?", + "language": "%", + "display-or": "?????? ???? ????? ??", + "options": [ + { + "id": "ID_1771691820", + "text": "Yes", + "display-or": "??", + "language": "discharge seen" + }, + { + "id": "ID_1679510920", + "text": "No", + "display-or": "???", + "language": "no discharge seen" + } + ] + } + ] + }, + { + "id": "ID_1533497046", + "text": "Shape", + "language": "%", + "display-or": "????", + "options": [ + { + "id": "ID_762347474", + "text": "Is the umbilicus flat or everted?", + "language": "umbilicus is", + "display-or": "???? ??? ? ???? ?????", + "options": [ + { + "id": "ID_1872064387", + "text": "Flat", + "language": "umbilicus appears flat", + "display-or": "????" + }, + { + "id": "ID_1066170750", + "text": "Everted", + "language": "umbilicus appears everted", + "display-or": "???? ??" + }, + { + "id": "ID_732598035", + "text": "Normal", + "display-or": "???", + "language": "umbilicus appears normal in shape" + } + ] + } + ] + } + ] + }, + { + "id": "ID_1482587319", + "text": "Arm", + "language": "Arm:", + "display-or": "????", + "options": [ + { + "id": "ID_1169860179", + "text": "Blood Glucose (FBS)", + "display-or": "????? ??????? (???? ??? ?)", + "options": [ + { + "id": "ID_1617400576", + "text": "Measure the patient's blood sugar on an empty stomach (not taken meals for at least 8 hours)", + "language": "%", + "display-or": "???? ??? ?? ???? ? ????? ????? ???. (? ????? ?? ???? ????? ? ???????)", + "options": [ + { + "id": "ID_1112722162", + "text": "Enter value (mmol/L)", + "input-type": "number", + "language": "%", + "display-or": "(?????? ???)" + } + ] + } + ] + }, + { + "id": "ID_533783615", + "text": "Blood Glucose (PP)", + "display-or": "????? ??????? (????? ???)", + "options": [ + { + "id": "ID_540721051", + "text": "Measure the patient's blood sugar after meals", + "language": "%", + "display-or": "????? ??? ???? ? ????? ????? ???", + "options": [ + { + "id": "ID_1960849292", + "text": "Enter value (mmol/L)", + "input-type": "number", + "language": "%", + "display-or": "(?????? ???)" + } + ] + } + ] + }, + { + "id": "ID_469211442", + "text": "Hemoglobin", + "display-or": "???????????", + "options": [ + { + "id": "ID_1396265479", + "text": "Use a digital hemoglobinometer to measure blood hemoglobin", + "language": "%", + "display-or": "??????????? ????", + "options": [ + { + "id": "ID_354200525", + "text": "Enter value", + "input-type": "number", + "language": "%", + "display-or": "(?????? ???)" + } + ] + } + ] + }, + { + "id": "ID_272228552", + "text": "Lying BP", + "display-or": "??? ??? BP ???", + "options": [ + { + "id": "ID_1160349142", + "text": "Take the patient's BP lying down", + "language": "%", + "display-or": "??? ??? ???? ? BP ???", + "options": [ + { + "id": "ID_1262593440", + "text": "Enter systolic BP", + "input-type": "text", + "language": "Systolic:", + "display-or": "Systolic BP ???" + }, + { + "id": "ID_1151021967", + "text": "Enter diastolic BP", + "input-type": "text", + "language": "Diastolic:", + "display-or": "diastolic BP ???" + } + ] + } + ] + }, + { + "id": "ID_1412096751", + "text": "BP Reading 1", + "language": "%", + "display-or": "???? ??? ??? -?", + "options": [ + { + "id": "ID_1808139010", + "text": "Make sure patient has been sitting quietly for 1 min. Then take the patient's BP. ", + "language": "%", + "options": [ + { + "id": "ID_1145413272", + "text": "Enter BP [Systolic/Diastolic]", + "input-type": "text", + "language": "BP:", + "display-or": "(?????????) ???? ??? ??? -?" + }, + { + "id": "ID_1895820162", + "text": "Enter Heart Rate", + "input-type": "text", + "language": "HR:", + "display-or": "???? ??? ??? -?" + } + ] + } + ] + }, + { + "id": "ID_210572794", + "text": "BP Reading 2", + "language": "%", + "display-or": "???? ??? ??? -?", + "options": [ + { + "id": "ID_1556732094", + "text": "Make sure patient has been sitting quietly for 1 min. Then take the patient's BP. ", + "language": "%", + "options": [ + { + "id": "ID_369653170", + "text": "Enter BP [Systolic/Diastolic]", + "input-type": "text", + "language": "BP:", + "display-or": "(?????????) ???? ??? ??? -?" + }, + { + "id": "ID_1385764522", + "text": "Enter Heart Rate", + "input-type": "text", + "language": "HR:", + "display-or": "???? ??? ??? -?" + } + ] + } + ] + }, + { + "id": "ID_867751644", + "text": "BP Reading 3", + "language": "%", + "display-or": "???? ??? ??? -?", + "options": [ + { + "id": "ID_300328091", + "text": "Make sure patient has been sitting quietly for 1 min. Then take the patient's BP. ", + "language": "%", + "options": [ + { + "id": "ID_675189504", + "text": "Enter BP [Systolic/Diastolic]", + "input-type": "text", + "language": "BP:", + "display-or": "(?????????) ???? ??? ??? -?" + }, + { + "id": "ID_1357068902", + "text": "Enter Heart Rate", + "input-type": "text", + "language": "HR:", + "display-or": "???? ??? ??? -?" + } + ] + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/app/src/main/assets/physicalExamAssets/JA1.jpg b/app/src/main/assets/physicalExamAssets/JA1.jpg new file mode 100644 index 0000000000..f54bdd81ec Binary files /dev/null and b/app/src/main/assets/physicalExamAssets/JA1.jpg differ diff --git a/app/src/main/assets/physicalExamAssets/JA2.jpg b/app/src/main/assets/physicalExamAssets/JA2.jpg new file mode 100644 index 0000000000..3486433dbd Binary files /dev/null and b/app/src/main/assets/physicalExamAssets/JA2.jpg differ diff --git a/app/src/main/assets/physicalExamAssets/JA3.jpg b/app/src/main/assets/physicalExamAssets/JA3.jpg new file mode 100644 index 0000000000..68260c2000 Binary files /dev/null and b/app/src/main/assets/physicalExamAssets/JA3.jpg differ diff --git a/app/src/main/assets/physicalExamAssets/abdominalregions9.jpg b/app/src/main/assets/physicalExamAssets/abdominalregions9.jpg new file mode 100644 index 0000000000..bb11965eca Binary files /dev/null and b/app/src/main/assets/physicalExamAssets/abdominalregions9.jpg differ diff --git a/app/src/main/assets/physicalExamAssets/abnormalnails.jpg b/app/src/main/assets/physicalExamAssets/abnormalnails.jpg new file mode 100644 index 0000000000..9e37ae42b7 Binary files /dev/null and b/app/src/main/assets/physicalExamAssets/abnormalnails.jpg differ diff --git a/app/src/main/assets/physicalExamAssets/ankleedemaexample.jpg b/app/src/main/assets/physicalExamAssets/ankleedemaexample.jpg new file mode 100644 index 0000000000..5b94025db2 Binary files /dev/null and b/app/src/main/assets/physicalExamAssets/ankleedemaexample.jpg differ diff --git a/app/src/main/assets/physicalExamAssets/conjunctivaexample.jpg b/app/src/main/assets/physicalExamAssets/conjunctivaexample.jpg new file mode 100644 index 0000000000..cb322f5478 Binary files /dev/null and b/app/src/main/assets/physicalExamAssets/conjunctivaexample.jpg differ diff --git a/app/src/main/assets/physicalExamAssets/jaundiceexample.jpg b/app/src/main/assets/physicalExamAssets/jaundiceexample.jpg new file mode 100644 index 0000000000..7f6d6ec24f Binary files /dev/null and b/app/src/main/assets/physicalExamAssets/jaundiceexample.jpg differ diff --git a/app/src/main/assets/physicalExamAssets/lymphswelling.jpg b/app/src/main/assets/physicalExamAssets/lymphswelling.jpg new file mode 100644 index 0000000000..cf36f629fe Binary files /dev/null and b/app/src/main/assets/physicalExamAssets/lymphswelling.jpg differ diff --git a/app/src/main/assets/physicalExamAssets/thyroidswelling.jpg b/app/src/main/assets/physicalExamAssets/thyroidswelling.jpg new file mode 100644 index 0000000000..4009a945fc Binary files /dev/null and b/app/src/main/assets/physicalExamAssets/thyroidswelling.jpg differ diff --git a/app/src/main/java/io/intelehealth/client/activities/activePatientsActivity/ActivePatientActivity.java b/app/src/main/java/io/intelehealth/client/activities/activePatientsActivity/ActivePatientActivity.java index 2e89bba119..904e5af49e 100644 --- a/app/src/main/java/io/intelehealth/client/activities/activePatientsActivity/ActivePatientActivity.java +++ b/app/src/main/java/io/intelehealth/client/activities/activePatientsActivity/ActivePatientActivity.java @@ -14,32 +14,23 @@ import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.support.v7.widget.Toolbar; -import android.util.Log; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; -import android.widget.Button; import android.widget.TextView; import com.crashlytics.android.Crashlytics; -import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; -import java.util.HashSet; import java.util.List; import io.intelehealth.client.R; import io.intelehealth.client.activities.homeActivity.HomeActivity; -import io.intelehealth.client.database.InteleHealthDatabaseHelper; -import io.intelehealth.client.database.dao.EncounterDAO; -import io.intelehealth.client.database.dao.ImagesDAO; +import io.intelehealth.client.app.AppConstants; import io.intelehealth.client.database.dao.ProviderDAO; -import io.intelehealth.client.database.dao.VisitsDAO; import io.intelehealth.client.models.ActivePatientModel; -import io.intelehealth.client.models.dto.EncounterDTO; -import io.intelehealth.client.models.dto.VisitDTO; import io.intelehealth.client.utilities.Logger; import io.intelehealth.client.utilities.SessionManager; import io.intelehealth.client.utilities.StringUtils; @@ -47,7 +38,6 @@ public class ActivePatientActivity extends AppCompatActivity { private static final String TAG = ActivePatientActivity.class.getSimpleName(); - InteleHealthDatabaseHelper mDbHelper; private SQLiteDatabase db; SessionManager sessionManager = null; Toolbar mToolbar; @@ -56,10 +46,6 @@ public class ActivePatientActivity extends AppCompatActivity { RecyclerView recyclerView; AlertDialog.Builder dialogBuilder; - private ArrayList listPatientUUID = new ArrayList(); - public static int index = -1; - public static int top = -1; - @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -81,59 +67,12 @@ protected void onCreate(Bundle savedInstanceState) { textView = findViewById(R.id.textviewmessage); recyclerView = findViewById(R.id.today_patient_recycler_view); sessionManager = new SessionManager(this); - mDbHelper = new InteleHealthDatabaseHelper(this); - db = mDbHelper.getWritableDatabase(); - - getVisits(); - + db = AppConstants.inteleHealthDatabaseHelper.getWriteDb(); if (sessionManager.isPullSyncFinished()) { textView.setVisibility(View.GONE); recyclerView.setVisibility(View.VISIBLE); doQuery(); } - - } - - private void getVisits() { - - ArrayList encounterVisitUUID = new ArrayList(); - HashSet hsPatientUUID = new HashSet(); - - //Get all Visits - VisitsDAO visitsDAO = new VisitsDAO(); - List visitsDTOList = visitsDAO.getAllVisits(); - - //Get all Encounters - EncounterDAO encounterDAO = new EncounterDAO(); - List encounterDTOList = encounterDAO.getAllEncounters(); - - //Get Visit Note Encounters only, visit note encounter id - d7151f82-c1f3-4152-a605-2f9ea7414a79 - if (encounterDTOList.size() > 0) { - for (int i = 0; i < encounterDTOList.size(); i++) { - if (encounterDTOList.get(i).getEncounterTypeUuid().equalsIgnoreCase("d7151f82-c1f3-4152-a605-2f9ea7414a79")) { - encounterVisitUUID.add(encounterDTOList.get(i).getVisituuid()); - } - } - } - - //Get patientUUID from visitList - for (int i = 0; i < encounterVisitUUID.size(); i++) { - - for (int j = 0; j < visitsDTOList.size(); j++) { - - if (encounterVisitUUID.get(i).equalsIgnoreCase(visitsDTOList.get(j).getUuid())) { - listPatientUUID.add(visitsDTOList.get(j).getPatientuuid()); - } - } - } - - if (listPatientUUID.size() > 0) { - - hsPatientUUID.addAll(listPatientUUID); - listPatientUUID.clear(); - listPatientUUID.addAll(hsPatientUUID); - - } } /** @@ -144,24 +83,10 @@ private void getVisits() { private void doQuery() { List activePatientList = new ArrayList<>(); Date cDate = new Date(); - String currentDate = new SimpleDateFormat("yyyy-MM-dd").format(cDate); - String query = -// "SELECT tbl_visit.uuid, tbl_visit.patientuuid, tbl_visit.startdate, tbl_visit.enddate," + -// "tbl_patient.first_name, tbl_patient.middle_name, tbl_patient.last_name, " + -// "tbl_patient.date_of_birth,tbl_patient.openmrs_id,a.value AS phone_number " + -// "FROM tbl_visit, tbl_patient, tbl_patient_attribute a " + -// "WHERE tbl_visit.patientuuid = tbl_patient.uuid " + -// "AND tbl_visit.enddate IS NULL " + -// "AND a.patientuuid=tbl_patient.uuid and a.person_attribute_type_uuid='14d4f066-15f5-102d-96e4-000c29c2a5d7' " + -// "OR tbl_visit.enddate = '' " + -// "ORDER BY tbl_visit.startdate ASC"; -// - "SELECT a.uuid, a.patientuuid, a.startdate, a.enddate, b.first_name, b.middle_name, b.last_name, b.date_of_birth,b.openmrs_id " + + String query = "SELECT a.uuid, a.patientuuid, a.startdate, a.enddate, b.first_name, b.middle_name, b.last_name, b.date_of_birth,b.openmrs_id " + "FROM tbl_visit a, tbl_patient b " + "WHERE a.patientuuid = b.uuid " + "AND a.enddate is NULL OR a.enddate='' GROUP BY a.uuid ORDER BY a.startdate ASC"; - // "SELECT * FROM visit, patient WHERE visit.patient_id = patient._id AND visit.start_datetime LIKE '" + currentDate + "T%'"; -// Logger.logD(TAG, query); final Cursor cursor = db.rawQuery(query, null); if (cursor != null) { @@ -186,15 +111,16 @@ private void doQuery() { } while (cursor.moveToNext()); } } - cursor.close(); + if (cursor != null) { + cursor.close(); + } if (!activePatientList.isEmpty()) { for (ActivePatientModel activePatientModel : activePatientList) Logger.logD(TAG, activePatientModel.getFirst_name() + " " + activePatientModel.getLast_name()); - ActivePatientAdapter mActivePatientAdapter = new ActivePatientAdapter(activePatientList, ActivePatientActivity.this, listPatientUUID); + ActivePatientAdapter mActivePatientAdapter = new ActivePatientAdapter(activePatientList, ActivePatientActivity.this); LinearLayoutManager linearLayoutManager = new LinearLayoutManager(ActivePatientActivity.this); - recyclerView.setHasFixedSize(true); recyclerView.setLayoutManager(linearLayoutManager); recyclerView.addItemDecoration(new DividerItemDecoration(this, @@ -222,10 +148,8 @@ public boolean onOptionsItemSelected(MenuItem item) { endAllVisit(); case R.id.action_filter: - //alert box. - displaySingleSelectionDialog(); //function call - - + //function call + displaySingleSelectionDialog(); default: return super.onOptionsItemSelected(item); } @@ -234,17 +158,6 @@ public boolean onOptionsItemSelected(MenuItem item) { private void displaySingleSelectionDialog() { - /* View checkBoxView = View.inflate(this, R.layout.checkbox_view, null); - CheckBox checkBox = (CheckBox) checkBoxView.findViewById(R.id.checkbox); - checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { - - @Override - public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { - - // Save to shared preferences - } - }); - checkBox.setText("Text to the right of the check box.");*/ ProviderDAO providerDAO = new ProviderDAO(); ArrayList selectedItems = new ArrayList<>(); String[] creator_names = null; @@ -255,10 +168,8 @@ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { } catch (DAOException e) { e.printStackTrace(); } -// boolean[] checkedItems = {false, false, false, false}; - // ngo_numbers = getResources().getStringArray(R.array.ngo_numbers); dialogBuilder = new AlertDialog.Builder(ActivePatientActivity.this); - dialogBuilder.setTitle("Filter by creator"); + dialogBuilder.setTitle("Filter by Creator"); String[] finalCreator_names = creator_names; String[] finalCreator_uuid = creator_uuid; @@ -286,45 +197,11 @@ public void onClick(DialogInterface dialogInterface, int i) { //display filter query code on list menu Logger.logD(TAG, "onclick" + i); doQueryWithProviders(selectedItems); -// select distinct a.uuid,c.first_name,c.middle_name,c.last_name,c.openmrs_id,c.phone_number,c.date_of_birth from tbl_visit a,tbl_encounter b ,tbl_patient c where b.visituuid=a.uuid and b.provider_uuid in ('163b48e5-26fb-40c1-8d94-a6c873dd2869') and a.patientuuid=c.uuid and a.enddate is null order by c.first_name } }); dialogBuilder.setNegativeButton("Cancel", null); - //dialogBuilder.setView(checkBoxView); - //dialogBuilder.setIcon(R.drawable.ic_sort_white_24dp); - // dialogBuilder.setItems(creator_names, new DialogInterface.OnClickListener() { - // @Override - // public void onClick(DialogInterface dialog, int which) { - // the user clicked on colors[which] - /* final String a = "tel:"+"9769025715"; - final String b = "tel:"+"7304154312"; - - if("Team 1".equals(ngo_numbers[which])) - { - Intent i = new Intent(Intent.ACTION_DIAL, Uri.parse(a)); - i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - getApplicationContext().startActivity(i); - } - - else if("Team 2".equals(ngo_numbers[which])) - { - Intent i = new Intent(Intent.ACTION_DIAL, Uri.parse(b)); - i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - getApplicationContext().startActivity(i); - }*/ - // } - // }); - // dialogBuilder.show(); - AlertDialog alertDialog = dialogBuilder.create(); - alertDialog.show(); - - Button positiveButton = alertDialog.getButton(android.app.AlertDialog.BUTTON_POSITIVE); - positiveButton.setTextColor(getResources().getColor(R.color.colorPrimary)); - - Button negativeButton = alertDialog.getButton(android.app.AlertDialog.BUTTON_NEGATIVE); - negativeButton.setTextColor(getResources().getColor(R.color.colorPrimary)); - + dialogBuilder.show(); } @@ -381,25 +258,10 @@ private boolean endVisit(String patientUuid, String patientName, String visitUUI private void doQueryWithProviders(List providersuuids) { List activePatientList = new ArrayList<>(); - String query = -// "select distinct a.uuid,c.uuid AS patientuuid,a.startdate AS startdate,a.enddate AS enddate," + -// "c.first_name,c.middle_name,c.last_name,c.openmrs_id,c.phone_number,c.date_of_birth " + -// "from tbl_visit a,tbl_encounter b ,tbl_patient c " + -// "where b.visituuid=a.uuid and b.provider_uuid in ('" + StringUtils.convertUsingStringBuilder(providersuuids) + "') " + -// "and a.patientuuid=c.uuid and a.enddate is null OR a.enddate='' order by a.startdate ASC"; - - "select distinct a.uuid,c.uuid AS patientuuid,a.startdate AS startdate,a.enddate AS enddate, c.first_name,c.middle_name,c.last_name,c.openmrs_id,c.date_of_birth " + + String query = "select distinct a.uuid,c.uuid AS patientuuid,a.startdate AS startdate,a.enddate AS enddate, c.first_name,c.middle_name,c.last_name,c.openmrs_id,c.date_of_birth " + "from tbl_visit a,tbl_encounter b ,tbl_patient c " + "where b.visituuid=a.uuid and b.provider_uuid in ('" + StringUtils.convertUsingStringBuilder(providersuuids) + "') " + "and a.patientuuid=c.uuid and (a.enddate is null OR a.enddate='') order by a.startdate ASC"; - -// "SELECT tbl_visit.uuid, tbl_visit.patientuuid, tbl_visit.startdate, tbl_visit.enddate," + -// "tbl_patient.first_name, tbl_patient.middle_name, tbl_patient.last_name, " + -// "tbl_patient.date_of_birth,tbl_patient.openmrs_id,tbl_patient.phone_number FROM tbl_visit, tbl_patient WHERE tbl_visit.patientuuid = tbl_patient.uuid " + -// "AND tbl_visit.enddate IS NULL " + -// "OR tbl_visit.enddate = '' " + -// "ORDER BY tbl_visit.startdate ASC"; - // "SELECT * FROM visit, patient WHERE visit.patient_id = patient._id AND visit.start_datetime LIKE '" + currentDate + "T%'"; Logger.logD(TAG, query); final Cursor cursor = db.rawQuery(query, null); @@ -425,13 +287,15 @@ private void doQueryWithProviders(List providersuuids) { } while (cursor.moveToNext()); } } - cursor.close(); + if (cursor != null) { + cursor.close(); + } if (!activePatientList.isEmpty()) { for (ActivePatientModel activePatientModel : activePatientList) Logger.logD(TAG, activePatientModel.getFirst_name() + " " + activePatientModel.getLast_name()); - ActivePatientAdapter mActivePatientAdapter = new ActivePatientAdapter(activePatientList, ActivePatientActivity.this, listPatientUUID); + ActivePatientAdapter mActivePatientAdapter = new ActivePatientAdapter(activePatientList, ActivePatientActivity.this); LinearLayoutManager linearLayoutManager = new LinearLayoutManager(ActivePatientActivity.this); recyclerView.setLayoutManager(linearLayoutManager); recyclerView.addItemDecoration(new diff --git a/app/src/main/java/io/intelehealth/client/activities/activePatientsActivity/ActivePatientAdapter.java b/app/src/main/java/io/intelehealth/client/activities/activePatientsActivity/ActivePatientAdapter.java index 43d6a1b8ac..5a5535c8a8 100644 --- a/app/src/main/java/io/intelehealth/client/activities/activePatientsActivity/ActivePatientAdapter.java +++ b/app/src/main/java/io/intelehealth/client/activities/activePatientsActivity/ActivePatientAdapter.java @@ -2,29 +2,19 @@ import android.content.Context; import android.content.Intent; -import android.database.sqlite.SQLiteDatabase; import android.graphics.Color; -import android.support.v4.content.ContextCompat; -import android.support.v4.graphics.drawable.DrawableCompat; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import android.widget.ImageView; import android.widget.TextView; -import android.widget.Toast; -import java.util.ArrayList; import java.util.List; import io.intelehealth.client.R; import io.intelehealth.client.activities.patientDetailActivity.PatientDetailActivity; -import io.intelehealth.client.database.InteleHealthDatabaseHelper; -import io.intelehealth.client.database.dao.ImagesDAO; -import io.intelehealth.client.database.dao.VisitsDAO; import io.intelehealth.client.models.ActivePatientModel; import io.intelehealth.client.utilities.DateAndTimeUtils; -import io.intelehealth.client.utilities.exception.DAOException; /** * Created by Dexter Barretto on 5/20/17. @@ -36,12 +26,10 @@ public class ActivePatientAdapter extends RecyclerView.Adapter activePatientModels; Context context; LayoutInflater layoutInflater; - ArrayList listPatientUUID; - public ActivePatientAdapter(List activePatientModels, Context context, ArrayList _listPatientUUID) { + public ActivePatientAdapter(List activePatientModels, Context context) { this.activePatientModels = activePatientModels; this.context = context; - this.listPatientUUID = _listPatientUUID; } @Override @@ -52,7 +40,6 @@ public ActivePatientViewHolder onCreateViewHolder(ViewGroup parent, int viewType LayoutInflater inflater = LayoutInflater.from(parent.getContext()); View row = inflater.inflate(R.layout.list_item_active_patient, parent, false); ActivePatientViewHolder viewHolder = new ActivePatientViewHolder(row); -// ListItemActivePatientBinding listItemActivePatientBinding= DataBindingUtil.inflate(layoutInflater,R.layout.list_item_active_patient,parent,false); return viewHolder; } @@ -61,7 +48,7 @@ public void onBindViewHolder(ActivePatientViewHolder holder, int position) { final ActivePatientModel activePatientModel = activePatientModels.get(position); String header; if (activePatientModel.getOpenmrs_id() != null) { - header = String.format("%s %s, %s", activePatientModel.getFirst_name(), + header = String.format("%s %s - " + context.getString(R.string.visit_summary_heading_id) + ": %s", activePatientModel.getFirst_name(), activePatientModel.getLast_name(), activePatientModel.getOpenmrs_id()); } else { header = String.format("%s %s", activePatientModel.getFirst_name(), @@ -69,42 +56,21 @@ public void onBindViewHolder(ActivePatientViewHolder holder, int position) { } int age = DateAndTimeUtils.getAge(activePatientModel.getDate_of_birth()); String dob = DateAndTimeUtils.SimpleDatetoLongDate(activePatientModel.getDate_of_birth()); - String body = String.format(context.getString(R.string.identification_screen_prompt_age) + " %d yrs", age); + String body = String.format(context.getString(R.string.id_number) + ": %s \n " + + context.getString(R.string.identification_screen_prompt_phone_number) + ": %s\n" + + context.getString(R.string.identification_screen_prompt_birthday) + + ": %s (" + context.getString(R.string.identification_screen_prompt_age) + " %d)", activePatientModel.getOpenmrs_id(), activePatientModel.getPhone_number(), + dob, age); -// holder.listItemActivePatientBinding.listItemHeadTextView.setText(header); -// holder.listItemActivePatientBinding.listItemBodyTextView.setText(body); holder.getHeadTextView().setText(header); holder.getBodyTextView().setText(body); if (activePatientModel.getEnddate() == null) { - /* Drawable drawable = DrawableHelper - .withContext(context) - //TODO: Dummy color. Change color before release. - .withColor(R.color.green) - .withDrawable(R.drawable.circle) - .tint() - .get(); - holder.getIndicatorImageView().setImageDrawable(drawable);*/ - holder.getIndicatorTextView().setText("Active"); holder.getIndicatorTextView().setBackgroundColor(Color.GREEN); -// holder.listItemActivePatientBinding.listItemIndicatorTextView.setText("Active"); -// holder.listItemActivePatientBinding.listItemIndicatorTextView.setBackgroundColor(Color.GREEN); } else { - /* Drawable drawable = DrawableHelper - .withContext(context) - //TODO: Dummy color. Change color before release. - .withColor(R.color.red) - .withDrawable(R.drawable.circle) - .tint() - .get(); - holder.getIndicatorImageView().setImageDrawable(drawable); - */ holder.getIndicatorTextView().setText("Closed"); holder.getIndicatorTextView().setBackgroundColor(Color.RED); -// holder.listItemActivePatientBinding.listItemIndicatorTextView.setText("Closed"); -// holder.listItemActivePatientBinding.listItemIndicatorTextView.setBackgroundColor(Color.RED); } -// holder.getRootView().setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { @@ -113,40 +79,11 @@ public void onClick(View v) { intent.putExtra("patientUuid", activePatientModel.getPatientuuid()); intent.putExtra("status", patientStatus); intent.putExtra("tag", ""); - - if (holder.ivPriscription.getTag().equals("1")) { - intent.putExtra("hasPrescription", "true"); - } else { - intent.putExtra("hasPrescription", "false"); - } context.startActivity(intent); } }); -// holder.listItemActivePatientBinding.getRoot().setOnClickListener(new View.OnClickListener() { -// @Override -// public void onClick(View v) { -// String patientStatus = "returning"; -// Intent intent = new Intent(context, PatientDetailActivity.class); -// intent.putExtra("patientUuid", activePatientModel.getPatientuuid()); -// intent.putExtra("status", patientStatus); -// intent.putExtra("tag", ""); -// context.startActivity(intent); -// } -// }); - - for (int i = 0; i < listPatientUUID.size(); i++) { - if (activePatientModels.get(position).getPatientuuid().equalsIgnoreCase(listPatientUUID.get(i))) { - holder.ivPriscription.setImageDrawable(context.getResources().getDrawable(R.drawable.ic_prescription_green)); - holder.ivPriscription.setTag("1"); - } - } - } - @Override - public int getItemViewType(int position) { - return position; - } @Override public int getItemCount() { @@ -154,23 +91,18 @@ public int getItemCount() { } public class ActivePatientViewHolder extends RecyclerView.ViewHolder { - //ListItemActivePatientBinding listItemActivePatientBinding; private TextView headTextView; private TextView bodyTextView; private TextView indicatorTextView; private View rootView; - private ImageView ivPriscription; public ActivePatientViewHolder(View itemView) { super(itemView); headTextView = itemView.findViewById(R.id.list_item_head_text_view); bodyTextView = itemView.findViewById(R.id.list_item_body_text_view); - ivPriscription = itemView.findViewById(R.id.iv_prescription); indicatorTextView = itemView.findViewById(R.id.list_item_indicator_text_view); rootView = itemView; } - - // public TextView getHeadTextView() { return headTextView; } diff --git a/app/src/main/java/io/intelehealth/client/activities/activitySync/ActivitySync.java b/app/src/main/java/io/intelehealth/client/activities/activitySync/ActivitySync.java old mode 100644 new mode 100755 index 0c16967562..8d456a641d --- a/app/src/main/java/io/intelehealth/client/activities/activitySync/ActivitySync.java +++ b/app/src/main/java/io/intelehealth/client/activities/activitySync/ActivitySync.java @@ -1,11 +1,8 @@ package io.intelehealth.client.activities.activitySync; import android.os.Bundle; -import android.support.design.widget.FloatingActionButton; -import android.support.design.widget.Snackbar; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; -import android.view.View; import io.intelehealth.client.R; @@ -18,14 +15,6 @@ protected void onCreate(Bundle savedInstanceState) { Toolbar toolbar = findViewById(R.id.toolbar); setSupportActionBar(toolbar); - FloatingActionButton fab = findViewById(R.id.fab); - fab.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG) - .setAction("Action", null).show(); - } - }); } } diff --git a/app/src/main/java/io/intelehealth/client/activities/additionalDocumentsActivity/AdditionalDocumentAdapter.java b/app/src/main/java/io/intelehealth/client/activities/additionalDocumentsActivity/AdditionalDocumentAdapter.java old mode 100644 new mode 100755 index 712776f642..ecf863ec47 --- a/app/src/main/java/io/intelehealth/client/activities/additionalDocumentsActivity/AdditionalDocumentAdapter.java +++ b/app/src/main/java/io/intelehealth/client/activities/additionalDocumentsActivity/AdditionalDocumentAdapter.java @@ -1,11 +1,8 @@ package io.intelehealth.client.activities.additionalDocumentsActivity; import android.app.Activity; -import android.content.ContentValues; import android.content.Context; import android.content.DialogInterface; -import android.database.Cursor; -import android.database.sqlite.SQLiteDatabase; import android.support.v7.app.AlertDialog; import android.support.v7.widget.RecyclerView; import android.util.DisplayMetrics; @@ -29,7 +26,6 @@ import java.util.List; import io.intelehealth.client.R; -import io.intelehealth.client.app.AppConstants; import io.intelehealth.client.database.dao.ImagesDAO; import io.intelehealth.client.models.DocumentObject; import io.intelehealth.client.utilities.StringUtils; @@ -99,37 +95,15 @@ public void onClick(View v) { notifyItemRemoved(position); notifyItemRangeChanged(position, documentList.size()); String imageName = holder.getDocumentNameTextView().getText().toString(); - String dir = filePath + File.separator + imageName; + try { imagesDAO.deleteImageFromDatabase(StringUtils.getFileNameWithoutExtensionString(imageName)); } catch (DAOException e) { Crashlytics.getInstance().core.logException(e); } - //deleteImageFromDatabase(dir); } }); } - - private void deleteImageFromDatabase(String imagePath) { - SQLiteDatabase localdb = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); - String[] coloumns = {"_id", "parse_id"}; - String[] selectionArgs = {imagePath}; - Cursor cursor = localdb.query("image_records", coloumns, "image_path = ?", selectionArgs, null, null, null); - if (cursor != null && cursor.moveToFirst()) { - String parse_id = cursor.getString(cursor.getColumnIndexOrThrow("parse_id")); - if (parse_id != null && !parse_id.isEmpty()) { - ContentValues contentValues = new ContentValues(); - contentValues.put("delete_status", 1); - String[] whereArgs = {parse_id}; - localdb.update("image_records", contentValues, "parse_id = ?", whereArgs); - } else { - localdb.execSQL("DELETE FROM image_records WHERE image_path=" + "'" + imagePath + "'"); - } - } - localdb.close(); - } - - public void add(DocumentObject doc) { boolean bool = documentList.add(doc); if (bool) Log.d(TAG, "add: Item added to list"); @@ -157,25 +131,31 @@ public void displayImage(final File file) { public void onShow(DialogInterface d) { ImageView imageView = dialog.findViewById(R.id.confirmationImageView); final ProgressBar progressBar = dialog.findViewById(R.id.progressBar); - Glide.with(context) - .load(file) - .skipMemoryCache(true) - .diskCacheStrategy(DiskCacheStrategy.NONE) - .listener(new RequestListener() { - @Override - public boolean onException(Exception e, File file, Target target, boolean b) { - progressBar.setVisibility(View.GONE); - return false; - } - - @Override - public boolean onResourceReady(GlideDrawable glideDrawable, File file, Target target, boolean b, boolean b1) { - progressBar.setVisibility(View.GONE); - return false; - } - }) - .override(screen_width, screen_height) - .into(imageView); + if (imageView != null) { + Glide.with(context) + .load(file) + .skipMemoryCache(true) + .diskCacheStrategy(DiskCacheStrategy.NONE) + .listener(new RequestListener() { + @Override + public boolean onException(Exception e, File file, Target target, boolean b) { + if (progressBar != null) { + progressBar.setVisibility(View.GONE); + } + return false; + } + + @Override + public boolean onResourceReady(GlideDrawable glideDrawable, File file, Target target, boolean b, boolean b1) { + if (progressBar != null) { + progressBar.setVisibility(View.GONE); + } + return false; + } + }) + .override(screen_width, screen_height) + .into(imageView); + } } }); diff --git a/app/src/main/java/io/intelehealth/client/activities/additionalDocumentsActivity/AdditionalDocumentViewHolder.java b/app/src/main/java/io/intelehealth/client/activities/additionalDocumentsActivity/AdditionalDocumentViewHolder.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/activities/additionalDocumentsActivity/AdditionalDocumentsActivity.java b/app/src/main/java/io/intelehealth/client/activities/additionalDocumentsActivity/AdditionalDocumentsActivity.java old mode 100644 new mode 100755 index cbcfbd140a..c56a76395f --- a/app/src/main/java/io/intelehealth/client/activities/additionalDocumentsActivity/AdditionalDocumentsActivity.java +++ b/app/src/main/java/io/intelehealth/client/activities/additionalDocumentsActivity/AdditionalDocumentsActivity.java @@ -38,11 +38,6 @@ public class AdditionalDocumentsActivity extends AppCompatActivity { private List rowListItem; private AdditionalDocumentAdapter recyclerViewAdapter; - private final String imgPrefix = "AD"; - -// final private String imageDir = "Additional Documents"; -// private String baseDir; -// private String filePath; @Override protected void onCreate(Bundle savedInstanceState) { @@ -59,8 +54,6 @@ public void onClick(View v) { onBackPressed(); } }); - -// baseDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES).getAbsolutePath(); Intent intent = this.getIntent(); // The intent was passed to the activity if (intent != null) { patientUuid = intent.getStringExtra("patientUuid"); @@ -68,9 +61,6 @@ public void onClick(View v) { encounterVitals = intent.getStringExtra("encounterUuidVitals"); encounterAdultIntials = intent.getStringExtra("encounterUuidAdultIntial"); -// filePath = baseDir + File.separator + "Patient Images" + File.separator + patientUuid + File.separator + -// visitUuid + File.separator + imageDir; - ImagesDAO imagesDAO = new ImagesDAO(); ArrayList fileuuidList = new ArrayList(); ArrayList fileList = new ArrayList(); @@ -85,11 +75,6 @@ public void onClick(View v) { } catch (DAOException e) { e.printStackTrace(); } - -// File dir = new File(AppConstants.IMAGE_PATH); -// if (!dir.exists()) -// dir.mkdirs(); -// File[] fileList = dir.listFiles(); rowListItem = new ArrayList<>(); for (File file : fileList) @@ -129,13 +114,6 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) { } } } - // File base_dir = new File(filePath); - //File files[] = base_dir.listFiles(); - //for (File file : files) - - // } - - private void updateImageDatabase(String imageuuid) { ImagesDAO imagesDAO = new ImagesDAO(); try { @@ -143,24 +121,6 @@ private void updateImageDatabase(String imageuuid) { } catch (DAOException e) { Crashlytics.getInstance().core.logException(e); } -// -// SQLiteDatabase localdb = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); -// ContentValues contentValues=new ContentValues(); -// try { -// contentValues.put("uuid", UUID.randomUUID().toString()); -// contentValues.put("patinetuuid", patientUuid); -// contentValues.put("visituuid", visitUuid); -// contentValues.put("image_path", imagePath); -// contentValues.put("image_type", "AD"); -// localdb.insertWithOnConflict("tbl_image_records", null, contentValues, SQLiteDatabase.CONFLICT_REPLACE); -//// localdb.execSQL("INSERT INTO image_records (uuid,patientUuid,visituuid,image_path,image_type) values(" -//// + "'" + UUID.randomUUID().toString() + "'" + "," -//// + "'" + patientUuid + "'" + "," -//// + visitUuid + "," -//// + "'" + imagePath + "','" -//// + "AD" + -//// ")"); -// } } @Override diff --git a/app/src/main/java/io/intelehealth/client/activities/appCompatPreferenceActivity/AppCompatPreferenceActivity.java b/app/src/main/java/io/intelehealth/client/activities/appCompatPreferenceActivity/AppCompatPreferenceActivity.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/activities/cameraActivity/CameraActivity.java b/app/src/main/java/io/intelehealth/client/activities/cameraActivity/CameraActivity.java old mode 100644 new mode 100755 index 6146e6acd4..3f510d542d --- a/app/src/main/java/io/intelehealth/client/activities/cameraActivity/CameraActivity.java +++ b/app/src/main/java/io/intelehealth/client/activities/cameraActivity/CameraActivity.java @@ -21,6 +21,7 @@ import android.view.View; import android.widget.Toast; +import com.crashlytics.android.Crashlytics; import com.google.android.cameraview.CameraView; import java.io.File; @@ -140,7 +141,7 @@ public void run() { try { os.close(); } catch (IOException e) { - // Ignore + Crashlytics.getInstance().core.logException(e); } } } @@ -284,20 +285,6 @@ private Handler getBackgroundHandler() { @Override public void onBackPressed() { - - /* new AlertDialog.Builder(this) - .setMessage("Are you sure you want to EXIT ?") - .setPositiveButton("Yes", new DialogInterface.OnClickListener() - { - @Override - public void onClick(DialogInterface dialog, int which) { - finish(); - } - - }) - .setNegativeButton("No", null) - .show(); //prajwal_changes - */ //do nothing finish(); diff --git a/app/src/main/java/io/intelehealth/client/activities/complaintNodeActivity/ComplaintNodeActivity.java b/app/src/main/java/io/intelehealth/client/activities/complaintNodeActivity/ComplaintNodeActivity.java index dc7d7b4a4a..8bfd5a5bbf 100644 --- a/app/src/main/java/io/intelehealth/client/activities/complaintNodeActivity/ComplaintNodeActivity.java +++ b/app/src/main/java/io/intelehealth/client/activities/complaintNodeActivity/ComplaintNodeActivity.java @@ -2,10 +2,7 @@ import android.content.DialogInterface; import android.content.Intent; -import android.content.SharedPreferences; -import android.graphics.Typeface; import android.os.Bundle; -import android.preference.PreferenceManager; import android.support.design.widget.FloatingActionButton; import android.support.v7.app.AlertDialog; import android.support.v7.app.AppCompatActivity; @@ -19,7 +16,6 @@ import android.widget.AbsListView; import android.widget.AdapterView; import android.widget.ArrayAdapter; -import android.widget.Button; import android.widget.ListView; import com.crashlytics.android.Crashlytics; @@ -29,11 +25,8 @@ import java.io.File; import java.io.IOException; -import java.text.SimpleDateFormat; import java.util.ArrayList; -import java.util.Date; import java.util.List; -import java.util.Locale; import java.util.UUID; import io.intelehealth.client.R; @@ -59,8 +52,6 @@ public class ComplaintNodeActivity extends AppCompatActivity { List complaints; - String mFileName = "knowledge.json"; - //String mFileName = "DemoBrain.json"; CustomArrayAdapter listAdapter; String encounterVitals; @@ -80,22 +71,17 @@ protected void onCreate(Bundle savedInstanceState) { state = intent.getStringExtra("state"); patientName = intent.getStringExtra("name"); intentTag = intent.getStringExtra("tag"); -// Log.v(TAG, "Patient ID: " + patientID); -// Log.v(TAG, "Visit ID: " + visitID); -// Log.v(TAG, "Patient Name: " + patientName); -// Log.v(TAG, "Intent Tag: " + intentTag); } - SimpleDateFormat currentDate = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ", Locale.getDefault()); - Date todayDate = new Date(); - String thisDate = currentDate.format(todayDate); if (encounterAdultIntials.equalsIgnoreCase("") || encounterAdultIntials == null) { encounterAdultIntials = UUID.randomUUID().toString(); + } + EncounterDAO encounterDAO = new EncounterDAO(); encounterDTO = new EncounterDTO(); encounterDTO.setUuid(encounterAdultIntials); encounterDTO.setEncounterTypeUuid(encounterDAO.getEncounterTypeUuid("ENCOUNTER_ADULTINITIAL")); - encounterDTO.setEncounterTime(thisDate); + encounterDTO.setEncounterTime(AppConstants.dateAndTimeUtils.currentDateTime()); encounterDTO.setVisituuid(visitUuid); encounterDTO.setSyncd(false); encounterDTO.setProvideruuid(sessionManager.getProviderID()); @@ -132,10 +118,8 @@ public void onClick(View view) { complaints = new ArrayList<>(); - SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); boolean hasLicense = false; -// if (sharedPreferences.contains("licensekey")) - if (!sessionManager.getLicenseKey().isEmpty()) + if (sessionManager.getLicenseKey() != null && !sessionManager.getLicenseKey().isEmpty()) hasLicense = true; JSONObject currentFile = null; if (hasLicense) { @@ -147,9 +131,11 @@ public void onClick(View view) { } catch (JSONException e) { Crashlytics.getInstance().core.logException(e); } - Log.i(TAG, currentFile.toString()); - Node currentNode = new Node(currentFile); - complaints.add(currentNode); + if (currentFile != null) { + Log.i(TAG, currentFile.toString()); + Node currentNode = new Node(currentFile); + complaints.add(currentNode); + } } } else { String[] fileNames = new String[0]; @@ -158,11 +144,13 @@ public void onClick(View view) { } catch (IOException e) { Crashlytics.getInstance().core.logException(e); } - for (String name : fileNames) { - String fileLocation = "engines/" + name; - currentFile = FileUtils.encodeJSON(this, fileLocation); - Node currentNode = new Node(currentFile); - complaints.add(currentNode); + if (fileNames != null) { + for (String name : fileNames) { + String fileLocation = "engines/" + name; + currentFile = FileUtils.encodeJSON(this, fileLocation); + Node currentNode = new Node(currentFile); + complaints.add(currentNode); + } } } @@ -212,10 +200,6 @@ public void onClick(DialogInterface dialog, int which) { }); AlertDialog alertDialog = alertDialogBuilder.create(); alertDialog.show(); - Button pb = alertDialog.getButton(AlertDialog.BUTTON_NEUTRAL); - pb.setTextColor(getResources().getColor((R.color.colorPrimary))); - pb.setTypeface(Typeface.DEFAULT,Typeface.BOLD); - } else { AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this); alertDialogBuilder.setTitle(R.string.complaint_dialog_title); @@ -223,7 +207,6 @@ public void onClick(DialogInterface dialog, int which) { View convertView = inflater.inflate(R.layout.list_dialog_complaint, null); alertDialogBuilder.setView(convertView); ListView listView = convertView.findViewById(R.id.complaint_dialog_list_view); - listView.setDivider(null); ArrayAdapter arrayAdapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, displaySelection); listView.setAdapter(arrayAdapter); alertDialogBuilder.setPositiveButton(R.string.generic_ok, new DialogInterface.OnClickListener() { @@ -241,6 +224,7 @@ public void onClick(DialogInterface dialog, int which) { intent.putExtra("tag", intentTag); } intent.putStringArrayListExtra("complaints", selection); + startActivity(intent); } }); @@ -252,12 +236,6 @@ public void onClick(DialogInterface dialog, int which) { }); AlertDialog alertDialog = alertDialogBuilder.create(); alertDialog.show(); - Button pb = alertDialog.getButton(AlertDialog.BUTTON_POSITIVE); - Button nb = alertDialog.getButton(AlertDialog.BUTTON_NEGATIVE); - pb.setTextColor(getResources().getColor((R.color.colorPrimary))); - pb.setTypeface(Typeface.DEFAULT,Typeface.BOLD); - nb.setTextColor(getResources().getColor((R.color.colorPrimary))); - nb.setTypeface(Typeface.DEFAULT,Typeface.BOLD); } } } @@ -295,6 +273,4 @@ public boolean onQueryTextChange(String newText) { return true; } - - } diff --git a/app/src/main/java/io/intelehealth/client/activities/complaintNodeActivity/CustomArrayAdapter.java b/app/src/main/java/io/intelehealth/client/activities/complaintNodeActivity/CustomArrayAdapter.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/activities/familyHistoryActivity/FamilyHistoryActivity.java b/app/src/main/java/io/intelehealth/client/activities/familyHistoryActivity/FamilyHistoryActivity.java index 81b048dc9f..9c22e966c5 100644 --- a/app/src/main/java/io/intelehealth/client/activities/familyHistoryActivity/FamilyHistoryActivity.java +++ b/app/src/main/java/io/intelehealth/client/activities/familyHistoryActivity/FamilyHistoryActivity.java @@ -1,6 +1,5 @@ package io.intelehealth.client.activities.familyHistoryActivity; -import android.content.ContentValues; import android.content.DialogInterface; import android.content.Intent; import android.content.SharedPreferences; @@ -8,8 +7,6 @@ import android.database.CursorIndexOutOfBoundsException; import android.database.sqlite.SQLiteDatabase; import android.os.Bundle; -import android.os.Environment; -import android.preference.PreferenceManager; import android.support.design.widget.FloatingActionButton; import android.support.v7.app.AlertDialog; import android.support.v7.app.AppCompatActivity; @@ -35,7 +32,10 @@ import io.intelehealth.client.activities.visitSummaryActivity.VisitSummaryActivity; import io.intelehealth.client.app.AppConstants; import io.intelehealth.client.database.dao.EncounterDAO; +import io.intelehealth.client.database.dao.ImagesDAO; +import io.intelehealth.client.database.dao.ObsDAO; import io.intelehealth.client.knowledgeEngine.Node; +import io.intelehealth.client.models.dto.ObsDTO; import io.intelehealth.client.utilities.FileUtils; import io.intelehealth.client.utilities.SessionManager; import io.intelehealth.client.utilities.UuidDictionary; @@ -50,13 +50,10 @@ public class FamilyHistoryActivity extends AppCompatActivity { String patientName; String intentTag; - String image_Prefix = "FH"; //Abbreviation for Family History - String imageDir = "Family History"; //Abbreviation for Family History ArrayList physicalExams; String mFileName = "famHist.json"; -// String mFileName = "DemoFamily.json"; int lastExpandedPosition = -1; @@ -73,11 +70,14 @@ public class FamilyHistoryActivity extends AppCompatActivity { SessionManager sessionManager; String encounterVitals; String encounterAdultIntials; + private String imageName = null; + private File filePath; @Override protected void onCreate(Bundle savedInstanceState) { sessionManager = new SessionManager(this); - localdb = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); + localdb = AppConstants.inteleHealthDatabaseHelper.getWriteDb(); + filePath = new File(AppConstants.IMAGE_PATH); boolean past = sessionManager.isReturning(); if (past) { AlertDialog.Builder alertdialog = new AlertDialog.Builder(FamilyHistoryActivity.this); @@ -99,7 +99,7 @@ public void onClick(DialogInterface dialog, int which) { String[] columns = {"value", " conceptuuid"}; try { - String famHistSelection = "encounteruuid = ? AND conceptuuid = ?"; + String famHistSelection = "encounteruuid = ? AND conceptuuid = ? AND voided!='1'"; String[] famHistArgs = {encounterAdultIntials, UuidDictionary.RHK_FAMILY_HISTORY_BLURB}; Cursor famHistCursor = localdb.query("tbl_obs", columns, famHistSelection, famHistArgs, null, null, null); famHistCursor.moveToLast(); @@ -112,8 +112,6 @@ public void onClick(DialogInterface dialog, int which) { if (fhistory != null && !fhistory.isEmpty() && !fhistory.equals("null")) { insertDb(fhistory); } - // PastMedicalHistoryActivity pmh = new PastMedicalHistoryActivity(); - // pmh.insertDb(phistory); Intent intent = new Intent(FamilyHistoryActivity.this, PhysicalExamActivity.class); intent.putExtra("patientUuid", patientUuid); @@ -123,7 +121,6 @@ public void onClick(DialogInterface dialog, int which) { intent.putExtra("state", state); intent.putExtra("name", patientName); intent.putExtra("tag", intentTag); - // intent.putStringArrayListExtra("exams", physicalExams); startActivity(intent); @@ -140,11 +137,6 @@ public void onClick(DialogInterface dialog, int which) { encounterAdultIntials = intent.getStringExtra("encounterUuidAdultIntial"); patientName = intent.getStringExtra("name"); intentTag = intent.getStringExtra("tag"); - // physicalExams = intent.getStringArrayListExtra("exams"); //Pass it along -// Log.v(TAG, "Patient ID: " + patientID); -// Log.v(TAG, "Visit ID: " + visitID); -// Log.v(TAG, "Patient Name: " + patientName); -// Log.v(TAG, "Intent Tag: " + intentTag); } super.onCreate(savedInstanceState); setContentView(R.layout.activity_family_history); @@ -165,8 +157,7 @@ public void onClick(View view) { } }); -// if (sessionManager.valueContains("licensekey")) - if (!sessionManager.getLicenseKey().isEmpty()) + if (sessionManager.getLicenseKey() != null && !sessionManager.getLicenseKey().isEmpty()) hasLicense = true; if (hasLicense) { @@ -181,7 +172,6 @@ public void onClick(View view) { familyHistoryMap = new Node(FileUtils.encodeJSON(this, mFileName)); //Load the family history mind map } - // familyHistoryMap = new Node(HelperMethods.encodeJSON(this, mFileName)); //Load the family history mind map familyListView = findViewById(R.id.family_history_expandable_list_view); adapter = new CustomExpandableListAdapter(this, familyHistoryMap, this.getClass().getSimpleName()); familyListView.setAdapter(adapter); @@ -192,7 +182,6 @@ public boolean onChildClick(ExpandableListView parent, View v, int groupPosition Node clickedNode = familyHistoryMap.getOption(groupPosition).getOption(childPosition); Log.i(TAG, "onChildClick: "); clickedNode.toggleSelected(); - //Log.d(TAG, String.valueOf(clickedNode.isSelected())); if (familyHistoryMap.getOption(groupPosition).anySubSelected()) { familyHistoryMap.getOption(groupPosition).setSelected(); } else { @@ -205,11 +194,12 @@ public boolean onChildClick(ExpandableListView parent, View v, int groupPosition Node.handleQuestion(clickedNode, FamilyHistoryActivity.this, adapter, null, null); } } + if (!filePath.exists()) { + boolean res = filePath.mkdirs(); + Log.i("RES>", "" + filePath + " -> " + res); + } - String imageName = patientUuid + "_" + visitUuid + "_" + image_Prefix; - String baseDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES).getAbsolutePath(); - File filePath = new File(baseDir + File.separator + "Patient Images" + File.separator + - patientUuid + File.separator + visitUuid + File.separator + imageDir); + imageName = UUID.randomUUID().toString(); if (!familyHistoryMap.getOption(groupPosition).getOption(childPosition).isTerminal() && familyHistoryMap.getOption(groupPosition).getOption(childPosition).isSelected()) { @@ -259,13 +249,6 @@ private void onFabClick() { if (intentTag != null && intentTag.equals("edit")) { updateDatabase(insertion); - //making flag to false in the encounter table so it will sync again - EncounterDAO encounterDAO = new EncounterDAO(); - try { - encounterDAO.updateEncounterSync("false", encounterAdultIntials); - } catch (DAOException e) { - Crashlytics.getInstance().core.logException(e); - } Intent intent = new Intent(FamilyHistoryActivity.this, VisitSummaryActivity.class); intent.putExtra("patientUuid", patientUuid); intent.putExtra("visitUuid", visitUuid); @@ -274,7 +257,6 @@ private void onFabClick() { intent.putExtra("state", state); intent.putExtra("name", patientName); intent.putExtra("tag", intentTag); - intent.putExtra("hasPrescription", "false"); startActivity(intent); } else { @@ -286,13 +268,6 @@ private void onFabClick() { fhistory = fhistory + ""; } insertDb(fhistory); - - // PastMedicalHistoryActivity pmh = new PastMedicalHistoryActivity(); - // pmh.insertDb(phistory); - - // this will display history data as it is present in database - // Toast.makeText(FamilyHistoryActivity.this,"new PMH: "+phistory,Toast.LENGTH_SHORT).show(); - // Toast.makeText(FamilyHistoryActivity.this,"new FH: "+fhistory,Toast.LENGTH_SHORT).show(); } else { insertDb(insertion); // new details of family history } @@ -314,56 +289,58 @@ private void onFabClick() { } - public long insertDb(String value) { - - - SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this); - - final String CREATOR_ID = prefs.getString("creatorid", null);// TODO: Connect the proper CREATOR_ID - - final String CONCEPT_ID = UuidDictionary.RHK_FAMILY_HISTORY_BLURB; // RHK FAMILY HISTORY BLURB - - ContentValues complaintEntries = new ContentValues(); - -// complaintEntries.put("patient_id", patientID); -// complaintEntries.put("visit_id", visitID); - complaintEntries.put("uuid", UUID.randomUUID().toString()); - complaintEntries.put("encounteruuid", encounterAdultIntials); - complaintEntries.put("value", io.intelehealth.client.utilities.StringUtils.getValue(value)); - complaintEntries.put("conceptuuid", CONCEPT_ID); - complaintEntries.put("creator", CREATOR_ID); - complaintEntries.put("sync", "false"); - + public boolean insertDb(String value) { + ObsDAO obsDAO = new ObsDAO(); + ObsDTO obsDTO = new ObsDTO(); + obsDTO.setConceptuuid(UuidDictionary.RHK_FAMILY_HISTORY_BLURB); + obsDTO.setEncounteruuid(encounterAdultIntials); + obsDTO.setCreator(sessionManager.getCreatorID()); + obsDTO.setValue(io.intelehealth.client.utilities.StringUtils.getValue(value)); + boolean isInserted = false; + try { + isInserted = obsDAO.insertObs(obsDTO); + } catch (DAOException e) { + Crashlytics.getInstance().core.logException(e); + } - return localdb.insert("tbl_obs", null, complaintEntries); + return isInserted; } private void updateImageDatabase(String imagePath) { - localdb.execSQL("INSERT INTO image_records (patient_id,visit_id,image_path,image_type,delete_status) values(" - + "'" + patientUuid + "'" + "," - + visitUuid + "," - + "'" + imagePath + "','" + image_Prefix + "'," + - 0 + - ")"); + ImagesDAO imagesDAO = new ImagesDAO(); + + try { + imagesDAO.insertObsImageDatabase(imageName, encounterAdultIntials, ""); + } catch (DAOException e) { + Crashlytics.getInstance().core.logException(e); + } } private void updateDatabase(String string) { - String conceptID = UuidDictionary.RHK_FAMILY_HISTORY_BLURB; - ContentValues contentValues = new ContentValues(); - contentValues.put("value", string); - contentValues.put("sync", "false"); - String selection = "encounteruuid = ? AND conceptuuid = ?"; - String[] args = {encounterAdultIntials, conceptID}; + ObsDTO obsDTO = new ObsDTO(); + ObsDAO obsDAO = new ObsDAO(); + try { + obsDTO.setConceptuuid(UuidDictionary.RHK_FAMILY_HISTORY_BLURB); + obsDTO.setEncounteruuid(encounterAdultIntials); + obsDTO.setCreator(sessionManager.getCreatorID()); + obsDTO.setValue(string); + obsDTO.setUuid(obsDAO.getObsuuid(encounterAdultIntials, UuidDictionary.RHK_FAMILY_HISTORY_BLURB)); + + obsDAO.updateObs(obsDTO); - localdb.update( - "tbl_obs", - contentValues, - selection, - args - ); + } catch (DAOException dao) { + Crashlytics.getInstance().core.logException(dao); + } + EncounterDAO encounterDAO = new EncounterDAO(); + try { + encounterDAO.updateEncounterSync("false", encounterAdultIntials); + encounterDAO.updateEncounterModifiedDate(encounterAdultIntials); + } catch (DAOException e) { + Crashlytics.getInstance().core.logException(e); + } } @Override diff --git a/app/src/main/java/io/intelehealth/client/activities/homeActivity/HomeActivity.java b/app/src/main/java/io/intelehealth/client/activities/homeActivity/HomeActivity.java index 620b9c5f8c..54f3612057 100644 --- a/app/src/main/java/io/intelehealth/client/activities/homeActivity/HomeActivity.java +++ b/app/src/main/java/io/intelehealth/client/activities/homeActivity/HomeActivity.java @@ -10,22 +10,17 @@ import android.content.DialogInterface; import android.content.Intent; import android.content.IntentFilter; -import android.content.SharedPreferences; import android.content.pm.PackageManager; import android.content.res.Configuration; -import android.database.sqlite.SQLiteDatabase; -import android.net.ConnectivityManager; +import android.graphics.Paint; import android.os.Build; import android.os.Bundle; import android.os.CountDownTimer; -import android.preference.PreferenceManager; import android.support.v4.app.ActivityCompat; import android.support.v7.app.AlertDialog; import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.GridLayoutManager; -import android.support.v7.widget.RecyclerView; +import android.support.v7.widget.CardView; import android.support.v7.widget.Toolbar; -import android.util.Log; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuInflater; @@ -39,36 +34,26 @@ import androidx.work.ExistingPeriodicWorkPolicy; import androidx.work.WorkManager; -import java.io.File; -import java.net.InetAddress; -import java.util.Calendar; import java.util.Locale; import io.intelehealth.client.R; +import io.intelehealth.client.activities.activePatientsActivity.ActivePatientActivity; +import io.intelehealth.client.activities.identificationActivity.IdentificationActivity; import io.intelehealth.client.activities.loginActivity.LoginActivity; +import io.intelehealth.client.activities.privacyNoticeActivity.PrivacyNotice_Activity; +import io.intelehealth.client.activities.searchPatientActivity.SearchPatientActivity; import io.intelehealth.client.activities.settingsActivity.SettingsActivity; -import io.intelehealth.client.activities.setupActivity.SetupActivity; +import io.intelehealth.client.activities.todayPatientActivity.TodayPatientActivity; +import io.intelehealth.client.activities.videoLibraryActivity.VideoLibraryActivity; import io.intelehealth.client.app.AppConstants; -import io.intelehealth.client.database.InteleHealthDatabaseHelper; -import io.intelehealth.client.database.dao.ImagesDAO; -import io.intelehealth.client.models.DownloadMindMapRes; -import io.intelehealth.client.networkApiCalls.ApiClient; -import io.intelehealth.client.networkApiCalls.ApiInterface; import io.intelehealth.client.services.DownloadProtocolsTask; import io.intelehealth.client.syncModule.SyncUtils; -import io.intelehealth.client.utilities.DownloadMindMaps; +import io.intelehealth.client.utilities.ConfigUtils; import io.intelehealth.client.utilities.Logger; import io.intelehealth.client.utilities.OfflineLogin; import io.intelehealth.client.utilities.SessionManager; -import io.intelehealth.client.utilities.exception.DAOException; -import io.intelehealth.client.widget.materialprogressbar.CustomProgressDialog; -import io.reactivex.Observable; -import io.reactivex.android.schedulers.AndroidSchedulers; -import io.reactivex.observers.DisposableObserver; -import io.reactivex.schedulers.Schedulers; import static io.intelehealth.client.app.AppConstants.UNIQUE_WORK_NAME; -import static io.intelehealth.client.app.AppConstants.dbfilepath; /** * Home Screen @@ -87,11 +72,9 @@ public class HomeActivity extends AppCompatActivity { IntentFilter filter; Myreceiver reMyreceive; SyncUtils syncUtils = new SyncUtils(); - - Context context; - CustomProgressDialog customProgressDialog; - private String mindmapURL = ""; - private DownloadMindMaps mTask; + CardView c1, c2, c3, c4, c5; + private String key = null; + private String licenseUrl = null; @Override protected void onCreate(Bundle savedInstanceState) { @@ -109,95 +92,72 @@ protected void onCreate(Bundle savedInstanceState) { getBaseContext().getResources().updateConfiguration(config, getBaseContext().getResources().getDisplayMetrics()); } setTitle(R.string.title_activity_login); - context = HomeActivity.this; - customProgressDialog = new CustomProgressDialog(context); reMyreceive = new Myreceiver(); filter = new IntentFilter("lasysync"); Logger.logD(TAG, "onCreate: " + getFilesDir().toString()); lastSyncTextView = findViewById(R.id.lastsynctextview); manualSyncButton = findViewById(R.id.manualsyncbutton); -// manualSyncButton.setPaintFlags(manualSyncButton.getPaintFlags() | Paint.UNDERLINE_TEXT_FLAG); - lastSyncTextView.setText("Last Synced:- " + sessionManager.getLastPulledDateTime()); - manualSyncButton.setOnClickListener(new View.OnClickListener() { + manualSyncButton.setPaintFlags(Paint.UNDERLINE_TEXT_FLAG); + c1 = findViewById(R.id.cardview_newpat); + c2 = findViewById(R.id.cardview_find_patient); + c3 = findViewById(R.id.cardview_today_patient); + c4 = findViewById(R.id.cardview_active_patients); + c5 = findViewById(R.id.cardview_video_libraby); + c1.setOnClickListener(new View.OnClickListener() { @Override - public void onClick(View v) { - - if (isNetworkConnected()) { - syncUtils.syncForeground(); + public void onClick(View view) { + //Loads the config file values and check for the boolean value of privacy key. + ConfigUtils configUtils = new ConfigUtils(HomeActivity.this); + if (configUtils.privacy_notice()) { + Intent intent = new Intent(HomeActivity.this, PrivacyNotice_Activity.class); + startActivity(intent); } else { - AppConstants.notificationUtils.showNotifications_noProgress("Sync not available", "Please connect to an internet connection!", getApplicationContext()); + Intent intent = new Intent(HomeActivity.this, IdentificationActivity.class); + startActivity(intent); } - -// pullDataDAO.pushDataApi(); -// imagesPushDAO.patientProfileImagesPush(); -// imagesPushDAO.obsImagesPush(); -// pullDataDAO.pullData(HomeActivity.this); } }); - final RecyclerView recyclerView = findViewById(R.id.recyclerview_home); - recyclerView.setHasFixedSize(true); - - GridLayoutManager gridLayoutManager = new GridLayoutManager(HomeActivity.this, 1); - recyclerView.setLayoutManager(gridLayoutManager); - - recyclerView.setAdapter(new HomeAdapter()); - - String date = sessionManager.getDate(); - String time = sessionManager.getTime(); - final Calendar startDate = Calendar.getInstance(); - startDate.set(Calendar.HOUR, 10); - startDate.set(Calendar.MINUTE, 00); - startDate.set(Calendar.AM_PM, Calendar.PM); - -// getPatientUUID(); - - final Calendar endDate = Calendar.getInstance(); - endDate.set(Calendar.HOUR, 10); - endDate.set(Calendar.MINUTE, 15); - endDate.set(Calendar.AM_PM, Calendar.PM); - if (getIntent().hasExtra("setup") && getIntent().getBooleanExtra("setup", false)) { - - Log.d("newfilepath", dbfilepath); - final File db_file = new File(dbfilepath); - -// if (db_file.exists()) { -// new AlertDialog.Builder(this) -// .setIcon(R.drawable.ic_file_download_black_48px) -// .setTitle(R.string.local_restore_alert_title) -// .setMessage(R.string.local_restore_alert_message) -// .setCancelable(false) -// .setPositiveButton(R.string.generic_yes, -// new DialogInterface.OnClickListener() { -// public void onClick(DialogInterface dialog, int whichButton) { -// //Restore from local backup -// manageBackup(false, false); // to restore app data if db is empty -// } -// } -// ) -// .setNegativeButton(R.string.generic_no, -// new DialogInterface.OnClickListener() { -// public void onClick(DialogInterface dialog, int whichButton) { -// //Do Nothing! -// // db_file.delete(); -// } -// } -// ) -// .create().show(); -// } - } -// if (sessionManager.isFirstTimeSyncExcuted()) { - -// AppConstants.notificationUtils.showNotifications("syncBackground","syncBackground Compledted",this); -// pullDataDAO.pushDataApi(); -// sessionManager.setFirstTimeSyncExecute(false); -// } + c2.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + Intent intent = new Intent(HomeActivity.this, SearchPatientActivity.class); + startActivity(intent); + } + }); + c3.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + Intent intent = new Intent(HomeActivity.this, TodayPatientActivity.class); + startActivity(intent); + } + }); + c4.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + Intent intent = new Intent(HomeActivity.this, ActivePatientActivity.class); + startActivity(intent); + } + }); + c5.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + Intent intent = new Intent(HomeActivity.this, VideoLibraryActivity.class); + startActivity(intent); + } + }); + lastSyncTextView.setText("Last Synced:- " + sessionManager.getLastPulledDateTime()); + manualSyncButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + syncUtils.syncForeground(); + } + }); WorkManager.getInstance().enqueueUniquePeriodicWork(UNIQUE_WORK_NAME, ExistingPeriodicWorkPolicy.KEEP, AppConstants.PERIODIC_WORK_REQUEST); if (sessionManager.isFirstTimeLaunched()) { - TempDialog = new ProgressDialog(HomeActivity.this, R.style.AlertDialogStyle); //thats how to add a style! - TempDialog.setTitle("Sync in progress"); + TempDialog = new ProgressDialog(HomeActivity.this); TempDialog.setMessage("Please wait..."); TempDialog.setCancelable(false); TempDialog.setProgress(i); @@ -206,8 +166,7 @@ public void onClick(View v) { CDT = new CountDownTimer(7000, 1000) { public void onTick(long millisUntilFinished) { - TempDialog.setTitle("Sync in progress"); - TempDialog.setMessage("Please wait..."); + TempDialog.setMessage("Please wait.. Syncing"); i--; } @@ -215,10 +174,12 @@ public void onFinish() { TempDialog.dismiss(); //Your Code ... sessionManager.setFirstTimeLaunched(false); + sessionManager.setMigration(true); } }.start(); } + sessionManager.setMigration(true); if (sessionManager.isReturningUser()) { syncUtils.syncForeground(); @@ -227,12 +188,6 @@ public void onFinish() { } - private boolean isNetworkConnected() { - ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE); - - return cm.getActiveNetworkInfo() != null && cm.getActiveNetworkInfo().isConnected(); - } - @Override public boolean onCreateOptionsMenu(Menu menu) { @@ -252,22 +207,15 @@ public boolean onOptionsItemSelected(MenuItem item) { settings(); return true; case R.id.updateProtocolsOption: { -// SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); -// if (sharedPreferences.contains("licensekey")) { -// String license = sharedPreferences.getString("licensekey", null); -// if (license != null) { -// DownloadProtocolsTask downloadProtocolsTask = new DownloadProtocolsTask(this); -// downloadProtocolsTask.execute(license); -// } else { -// Toast.makeText(this, "License invalid", Toast.LENGTH_SHORT).show(); -// } - - if (!sessionManager.getLicenseKey().isEmpty()) { - - String licenseUrl = sessionManager.getMindMapServerUrl(); - String licenseKey = sessionManager.getLicenseKey(); - getMindmapDownloadURL("http://" + licenseUrl + ":3004/", licenseKey); + if (sessionManager.getLicenseKey() != null && sessionManager.getLicenseKey().equalsIgnoreCase("http://mindmaps.intelehealth.io:4040")) { + String license = sessionManager.getLicenseKey(); + if (license != null) { + DownloadProtocolsTask downloadProtocolsTask = new DownloadProtocolsTask(this); + downloadProtocolsTask.execute(license); + } else { + Toast.makeText(this, "License invalid", Toast.LENGTH_SHORT).show(); + } } else { AlertDialog.Builder dialog = new AlertDialog.Builder(this); LayoutInflater li = LayoutInflater.from(this); @@ -277,31 +225,32 @@ public boolean onOptionsItemSelected(MenuItem item) { .setPositiveButton(getString(R.string.button_ok), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { - Dialog d = (Dialog) dialog; - EditText etURL = d.findViewById(R.id.licenseurl); - EditText etKey = d.findViewById(R.id.licensekey); - String url = etURL.getText().toString().trim(); - String key = etKey.getText().toString().trim(); + Dialog d = (Dialog) dialog; - if (url.isEmpty()) { - etURL.setError("Enter Server URL"); - etURL.requestFocus(); - return; + EditText text = d.findViewById(R.id.licensekey); + // text.setText(sessionManager.getLicenseKey()); + EditText url = d.findViewById(R.id.licenseurl); + // url.setText(sessionManager.getMindMapServerUrl()); + if (text.getText().toString().isEmpty() && text.getText() == null || url.getText().toString().isEmpty() && url.getText() == null) { + text.setFocusable(true); + text.setError("Enter license key"); } - if (key.isEmpty()) { - etKey.setError("Enter License Key"); - etKey.requestFocus(); - return; + if (sessionManager.getLicenseKey() != null && sessionManager.getLicenseKey().equalsIgnoreCase("http://mindmaps.intelehealth.io:4040")) { + text.setText(sessionManager.getLicenseKey()); + url.setText(sessionManager.getMindMapServerUrl()); } + key = text.getText().toString(); + licenseUrl = url.getText().toString(); - sessionManager.setMindMapServerUrl(url); - getMindmapDownloadURL("http://" + url + ":3004/", key); + sessionManager.setMindMapServerUrl(licenseUrl); -// if (key != null && !key.trim().isEmpty()) { -// DownloadProtocolsTask downloadProtocolsTask = new DownloadProtocolsTask(HomeActivity.this); -// downloadProtocolsTask.execute(key); -// } + if (keyVerified(key)) { + DownloadProtocolsTask downloadProtocolsTask = new DownloadProtocolsTask(HomeActivity.this); + downloadProtocolsTask.execute(key); + + + } } }) .setNegativeButton(getString(R.string.button_cancel), new DialogInterface.OnClickListener() { @@ -319,15 +268,13 @@ public void onClick(DialogInterface dialog, int which) { // pullDataDAO.pullData(this); // pullDataDAO.pushDataApi(); boolean isSynced = syncUtils.syncForeground(); - AppConstants.notificationUtils.showNotifications("sync", "syncBackground Completed", this); + AppConstants.notificationUtils.showNotifications("sync", "syncBackground Completed", 1, this); // boolean i = imagesPushDAO.patientProfileImagesPush(); // boolean o = imagesPushDAO.obsImagesPush(); if (isSynced) - AppConstants.notificationUtils.showNotifications_noProgress("Sync not available", "Please connect to an internet connection!", getApplicationContext()); - //AppConstants.notificationUtils.showNotifications("ImageUpload", "ImageUpload Completed", this); + AppConstants.notificationUtils.showNotifications("ImageUpload", "ImageUpload Completed", 4, this); else - //AppConstants.notificationUtils.showNotifications_noProgress("Sync not available", "Please connect to an internet connection!", getApplicationContext()); - AppConstants.notificationUtils.showNotifications("ImageUpload", "ImageUpload failed", this); + AppConstants.notificationUtils.showNotifications("ImageUpload", "ImageUpload failed", 4, this); return true; // case R.id.backupOption: // manageBackup(true, false); // to backup app data at any time of the day @@ -397,31 +344,6 @@ public void logout() { sessionManager.setReturningUser(false); } -// public void manageBackup(boolean isBackup, boolean isForced) { -// BackupCloud b = new BackupCloud(this); -// if (isBackup) -// b.startCloudBackup(null, false); -// if (!isBackup) { -// if (isForced) b.cloudRestoreForced(); -// if (!isForced) b.startCloudRestore(); -// } -// } - -// private void parseLogOut() { -// if (NetworkConnection.isOnline(this)) { -// ParseQuery getLogin = ParseQuery.getQuery("Login"); -// getLogin.whereEqualTo("userId", sessionManager.getCreatorID()); -// try { -// List loginList = getLogin.find(); -// if (loginList != null && !loginList.isEmpty()) { -// for (ParseObject login : loginList) -// login.delete(); -// } -// } catch (ParseException e1) { -// Log.e(TAG, "parseLogOut: ", e1); -// } -// } -// } @Override protected void onResume() { @@ -435,6 +357,10 @@ protected void onDestroy() { super.onDestroy(); } + private boolean keyVerified(String key) { + //TODO: Verify License Key + return true; + } @Override public void onBackPressed() { new AlertDialog.Builder(this) @@ -459,88 +385,4 @@ public void onReceive(Context context, Intent intent) { } } - private void getMindmapDownloadURL(String url, String key) { - customProgressDialog.show(); - ApiClient.changeApiBaseUrl(url); - ApiInterface apiService = ApiClient.createService(ApiInterface.class); - try { - Observable resultsObservable = apiService.DOWNLOAD_MIND_MAP_RES_OBSERVABLE(key); - resultsObservable - .subscribeOn(Schedulers.io()) - .observeOn(AndroidSchedulers.mainThread()) - .subscribe(new DisposableObserver() { - @Override - public void onNext(DownloadMindMapRes res) { - customProgressDialog.dismiss(); - if (res.getMessage() != null && res.getMessage().equalsIgnoreCase("Success")) { - - Log.e("MindMapURL", "Successfully get MindMap URL"); - mTask = new DownloadMindMaps(context); - mindmapURL = res.getMindmap().trim(); - sessionManager.setLicenseKey(key); - checkExistingMindMaps(); - - } else { - Toast.makeText(context, getResources().getString(R.string.no_mindmaps_found), Toast.LENGTH_SHORT).show(); - } - } - - @Override - public void onError(Throwable e) { - customProgressDialog.dismiss(); - Toast.makeText(context, getResources().getString(R.string.unable_to_get_proper_response), Toast.LENGTH_SHORT).show(); - } - - @Override - public void onComplete() { - - } - }); - } catch (IllegalArgumentException e) { - Log.e(TAG, "changeApiBaseUrl: " + e.getMessage()); - Log.e(TAG, "changeApiBaseUrl: " + e.getStackTrace()); - } - } - - private void checkExistingMindMaps() { - - //Check is there any existing mindmaps are present, if yes then delete. - - File engines = new File(context.getFilesDir().getAbsolutePath(), "/Engines"); - Log.e(TAG, "Engines folder=" + engines.exists()); - if (engines.exists()) { - engines.delete(); - } - File logo = new File(context.getFilesDir().getAbsolutePath(), "/logo"); - Log.e(TAG, "Logo folder=" + logo.exists()); - if (logo.exists()) { - logo.delete(); - } - File physicalExam = new File(context.getFilesDir().getAbsolutePath() + "/physExam.json"); - Log.e(TAG, "physExam.json=" + physicalExam.exists()); - if (physicalExam.exists()) { - physicalExam.delete(); - } - File familyHistory = new File(context.getFilesDir().getAbsolutePath() + "/famHist.json"); - Log.e(TAG, "famHist.json=" + familyHistory.exists()); - if (familyHistory.exists()) { - familyHistory.delete(); - } - File pastMedicalHistory = new File(context.getFilesDir().getAbsolutePath() + "/patHist.json"); - Log.e(TAG, "patHist.json=" + pastMedicalHistory.exists()); - if (pastMedicalHistory.exists()) { - pastMedicalHistory.delete(); - } - File config = new File(context.getFilesDir().getAbsolutePath() + "/config.json"); - Log.e(TAG, "config.json=" + config.exists()); - if (config.exists()) { - config.delete(); - } - - //Start downloading mindmaps - mTask.execute(mindmapURL, context.getFilesDir().getAbsolutePath() + "/mindmaps.zip"); - Log.e("DOWNLOAD", "isSTARTED"); - - } - } diff --git a/app/src/main/java/io/intelehealth/client/activities/homeActivity/HomeAdapter.java b/app/src/main/java/io/intelehealth/client/activities/homeActivity/HomeAdapter.java index 0eadc28da4..6d8a47e3d2 100644 --- a/app/src/main/java/io/intelehealth/client/activities/homeActivity/HomeAdapter.java +++ b/app/src/main/java/io/intelehealth/client/activities/homeActivity/HomeAdapter.java @@ -33,15 +33,17 @@ public class HomeAdapter extends RecyclerView.Adapter educationAdapter; private ArrayAdapter economicStatusAdapter; @@ -181,7 +179,6 @@ public void onClick(View v) { countryStateLayout = findViewById(R.id.identification_llcountry_state); mImageView = findViewById(R.id.imageview_id_picture); //Initialize the local database to store patient information - mDbHelper = new InteleHealthDatabaseHelper(this); Intent intent = this.getIntent(); // The intent was passed to the activity if (intent != null) { @@ -700,7 +697,7 @@ public void generateUuid() { // This method is for setting the screen with existing values in database whenn user clicks edit details private void setscreen(String str) { - SQLiteDatabase db = mDbHelper.getWritableDatabase(); + SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWriteDb(); String patientSelection = "uuid=?"; String[] patientArgs = {str}; @@ -1038,20 +1035,20 @@ public void onClick(DialogInterface dialog, int which) { if (NetworkConnection.isOnline(getApplication())) { // patientApiCall(); // frameJson(); - AppConstants.notificationUtils.showNotifications("Patient Data Upload", "Uploading " + patientdto.getFirstname() + "" + patientdto.getLastname() + "'s data", getApplication()); - PullDataDAO pullDataDAO = new PullDataDAO(); + AppConstants.notificationUtils.showNotifications("Patient Data Upload", "Uploading " + patientdto.getFirstname() + "" + patientdto.getLastname() + "'s data", 2, getApplication()); + SyncDAO syncDAO = new SyncDAO(); ImagesPushDAO imagesPushDAO = new ImagesPushDAO(); - boolean push = pullDataDAO.pushDataApi(); + boolean push = syncDAO.pushDataApi(); boolean pushImage = imagesPushDAO.patientProfileImagesPush(); if (push) - AppConstants.notificationUtils.DownloadDone("Patient Data Upload", "" + patientdto.getFirstname() + "" + patientdto.getLastname() + "'s data upload complete.", getApplication()); + AppConstants.notificationUtils.DownloadDone("Patient Data Upload", "" + patientdto.getFirstname() + "" + patientdto.getLastname() + "'s data upload complete.", 2, getApplication()); else - AppConstants.notificationUtils.DownloadDone("Patient Data Upload", "" + patientdto.getFirstname() + "" + patientdto.getLastname() + "'s data not uploaded.", getApplication()); + AppConstants.notificationUtils.DownloadDone("Patient Data Upload", "" + patientdto.getFirstname() + "" + patientdto.getLastname() + "'s data not uploaded.", 2, getApplication()); if (pushImage) - AppConstants.notificationUtils.DownloadDone("Patient Data Upload", "" + patientdto.getFirstname() + "" + patientdto.getLastname() + "'s Image upload complete.", getApplication()); + AppConstants.notificationUtils.DownloadDone("Patient Data Upload", "" + patientdto.getFirstname() + "" + patientdto.getLastname() + "'s Image upload complete.", 4, getApplication()); else - AppConstants.notificationUtils.DownloadDone("Patient Data Upload", "" + patientdto.getFirstname() + "" + patientdto.getLastname() + "'s Image not complete.", getApplication()); + AppConstants.notificationUtils.DownloadDone("Patient Data Upload", "" + patientdto.getFirstname() + "" + patientdto.getLastname() + "'s Image not complete.", 4, getApplication()); } @@ -1160,20 +1157,20 @@ public void onPatientUpdateClicked(Patient patientdto) { boolean isPatientImageUpdated = imagesDAO.updatePatientProfileImages(mCurrentPhotoPath, uuid); if (NetworkConnection.isOnline(getApplication())) { - PullDataDAO pullDataDAO = new PullDataDAO(); + SyncDAO syncDAO = new SyncDAO(); ImagesPushDAO imagesPushDAO = new ImagesPushDAO(); - boolean ispush = pullDataDAO.pushDataApi(); + boolean ispush = syncDAO.pushDataApi(); boolean isPushImage = imagesPushDAO.patientProfileImagesPush(); if (ispush) - AppConstants.notificationUtils.DownloadDone("Patient Data Upload", "" + patientdto.getFirst_name() + "" + patientdto.getLast_name() + "'s data upload complete.", getApplication()); + AppConstants.notificationUtils.DownloadDone("Patient Data Upload", "" + patientdto.getFirst_name() + "" + patientdto.getLast_name() + "'s data upload complete.", 2, getApplication()); else - AppConstants.notificationUtils.DownloadDone("Patient Data Upload", "" + patientdto.getFirst_name() + "" + patientdto.getLast_name() + "'s data not uploaded.", getApplication()); + AppConstants.notificationUtils.DownloadDone("Patient Data Upload", "" + patientdto.getFirst_name() + "" + patientdto.getLast_name() + "'s data not uploaded.", 2, getApplication()); if (isPushImage) - AppConstants.notificationUtils.DownloadDone("Patient Data Upload", "" + patientdto.getFirst_name() + "" + patientdto.getLast_name() + "'s Image upload complete.", getApplication()); + AppConstants.notificationUtils.DownloadDone("Patient Data Upload", "" + patientdto.getFirst_name() + "" + patientdto.getLast_name() + "'s Image upload complete.", 4, getApplication()); else - AppConstants.notificationUtils.DownloadDone("Patient Data Upload", "" + patientdto.getFirst_name() + "" + patientdto.getLast_name() + "'s Image not complete.", getApplication()); + AppConstants.notificationUtils.DownloadDone("Patient Data Upload", "" + patientdto.getFirst_name() + "" + patientdto.getLast_name() + "'s Image not complete.", 4, getApplication()); } if (isPatientUpdated && isPatientImageUpdated) { diff --git a/app/src/main/java/io/intelehealth/client/activities/loginActivity/LoginActivity.java b/app/src/main/java/io/intelehealth/client/activities/loginActivity/LoginActivity.java index ac40915e26..7f383aed05 100644 --- a/app/src/main/java/io/intelehealth/client/activities/loginActivity/LoginActivity.java +++ b/app/src/main/java/io/intelehealth/client/activities/loginActivity/LoginActivity.java @@ -4,12 +4,9 @@ import android.accounts.Account; import android.accounts.AccountManager; import android.app.ProgressDialog; -import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.pm.PackageManager; -import android.graphics.Bitmap; -import android.graphics.BitmapFactory; import android.net.Uri; import android.os.Bundle; import android.os.StrictMode; @@ -26,14 +23,11 @@ import android.widget.AutoCompleteTextView; import android.widget.Button; import android.widget.EditText; -import android.widget.ImageView; import android.widget.TextView; import android.widget.Toast; import com.google.gson.Gson; -import java.io.File; - import io.intelehealth.client.R; import io.intelehealth.client.activities.homeActivity.HomeActivity; import io.intelehealth.client.app.AppConstants; @@ -45,7 +39,6 @@ import io.intelehealth.client.utilities.OfflineLogin; import io.intelehealth.client.utilities.SessionManager; import io.intelehealth.client.utilities.UrlModifiers; -import io.intelehealth.client.widget.materialprogressbar.CustomProgressDialog; import io.reactivex.Observable; import io.reactivex.Observer; import io.reactivex.android.schedulers.AndroidSchedulers; @@ -55,35 +48,33 @@ public class LoginActivity extends AppCompatActivity { TextView txt_cant_login; - + /** + * A dummy authentication store containing known user names and passwords. + */ + private static final String[] DUMMY_CREDENTIALS = new String[]{ + "username:password", "admin:nimda" + }; private final String TAG = LoginActivity.class.getSimpleName(); protected AccountManager manager; - // ProgressDialog progress; - Context context; - CustomProgressDialog cpd; + ProgressDialog progress; SessionManager sessionManager = null; /** * Keep track of the login task to ensure we can cancel it if requested. */ +// private UserLoginTask mAuthTask = null; private OfflineLogin offlineLogin = null; UrlModifiers urlModifiers = new UrlModifiers(); Base64Utils base64Utils = new Base64Utils(); String encoded = null; // UI references. - private EditText mUsernameView; + private AutoCompleteTextView mUsernameView; private EditText mPasswordView; - private ImageView icLogo; - @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_login); - - context = LoginActivity.this; - sessionManager = new SessionManager(context); - cpd = new CustomProgressDialog(context); - + sessionManager = new SessionManager(this); setTitle(R.string.title_activity_login); offlineLogin = OfflineLogin.getOfflineLogin(); @@ -110,7 +101,7 @@ public void onClick(View v) { if (accountList.length > 0) { Intent intent = new Intent(LoginActivity.this, HomeActivity.class); intent.putExtra("login", true); -// startJobDispatcherService(LoginActivity.this); +// startJobDispatcherService(LoginActivity.this); startActivity(intent); finish(); } @@ -125,41 +116,28 @@ public void onClick(View v) { finish(); } } - icLogo = findViewById(R.id.iv_logo); - setLogo(); - // Set up the login form. - mUsernameView = findViewById(R.id.et_email); + mUsernameView = findViewById(R.id.email); // populateAutoComplete(); TODO: create our own autocomplete code - mPasswordView = findViewById(R.id.et_password); -// mPasswordView.setOnEditorActionListener(new TextView.OnEditorActionListener() { -// @Override -// public boolean onEditorAction(TextView v, int id, KeyEvent event) { -// if (id == R.id.login || id == EditorInfo.IME_NULL) { -// attemptLogin(); -// return true; -// } -// return false; -// } -// }); + mPasswordView = findViewById(R.id.password); + mPasswordView.setOnEditorActionListener(new TextView.OnEditorActionListener() { + @Override + public boolean onEditorAction(TextView v, int id, KeyEvent event) { + if (id == R.id.login || id == EditorInfo.IME_NULL) { + attemptLogin(); + return true; + } + return false; + } + }); Button mEmailSignInButton = findViewById(R.id.email_sign_in_button); mEmailSignInButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { + Logger.logD(TAG, "button pressed"); attemptLogin(); } }); - } - - private void setLogo() { - - File f = new File("/data/data/" + context.getPackageName() + "/files/logo/ic_sams.png"); - if (f.isFile()) { - Bitmap bitmap = BitmapFactory.decodeFile("/data/data/" + context.getPackageName() + "/files/logo/ic_sams.png"); - icLogo.setImageBitmap(bitmap); - } else { - Log.e("SetLogo","No Logo Found in Mindmap Folder"); - } } @@ -171,47 +149,87 @@ private void setLogo() { */ private void attemptLogin() { +// if (mAuthTask != null) { +// return; +// } + + // Reset errors. + mUsernameView.setError(null); + mPasswordView.setError(null); + // Store values at the time of the login attempt. - String email = mUsernameView.getText().toString().trim(); - String password = mPasswordView.getText().toString().trim(); + String email = mUsernameView.getText().toString(); + String password = mPasswordView.getText().toString(); + + + boolean cancel = false; + View focusView = null; + // Check for a valid email address. if (TextUtils.isEmpty(email)) { - mUsernameView.setError(getString(R.string.enter_username)); - mUsernameView.requestFocus(); - return; + mUsernameView.setError(getString(R.string.error_field_required)); + focusView = mUsernameView; + cancel = true; } - // Check for a valid password, if the user entered one. + + + // Check for a valid password. if (TextUtils.isEmpty(password)) { - mPasswordView.setError(getString(R.string.enter_password)); - mPasswordView.requestFocus(); - return; + mPasswordView.setError(getString(R.string.error_field_required)); + focusView = mPasswordView; + cancel = true; } - - if (password.length() < 4) { + // Check for a valid password, if the user entered one. + if (!isPasswordValid(password)) { mPasswordView.setError(getString(R.string.error_invalid_password)); - mPasswordView.requestFocus(); - return; + focusView = mPasswordView; + cancel = true; } - - if (NetworkConnection.isOnline(this)) { +// + if (TextUtils.isEmpty(email) && TextUtils.isEmpty(password)) { + mUsernameView.setError(getString(R.string.error_field_required)); + focusView = mUsernameView; + cancel = true; + mPasswordView.setError(getString(R.string.error_field_required)); + focusView = mPasswordView; + cancel = true; + } + if (cancel) { + // There was an error; don't attempt login and focus the first + // form field with an error. + focusView.requestFocus(); + } else if (NetworkConnection.isOnline(this)) { // Show a progress spinner, and kick off a background task to // perform the user login attempt. +// showProgress(true); UserLoginTask(email, password); +// mAuthTask.execute((Void) null); + Log.d(TAG, "attempting login"); } else { offlineLogin.login(email, password); } + } -// private void showProgress(final boolean show) { -// if (progress == null) { -// progress = new ProgressDialog(LoginActivity.this); -// progress.setTitle(getString(R.string.please_wait_progress)); -// progress.setMessage(getString(R.string.logging_in)); -// } -// if (show) progress.show(); -// else progress.dismiss(); -// } + /** + * @param password Password + * @return boolean + */ + private boolean isPasswordValid(String password) { + //TODO: Replace this with your own logic + return password.length() > 4; + } + + private void showProgress(final boolean show) { + if (progress == null) { + progress = new ProgressDialog(LoginActivity.this); + progress.setTitle(getString(R.string.please_wait_progress)); + progress.setMessage(getString(R.string.logging_in)); + } + if (show) progress.show(); + else progress.dismiss(); + } public void cant_log() { final SpannableString span_string = new SpannableString(getApplicationContext().getText(R.string.email_link)); @@ -228,7 +246,7 @@ public void onClick(DialogInterface dialog, int which) { intent.setData(Uri.parse("mailto:support@intelehealth.io")); // intent.putExtra(Intent.EXTRA_EMAIL, "support@intelehealth.io"); // intent.putExtra(Intent.EXTRA_SUBJECT, "Subject"); - // intent.putExtra(Intent.EXTRA_TEXT, "I'm email body."); + // intent.putExtra(Intent.EXTRA_TEXT, "I'm email body."); startActivity(Intent.createChooser(intent, "Send Email")); //add email function here ! @@ -237,6 +255,8 @@ public void onClick(DialogInterface dialog, int which) { }) .setPositiveButton("Close", null) .show(); + + //prajwal_changes } /** @@ -246,12 +266,32 @@ public void onClick(DialogInterface dialog, int which) { */ public void UserLoginTask(String mEmail, String mPassword) { +// private final String mEmail; +// private final String mPassword; +// boolean success = false; + +// UserLoginTask(String email, String password) { +// mEmail = email; +// mPassword = password; +// } + +// @Override +// protected void onPreExecute() { +// super.onPreExecute(); +// showProgress(true); +// } + +// @Override +// protected Boolean doInBackground(Void... params) { + + +// Log.d(TAG, "UN: " + USERNAME); +// Log.d(TAG, "PW: " + PASSWORD); String urlString = urlModifiers.loginUrl(sessionManager.getServerUrl()); - Logger.logD(TAG, "username and password" + mEmail + mPassword); + Logger.logD(TAG, "usernaem and password" + mEmail + mPassword); encoded = base64Utils.encoded(mEmail, mPassword); sessionManager.setEncoded(encoded); -// showProgress(true); - cpd.show(); + showProgress(true); StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build(); StrictMode.setThreadPolicy(policy); Observable loginModelObservable = AppConstants.apiInterface.LOGIN_MODEL_OBSERVABLE(urlString, "Basic " + encoded); @@ -285,18 +325,20 @@ public void onNext(LoginProviderModel loginProviderModel) { for (int i = 0; i < loginProviderModel.getResults().size(); i++) { Log.i(TAG, "doInBackground: " + loginProviderModel.getResults().get(i).getUuid()); sessionManager.setProviderID(loginProviderModel.getResults().get(i).getUuid()); +// success = true; final Account account = new Account(mEmail, "io.intelehealth.openmrs"); manager.addAccountExplicitly(account, mPassword, null); offlineLogin.invalidateLoginCredentials(); offlineLogin.setUpOfflineLogin(mEmail, mPassword); Intent intent = new Intent(LoginActivity.this, HomeActivity.class); intent.putExtra("login", true); -// startJobDispatcherService(LoginActivity.this); +// startJobDispatcherService(LoginActivity.this); startActivity(intent); finish(); -// showProgress(false); - cpd.dismiss(); + showProgress(false); + sessionManager.setReturningUser(true); + } } } @@ -304,8 +346,8 @@ public void onNext(LoginProviderModel loginProviderModel) { @Override public void onError(Throwable e) { Logger.logD(TAG, "handle provider error" + e.getMessage()); -// showProgress(false); - cpd.dismiss(); +// success = false; + showProgress(false); } @Override @@ -319,14 +361,16 @@ public void onComplete() { @Override public void onError(Throwable e) { Logger.logD(TAG, "Login Failure" + e.getMessage()); -// showProgress(false); - cpd.dismiss(); +// success = false; + showProgress(false); +// DialogUtils dialogUtils=new DialogUtils(); +// dialogUtils.showerrorDialog(LoginActivity.this,"Error Login",getString(R.string.error_incorrect_password),"ok"); Toast.makeText(LoginActivity.this, getString(R.string.error_incorrect_password), Toast.LENGTH_SHORT).show(); -// mPasswordView.setError(""); -// mUsernameView.setError(""); -// mPasswordView.setText(""); -// mUsernameView.setText(""); -// mPasswordView.requestFocus(); + mPasswordView.setError(""); + mUsernameView.setError(""); + mPasswordView.setText(""); + mUsernameView.setText(""); + mPasswordView.requestFocus(); } @Override @@ -334,5 +378,29 @@ public void onComplete() { Logger.logD(TAG, "completed"); } }); + + +// return true; +// +// } + +// @Override +// protected void onPostExecute(final Boolean success) { +// mAuthTask = null; + + +// if (success) { + +// } else { +// +// } +// } + +// @Override +// protected void onCancelled() { +// mAuthTask = null; +// showProgress(false); +// } } + } diff --git a/app/src/main/java/io/intelehealth/client/activities/pastMedicalHistoryActivity/PastMedicalHistoryActivity.java b/app/src/main/java/io/intelehealth/client/activities/pastMedicalHistoryActivity/PastMedicalHistoryActivity.java index 0948bd2a49..7641fc28a1 100644 --- a/app/src/main/java/io/intelehealth/client/activities/pastMedicalHistoryActivity/PastMedicalHistoryActivity.java +++ b/app/src/main/java/io/intelehealth/client/activities/pastMedicalHistoryActivity/PastMedicalHistoryActivity.java @@ -1,16 +1,11 @@ package io.intelehealth.client.activities.pastMedicalHistoryActivity; -import android.content.ContentValues; import android.content.DialogInterface; import android.content.Intent; -import android.content.SharedPreferences; import android.database.Cursor; import android.database.CursorIndexOutOfBoundsException; -import android.database.SQLException; import android.database.sqlite.SQLiteDatabase; import android.os.Bundle; -import android.os.Environment; -import android.preference.PreferenceManager; import android.support.design.widget.FloatingActionButton; import android.support.v7.app.AlertDialog; import android.support.v7.app.AppCompatActivity; @@ -34,11 +29,15 @@ import io.intelehealth.client.activities.physcialExamActivity.CustomExpandableListAdapter; import io.intelehealth.client.activities.visitSummaryActivity.VisitSummaryActivity; import io.intelehealth.client.app.AppConstants; +import io.intelehealth.client.database.dao.EncounterDAO; +import io.intelehealth.client.database.dao.ImagesDAO; +import io.intelehealth.client.database.dao.ObsDAO; import io.intelehealth.client.knowledgeEngine.Node; +import io.intelehealth.client.models.dto.ObsDTO; import io.intelehealth.client.utilities.FileUtils; import io.intelehealth.client.utilities.SessionManager; -import io.intelehealth.client.utilities.StringUtils; import io.intelehealth.client.utilities.UuidDictionary; +import io.intelehealth.client.utilities.exception.DAOException; public class PastMedicalHistoryActivity extends AppCompatActivity { @@ -74,7 +73,6 @@ public class PastMedicalHistoryActivity extends AppCompatActivity { String phistory = ""; boolean flag = false; - SharedPreferences.Editor e; SessionManager sessionManager = null; private String encounterVitals; @@ -83,9 +81,10 @@ public class PastMedicalHistoryActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { sessionManager = new SessionManager(this); - localdb = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); - SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); - e = sharedPreferences.edit(); + localdb = AppConstants.inteleHealthDatabaseHelper.getWriteDb(); + filePath = new File(AppConstants.IMAGE_PATH); +// SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); +// e = sharedPreferences.edit(); boolean past = sessionManager.isReturning(); if (past) { @@ -106,7 +105,7 @@ public void onClick(DialogInterface dialog, int which) { String[] columns = {"value", " conceptuuid"}; try { - String medHistSelection = "encounteruuid = ? AND conceptuuid = ?"; + String medHistSelection = "encounteruuid = ? AND conceptuuid = ? AND voided!='1'"; String[] medHistArgs = {encounterAdultIntials, UuidDictionary.RHK_MEDICAL_HISTORY_BLURB}; Cursor medHistCursor = localdb.query("tbl_obs", columns, medHistSelection, medHistArgs, null, null, null); medHistCursor.moveToLast(); @@ -148,11 +147,6 @@ public void onClick(DialogInterface dialog, int which) { state = intent.getStringExtra("state"); patientName = intent.getStringExtra("name"); intentTag = intent.getStringExtra("tag"); - // physicalExams = intent.getStringArrayListExtra("exams"); //Pass it along -// Log.v(TAG, "Patient ID: " + patientID); -// Log.v(TAG, "Visit ID: " + visitID); -// Log.v(TAG, "Patient Name: " + patientName); -// Log.v(TAG, "Intent Tag: " + intentTag); } @@ -195,7 +189,6 @@ public void onClick(View view) { intent.putExtra("encounterUuidVitals", encounterVitals); intent.putExtra("encounterUuidAdultIntial", encounterAdultIntials); intent.putExtra("state", state); - intent.putExtra("hasPrescription", "false"); intent.putExtra("name", patientName); intent.putExtra("tag", intentTag); startActivity(intent); @@ -206,8 +199,9 @@ public void onClick(View view) { if (flag == true) { // only if OK clicked, collect this new info (old patient) phistory = phistory + patientHistory; // only PMH updated - e.putBoolean("returning", true); - e.commit(); + sessionManager.setReturning(true); + + insertDb(phistory); // however, we concat it here to patientHistory and pass it along to FH, not inserting into db @@ -233,8 +227,7 @@ public void onClick(View view) { }); -// if (sharedPreferences.contains("licensekey")) - if (!sessionManager.getLicenseKey().isEmpty()) + if (sessionManager.getLicenseKey() != null && !sessionManager.getLicenseKey().isEmpty()) hasLicense = true; if (hasLicense) { @@ -269,16 +262,15 @@ public boolean onChildClick(ExpandableListView parent, View v, int groupPosition if (clickedNode.getInputType() != null) { if (!clickedNode.getInputType().equals("camera")) { + imageName = UUID.randomUUID().toString(); Node.handleQuestion(clickedNode, PastMedicalHistoryActivity.this, adapter, null, null); } } Log.i(TAG, String.valueOf(clickedNode.isTerminal())); if (!clickedNode.isTerminal() && clickedNode.isSelected()) { - imageName = patientUuid + "_" + visitUuid + "_" + image_Prefix; - String baseDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES).getAbsolutePath(); - filePath = new File(baseDir + File.separator + "Patient Images" + File.separator + - patientUuid + File.separator + visitUuid + File.separator + imageDir); + imageName = UUID.randomUUID().toString(); + Node.subLevelQuestion(clickedNode, PastMedicalHistoryActivity.this, adapter, filePath.toString(), imageName); } @@ -307,42 +299,33 @@ public void onGroupExpand(int groupPosition) { * @param value variable of type String * @return long */ - public long insertDb(String value) { - SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this); - - final String CREATOR_ID = prefs.getString("creatorid", null); - //TODO: Get the right creator_ID - - - String CONCEPT_ID = UuidDictionary.RHK_MEDICAL_HISTORY_BLURB; // RHK MEDICAL HISTORY BLURB - //Eventually will be stored in a separate table - - ContentValues complaintEntries = new ContentValues(); - - complaintEntries.put("uuid", UUID.randomUUID().toString()); - complaintEntries.put("encounteruuid", encounterAdultIntials); - complaintEntries.put("value", StringUtils.getValue(value)); - complaintEntries.put("conceptuuid", CONCEPT_ID); - complaintEntries.put("creator", CREATOR_ID); - complaintEntries.put("sync", "false"); - long insert = 0; + public boolean insertDb(String value) { + ObsDAO obsDAO = new ObsDAO(); + ObsDTO obsDTO = new ObsDTO(); + obsDTO.setConceptuuid(UuidDictionary.RHK_MEDICAL_HISTORY_BLURB); + obsDTO.setEncounteruuid(encounterAdultIntials); + obsDTO.setCreator(sessionManager.getCreatorID()); + obsDTO.setValue(io.intelehealth.client.utilities.StringUtils.getValue(value)); + boolean isInserted = false; try { - insert = localdb.insert("tbl_obs", null, complaintEntries); - } catch (SQLException sql) { - Crashlytics.getInstance().core.logException(sql); + isInserted = obsDAO.insertObs(obsDTO); + } catch (DAOException e) { + Crashlytics.getInstance().core.logException(e); } - return insert; + + return isInserted; } private void updateImageDatabase(String imagePath) { - localdb.execSQL("INSERT INTO image_records (patient_id,visit_id,image_path,image_type,delete_status) values(" - + "'" + patientUuid + "'" + "," - + visitUuid + "," - + "'" + imagePath + "','" + image_Prefix + "'," + - 0 + - ")"); + ImagesDAO imagesDAO = new ImagesDAO(); + + try { + imagesDAO.insertObsImageDatabase(imageName, encounterAdultIntials, ""); + } catch (DAOException e) { + Crashlytics.getInstance().core.logException(e); + } } @@ -353,20 +336,29 @@ private void updateImageDatabase(String imagePath) { * @return void */ private void updateDatabase(String string) { - String conceptID = UuidDictionary.RHK_MEDICAL_HISTORY_BLURB; - ContentValues contentValues = new ContentValues(); - contentValues.put("value", string); - contentValues.put("sync", "false"); - String selection = "encounteruuid = ? AND conceptuuid = ?"; - String[] args = {encounterAdultIntials, conceptID}; + ObsDTO obsDTO = new ObsDTO(); + ObsDAO obsDAO = new ObsDAO(); + try { + obsDTO.setConceptuuid(UuidDictionary.RHK_MEDICAL_HISTORY_BLURB); + obsDTO.setEncounteruuid(encounterAdultIntials); + obsDTO.setCreator(sessionManager.getCreatorID()); + obsDTO.setValue(string); + obsDTO.setUuid(obsDAO.getObsuuid(encounterAdultIntials, UuidDictionary.RHK_MEDICAL_HISTORY_BLURB)); + + obsDAO.updateObs(obsDTO); - localdb.update( - "tbl_obs", - contentValues, - selection, - args - ); + } catch (DAOException dao) { + Crashlytics.getInstance().core.logException(dao); + } + + EncounterDAO encounterDAO = new EncounterDAO(); + try { + encounterDAO.updateEncounterSync("false", encounterAdultIntials); + encounterDAO.updateEncounterModifiedDate(encounterAdultIntials); + } catch (DAOException e) { + Crashlytics.getInstance().core.logException(e); + } } @@ -390,7 +382,6 @@ public void onBackPressed() { @Override protected void onDestroy() { super.onDestroy(); - localdb.close(); } } diff --git a/app/src/main/java/io/intelehealth/client/activities/patientDetailActivity/PatientDetailActivity.java b/app/src/main/java/io/intelehealth/client/activities/patientDetailActivity/PatientDetailActivity.java old mode 100644 new mode 100755 index 2dfdd1169f..eebaaa6d38 --- a/app/src/main/java/io/intelehealth/client/activities/patientDetailActivity/PatientDetailActivity.java +++ b/app/src/main/java/io/intelehealth/client/activities/patientDetailActivity/PatientDetailActivity.java @@ -56,7 +56,6 @@ import io.intelehealth.client.database.dao.VisitsDAO; import io.intelehealth.client.knowledgeEngine.Node; import io.intelehealth.client.models.Patient; -import io.intelehealth.client.models.VisitUuidModel; import io.intelehealth.client.models.dto.EncounterDTO; import io.intelehealth.client.models.dto.VisitDTO; import io.intelehealth.client.utilities.DateAndTimeUtils; @@ -97,7 +96,7 @@ public class PatientDetailActivity extends AppCompatActivity { LinearLayout previousVisitsList; String visitValue; private String encounterVitals = ""; - private String encounterAdultIntials = null; + private String encounterAdultIntials = ""; SQLiteDatabase db = null; Button editbtn; Button newVisit; @@ -119,7 +118,7 @@ protected void onCreate(Bundle savedInstanceState) { Toolbar toolbar = findViewById(R.id.toolbar); setSupportActionBar(toolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(false); - db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); + db = AppConstants.inteleHealthDatabaseHelper.getWriteDb(); sessionManager = new SessionManager(this); reMyreceive = new Myreceiver(); filter = new IntentFilter("OpenmrsID"); @@ -281,7 +280,7 @@ protected void onStart() { protected void onDestroy() { unregisterReceiver(reMyreceive); super.onDestroy(); - db.close(); + } public void setDisplay(String dataString) { @@ -470,7 +469,6 @@ public void setDisplay(String dataString) { CardView histCardView = findViewById(R.id.cardView_history); histCardView.setVisibility(View.GONE); } else { - db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); visitUuidList = new ArrayList<>(); String visitIDSelection = "patientuuid = ?"; String[] visitIDArgs = {patientUuid}; @@ -484,8 +482,6 @@ public void setDisplay(String dataString) { if (visitIDCursor != null) { visitIDCursor.close(); } - VisitUuidModel visitUuidModel; - List visitUuidModelList = new ArrayList<>(); for (String visituuid : visitUuidList) { Logger.logD(TAG, visituuid); EncounterDAO encounterDAO = new EncounterDAO(); @@ -501,20 +497,13 @@ public void setDisplay(String dataString) { if (encounterDAO.getEncounterTypeUuid("ENCOUNTER_ADULTINITIAL").equalsIgnoreCase(encounterCursor.getString(encounterCursor.getColumnIndexOrThrow("encounter_type_uuid")))) { encounterAdultIntials = encounterCursor.getString(encounterCursor.getColumnIndexOrThrow("uuid")); } - visitUuidModel = new VisitUuidModel(encounterVitals, encounterAdultIntials); - visitUuidModelList.add(visitUuidModel); } while (encounterCursor.moveToNext()); } - for (VisitUuidModel uuidModel : visitUuidModelList) { - if (null != uuidModel.getEncounterAdultIntials() && !uuidModel.getEncounterAdultIntials().isEmpty()) { - familyHistory(famHistView, uuidModel.getEncounterAdultIntials()); - pastMedicalHistory(medHistView, uuidModel.getEncounterAdultIntials()); - - } - } encounterCursor.close(); } - pastVisits(patientUuid, encounterAdultIntials, visitUuid, encounterVitals); + familyHistory(famHistView, patientUuid); + pastMedicalHistory(medHistView, patientUuid); + pastVisits(patientUuid); } @@ -523,7 +512,6 @@ public void setDisplay(String dataString) { } public void profilePicDownloaded() { -// String url = "http://demo.intelehealth.io/openmrs/ws/rest/v1/personimage/" + patientUuid; UrlModifiers urlModifiers = new UrlModifiers(); String url = urlModifiers.patientProfileImageUrl(patientUuid); Logger.logD(TAG, "profileimage url" + url); @@ -570,9 +558,9 @@ public void onComplete() { Crashlytics.getInstance().core.logException(e); } if (isImageDownloaded) - AppConstants.notificationUtils.DownloadDone("Patient Image Download", "" + patient_new.getFirst_name() + "" + patient_new.getLast_name() + "'s Image Download complete.", getApplication()); + AppConstants.notificationUtils.DownloadDone("Patient Image Download", "" + patient_new.getFirst_name() + "" + patient_new.getLast_name() + "'s Image Download complete.", 4, getApplication()); else - AppConstants.notificationUtils.DownloadDone("Patient Image Download", "" + patient_new.getFirst_name() + "" + patient_new.getLast_name() + "'s Image Download Incomplete.", getApplication()); + AppConstants.notificationUtils.DownloadDone("Patient Image Download", "" + patient_new.getFirst_name() + "" + patient_new.getLast_name() + "'s Image Download Incomplete.", 4, getApplication()); } @@ -585,10 +573,7 @@ public void onComplete() { * @param datetime variable of type String. * @return void */ - private void createOldVisit(final String datetime, String end_datetime, String visitValue, String visitUuid, String encounterVitals, String encounterAdultIntials) throws ParseException { - // final LayoutInflater inflater = PatientDetailActivity.this.getLayoutInflater(); - // View convertView = inflater.inflate(R.layout.list_item_previous_visit, null); - // TextView textView = (TextView) convertView.findViewById(R.id.textView_visit_info); + private void createOldVisit(final String datetime, String visit_id, String end_datetime, String visitValue, String encounterVitalslocal, String encounterAdultIntialslocal) throws ParseException { final Boolean past_visit; final TextView textView = new TextView(this); @@ -667,42 +652,18 @@ private void createOldVisit(final String datetime, String end_datetime, String v (LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT); llp.setMargins(0, 0, 0, 0); textView.setLayoutParams(llp); -// textView.setTag(visit_id); + textView.setTag(visit_id); -// previousVisitsList.addView(textView); - /* textView.setOnTouchListener(new View.OnTouchListener() { - @Override - public boolean onTouch(View v, MotionEvent event) { - int action = event.getAction(); - - switch (action) { - case MotionEvent.ACTION_DOWN: - // Disallow ScrollView to intercept touch events. - Toast.makeText(PatientDetailActivity.this,"Touch Down",Toast.LENGTH_SHORT).show(); - v.getParent().getParent().getParent() - .requestDisallowInterceptTouchEvent(true); - break; - case MotionEvent.ACTION_UP: - // Allow ScrollView to intercept touch events. - Toast.makeText(PatientDetailActivity.this,"Touch Up",Toast.LENGTH_SHORT).show(); - v.getParent().getParent() - .requestDisallowInterceptTouchEvent(false); - - break; - } - return true; - } - });*/ textView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - // int position = (Integer) v.getTag(); +// int position = (Integer) v.getTag(); Intent visitSummary = new Intent(PatientDetailActivity.this, VisitSummaryActivity.class); - visitSummary.putExtra("visitUuid", visitUuid); + visitSummary.putExtra("visitUuid", visit_id); visitSummary.putExtra("patientUuid", patientUuid); - visitSummary.putExtra("encounterUuidVitals", encounterVitals); - visitSummary.putExtra("encounterUuidAdultIntial", encounterAdultIntials); + visitSummary.putExtra("encounterUuidVitals", encounterVitalslocal); + visitSummary.putExtra("encounterUuidAdultIntial", encounterAdultIntialslocal); visitSummary.putExtra("name", patientName); visitSummary.putExtra("tag", intentTag); visitSummary.putExtra("pastVisit", past_visit); @@ -751,61 +712,147 @@ public void onReceive(Context context, Intent intent) { } } - public void familyHistory(TextView famHistView, String encounterAdultIntials) { - db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); - String famHistSelection = "encounteruuid = ? AND conceptuuid = ?"; - String[] famHistArgs = {encounterAdultIntials, UuidDictionary.RHK_FAMILY_HISTORY_BLURB}; - String[] famHistColumns = {"value", " conceptuuid"}; - Cursor famHistCursor = db.query("tbl_obs", famHistColumns, famHistSelection, famHistArgs, null, null, null); - famHistCursor.moveToLast(); - String famHistValue; - - try { - famHistValue = famHistCursor.getString(famHistCursor.getColumnIndexOrThrow("value")); - } catch (Exception e) { - famHistValue = ""; - } finally { - famHistCursor.close(); - } + public void familyHistory(TextView famHistView, String patientuuid) { + String visitSelection = "patientuuid = ? AND enddate IS NULL OR enddate = ''"; + String[] visitArgs = {patientuuid}; + String[] visitColumns = {"uuid, startdate", "enddate"}; + String visitOrderBy = "startdate"; + Cursor visitCursor = db.query("tbl_visit", visitColumns, visitSelection, visitArgs, null, null, visitOrderBy); - if (famHistValue != null && !famHistValue.equals("")) { - famHistView.setText(Html.fromHtml(famHistValue)); + previousVisitsList = findViewById(R.id.linearLayout_previous_visits); + if (visitCursor.getCount() < 1) { +// neverSeen(); } else { - famHistView.setText(getString(R.string.string_no_hist)); - } - } - public void pastMedicalHistory(TextView medHistView, String encounterAdultIntials) { - String medHistSelection = "encounteruuid = ? AND conceptuuid = ?"; - String[] medHistArgs = {encounterAdultIntials, UuidDictionary.RHK_MEDICAL_HISTORY_BLURB}; - String[] medHistColumms = {"value", " conceptuuid"}; - Cursor medHistCursor = db.query("tbl_obs", medHistColumms, medHistSelection, medHistArgs, null, null, null); - medHistCursor.moveToLast(); + if (visitCursor.moveToLast() && visitCursor != null) { + do { + EncounterDAO encounterDAO = new EncounterDAO(); + String date = visitCursor.getString(visitCursor.getColumnIndexOrThrow("startdate")); + String end_date = visitCursor.getString(visitCursor.getColumnIndexOrThrow("enddate")); + String visit_id = visitCursor.getString(visitCursor.getColumnIndexOrThrow("uuid")); + + String encounterlocalAdultintial = ""; + String encountervitalsLocal = null; + String encounterIDSelection = "visituuid = ?"; + String[] encounterIDArgs = {visit_id}; - String medHistValue; + Cursor encounterCursor = db.query("tbl_encounter", null, encounterIDSelection, encounterIDArgs, null, null, null); + if (encounterCursor != null && encounterCursor.moveToFirst()) { + do { + if (encounterDAO.getEncounterTypeUuid("ENCOUNTER_VITALS").equalsIgnoreCase(encounterCursor.getString(encounterCursor.getColumnIndexOrThrow("encounter_type_uuid")))) { + encountervitalsLocal = encounterCursor.getString(encounterCursor.getColumnIndexOrThrow("uuid")); + } + if (encounterDAO.getEncounterTypeUuid("ENCOUNTER_ADULTINITIAL").equalsIgnoreCase(encounterCursor.getString(encounterCursor.getColumnIndexOrThrow("encounter_type_uuid")))) { + encounterlocalAdultintial = encounterCursor.getString(encounterCursor.getColumnIndexOrThrow("uuid")); + } - try { - medHistValue = medHistCursor.getString(medHistCursor.getColumnIndexOrThrow("value")); - } catch (Exception e) { - medHistValue = ""; - } finally { - medHistCursor.close(); + } while (encounterCursor.moveToNext()); + } + if (encounterCursor != null) { + encounterCursor.close(); + } + String famHistSelection = "encounteruuid = ? AND conceptuuid = ? And voided!='1'"; + String[] famHistArgs = {encounterlocalAdultintial, UuidDictionary.RHK_FAMILY_HISTORY_BLURB}; + String[] famHistColumns = {"value", " conceptuuid"}; + Cursor famHistCursor = db.query("tbl_obs", famHistColumns, famHistSelection, famHistArgs, null, null, null); + famHistCursor.moveToLast(); + String famHistValue; + + try { + famHistValue = famHistCursor.getString(famHistCursor.getColumnIndexOrThrow("value")); + } catch (Exception e) { + famHistValue = ""; + } finally { + famHistCursor.close(); + } + + if (famHistValue != null && !famHistValue.equals("")) { + famHistView.setText(Html.fromHtml(famHistValue)); + } else { + famHistView.setText(getString(R.string.string_no_hist)); + } + + } while (visitCursor.moveToPrevious()); + } + visitCursor.close(); } - if (medHistValue != null && !medHistValue.equals("")) { - medHistView.setText(Html.fromHtml(medHistValue)); + } + + public void pastMedicalHistory(TextView medHistView, String patientuuid) { + String visitSelection = "patientuuid = ? AND enddate IS NULL OR enddate = ''"; + String[] visitArgs = {patientuuid}; + String[] visitColumns = {"uuid, startdate", "enddate"}; + String visitOrderBy = "startdate"; + Cursor visitCursor = db.query("tbl_visit", visitColumns, visitSelection, visitArgs, null, null, visitOrderBy); + + previousVisitsList = findViewById(R.id.linearLayout_previous_visits); + if (visitCursor.getCount() < 1) { +// neverSeen(); } else { - medHistView.setText(getString(R.string.string_no_hist)); - } + if (visitCursor.moveToLast() && visitCursor != null) { + do { + EncounterDAO encounterDAO = new EncounterDAO(); + String date = visitCursor.getString(visitCursor.getColumnIndexOrThrow("startdate")); + String end_date = visitCursor.getString(visitCursor.getColumnIndexOrThrow("enddate")); + String visit_id = visitCursor.getString(visitCursor.getColumnIndexOrThrow("uuid")); + + String encounterlocalAdultintial = ""; + String encountervitalsLocal = null; + String encounterIDSelection = "visituuid = ?"; + + String[] encounterIDArgs = {visit_id}; + + Cursor encounterCursor = db.query("tbl_encounter", null, encounterIDSelection, encounterIDArgs, null, null, null); + if (encounterCursor != null && encounterCursor.moveToFirst()) { + do { + if (encounterDAO.getEncounterTypeUuid("ENCOUNTER_VITALS").equalsIgnoreCase(encounterCursor.getString(encounterCursor.getColumnIndexOrThrow("encounter_type_uuid")))) { + encountervitalsLocal = encounterCursor.getString(encounterCursor.getColumnIndexOrThrow("uuid")); + } + if (encounterDAO.getEncounterTypeUuid("ENCOUNTER_ADULTINITIAL").equalsIgnoreCase(encounterCursor.getString(encounterCursor.getColumnIndexOrThrow("encounter_type_uuid")))) { + encounterlocalAdultintial = encounterCursor.getString(encounterCursor.getColumnIndexOrThrow("uuid")); + } + + } while (encounterCursor.moveToNext()); + } + if (encounterCursor != null) { + encounterCursor.close(); + } + String medHistSelection = "encounteruuid = ? AND conceptuuid = ? And voided!='1'"; + String[] medHistArgs = {encounterlocalAdultintial, UuidDictionary.RHK_MEDICAL_HISTORY_BLURB}; + String[] medHistColumms = {"value", " conceptuuid"}; + Cursor medHistCursor = db.query("tbl_obs", medHistColumms, medHistSelection, medHistArgs, null, null, null); + medHistCursor.moveToLast(); + + + String medHistValue; + + try { + medHistValue = medHistCursor.getString(medHistCursor.getColumnIndexOrThrow("value")); + } catch (Exception e) { + medHistValue = ""; + } finally { + medHistCursor.close(); + } + + if (medHistValue != null && !medHistValue.equals("")) { + medHistView.setText(Html.fromHtml(medHistValue)); + } else { + medHistView.setText(getString(R.string.string_no_hist)); + } + } while (visitCursor.moveToPrevious()); + } + visitCursor.close(); + } } - public void pastVisits(String patientuuid, String encounterAdultIntials, String visituuid, String encounterVitals) { + public void pastVisits(String patientuuid) { String visitSelection = "patientuuid = ?"; String[] visitArgs = {patientuuid}; String[] visitColumns = {"uuid, startdate", "enddate"}; - String visitOrderBy = "uuid"; + String visitOrderBy = "startdate"; Cursor visitCursor = db.query("tbl_visit", visitColumns, visitSelection, visitArgs, null, null, visitOrderBy); previousVisitsList = findViewById(R.id.linearLayout_previous_visits); @@ -815,12 +862,34 @@ public void pastVisits(String patientuuid, String encounterAdultIntials, String if (visitCursor.moveToLast() && visitCursor != null) { do { + EncounterDAO encounterDAO = new EncounterDAO(); String date = visitCursor.getString(visitCursor.getColumnIndexOrThrow("startdate")); String end_date = visitCursor.getString(visitCursor.getColumnIndexOrThrow("enddate")); String visit_id = visitCursor.getString(visitCursor.getColumnIndexOrThrow("uuid")); - String previsitSelection = "encounteruuid = ? AND conceptuuid = ?"; - String[] previsitArgs = {encounterAdultIntials, UuidDictionary.CURRENT_COMPLAINT}; + String encounterlocalAdultintial = ""; + String encountervitalsLocal = null; + String encounterIDSelection = "visituuid = ?"; + + String[] encounterIDArgs = {visit_id}; + + Cursor encounterCursor = db.query("tbl_encounter", null, encounterIDSelection, encounterIDArgs, null, null, null); + if (encounterCursor != null && encounterCursor.moveToFirst()) { + do { + if (encounterDAO.getEncounterTypeUuid("ENCOUNTER_VITALS").equalsIgnoreCase(encounterCursor.getString(encounterCursor.getColumnIndexOrThrow("encounter_type_uuid")))) { + encountervitalsLocal = encounterCursor.getString(encounterCursor.getColumnIndexOrThrow("uuid")); + } + if (encounterDAO.getEncounterTypeUuid("ENCOUNTER_ADULTINITIAL").equalsIgnoreCase(encounterCursor.getString(encounterCursor.getColumnIndexOrThrow("encounter_type_uuid")))) { + encounterlocalAdultintial = encounterCursor.getString(encounterCursor.getColumnIndexOrThrow("uuid")); + } + + } while (encounterCursor.moveToNext()); + } + encounterCursor.close(); + + + String previsitSelection = "encounteruuid = ? AND conceptuuid = ? and voided !='1'"; + String[] previsitArgs = {encounterlocalAdultintial, UuidDictionary.CURRENT_COMPLAINT}; String[] previsitColumms = {"value", " conceptuuid", "encounteruuid"}; Cursor previsitCursor = db.query("tbl_obs", previsitColumms, previsitSelection, previsitArgs, null, null, null); if (previsitCursor.moveToLast() && previsitCursor != null) { @@ -847,7 +916,7 @@ public void pastVisits(String patientuuid, String encounterAdultIntials, String Date formatted = currentDate.parse(date); String visitDate = currentDate.format(formatted); - createOldVisit(visitDate, end_date, visitValue, visituuid, encounterVitals, encounterAdultIntials); + createOldVisit(visitDate, visit_id, end_date, visitValue, encountervitalsLocal, encounterlocalAdultintial); } catch (ParseException e) { Crashlytics.getInstance().core.logException(e); } @@ -860,7 +929,7 @@ public void pastVisits(String patientuuid, String encounterAdultIntials, String Date formatted = currentDate.parse(date); String visitDate = currentDate.format(formatted); - createOldVisit(visitDate, end_date, visitValue, visituuid, encounterVitals, encounterAdultIntials); + createOldVisit(visitDate, visit_id, end_date, visitValue, encountervitalsLocal, encounterlocalAdultintial); } catch (ParseException e) { Crashlytics.getInstance().core.logException(e); } @@ -873,7 +942,7 @@ public void pastVisits(String patientuuid, String encounterAdultIntials, String Date formatted = currentDate.parse(date); String visitDate = currentDate.format(formatted); - createOldVisit(visitDate, end_date, visitValue, visituuid, encounterVitals, encounterAdultIntials); + createOldVisit(visitDate, visit_id, end_date, visitValue, encountervitalsLocal, encounterlocalAdultintial); } catch (ParseException e) { Crashlytics.getInstance().core.logException(e); } diff --git a/app/src/main/java/io/intelehealth/client/activities/patientSurveyActivity/PatientSurveyActivity.java b/app/src/main/java/io/intelehealth/client/activities/patientSurveyActivity/PatientSurveyActivity.java old mode 100644 new mode 100755 index a84fa03522..51ada129e0 --- a/app/src/main/java/io/intelehealth/client/activities/patientSurveyActivity/PatientSurveyActivity.java +++ b/app/src/main/java/io/intelehealth/client/activities/patientSurveyActivity/PatientSurveyActivity.java @@ -2,14 +2,12 @@ import android.content.Context; import android.content.Intent; -import android.content.SharedPreferences; import android.database.sqlite.SQLiteDatabase; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.text.TextUtils; import android.util.Log; import android.view.View; -import android.widget.Button; import android.widget.EditText; import android.widget.ImageButton; import android.widget.TextView; @@ -26,7 +24,7 @@ import io.intelehealth.client.app.AppConstants; import io.intelehealth.client.database.dao.EncounterDAO; import io.intelehealth.client.database.dao.ObsDAO; -import io.intelehealth.client.database.dao.PullDataDAO; +import io.intelehealth.client.database.dao.SyncDAO; import io.intelehealth.client.database.dao.VisitsDAO; import io.intelehealth.client.models.dto.EncounterDTO; import io.intelehealth.client.models.dto.ObsDTO; @@ -78,7 +76,7 @@ protected void onCreate(Bundle savedInstanceState) { setContentView(R.layout.activity_patient_survey); setTitle(R.string.title_activity_login); sessionManager = new SessionManager(this); - db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); + db = AppConstants.inteleHealthDatabaseHelper.getWriteDb(); context = getApplicationContext(); mScaleButton1 = findViewById(R.id.button_scale_1); @@ -192,7 +190,7 @@ private void uploadSurvey() { } - AppConstants.notificationUtils.DownloadDone("Upload survey", "Survey uploaded", PatientSurveyActivity.this); + AppConstants.notificationUtils.DownloadDone("Upload survey", "Survey uploaded", 3, PatientSurveyActivity.this); } @@ -205,13 +203,14 @@ private void endVisit() { Crashlytics.getInstance().core.logException(e); } - PullDataDAO pullDataDAO = new PullDataDAO(); - pullDataDAO.pushDataApi(); - AppConstants.notificationUtils.DownloadDone("End visit", "Visit ended", PatientSurveyActivity.this); - SharedPreferences.Editor editor = context.getSharedPreferences(patientUuid + "_" + visitUuid, MODE_PRIVATE).edit(); - editor.remove("exam_" + patientUuid + "_" + visitUuid); - editor.commit(); + SyncDAO syncDAO = new SyncDAO(); + syncDAO.pushDataApi(); + + AppConstants.notificationUtils.DownloadDone("End visit", "Visit ended", 3, PatientSurveyActivity.this); + + sessionManager.removeVisitSummary(patientUuid, visitUuid); + Intent i = new Intent(this, HomeActivity.class); i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(i); diff --git a/app/src/main/java/io/intelehealth/client/activities/physcialExamActivity/CustomExpandableListAdapter.java b/app/src/main/java/io/intelehealth/client/activities/physcialExamActivity/CustomExpandableListAdapter.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/activities/physcialExamActivity/PhysicalExamActivity.java b/app/src/main/java/io/intelehealth/client/activities/physcialExamActivity/PhysicalExamActivity.java index 0a028559df..57d923fa32 100644 --- a/app/src/main/java/io/intelehealth/client/activities/physcialExamActivity/PhysicalExamActivity.java +++ b/app/src/main/java/io/intelehealth/client/activities/physcialExamActivity/PhysicalExamActivity.java @@ -1,18 +1,13 @@ package io.intelehealth.client.activities.physcialExamActivity; import android.app.Activity; -import android.content.ContentValues; -import android.content.Context; import android.content.DialogInterface; import android.content.Intent; -import android.content.SharedPreferences; import android.database.sqlite.SQLiteDatabase; -import android.graphics.Typeface; import android.graphics.drawable.Drawable; import android.os.Build; import android.os.Bundle; import android.os.Environment; -import android.preference.PreferenceManager; import android.support.design.widget.FloatingActionButton; import android.support.design.widget.TabLayout; import android.support.v4.app.Fragment; @@ -26,7 +21,6 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import android.widget.Button; import android.widget.ExpandableListView; import android.widget.ImageView; import android.widget.TextView; @@ -48,9 +42,12 @@ import io.intelehealth.client.R; import io.intelehealth.client.activities.visitSummaryActivity.VisitSummaryActivity; import io.intelehealth.client.app.AppConstants; +import io.intelehealth.client.database.dao.EncounterDAO; import io.intelehealth.client.database.dao.ImagesDAO; +import io.intelehealth.client.database.dao.ObsDAO; import io.intelehealth.client.knowledgeEngine.Node; import io.intelehealth.client.knowledgeEngine.PhysicalExam; +import io.intelehealth.client.models.dto.ObsDTO; import io.intelehealth.client.utilities.FileUtils; import io.intelehealth.client.utilities.SessionManager; import io.intelehealth.client.utilities.StringUtils; @@ -73,8 +70,6 @@ public class PhysicalExamActivity extends AppCompatActivity { SQLiteDatabase localdb; - private static String image_Prefix = "PE"; -// private static String imageDir = "Physical Exam"; static String imageName; static String baseDir; @@ -90,21 +85,20 @@ public class PhysicalExamActivity extends AppCompatActivity { Boolean complaintConfirmed = false; String encounterVitals; String encounterAdultIntials; - SessionManager sessionManager; @Override protected void onCreate(Bundle savedInstanceState) { baseDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES).getAbsolutePath(); - localdb = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); - + localdb = AppConstants.inteleHealthDatabaseHelper.getWriteDb(); + sessionManager = new SessionManager(this); AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this); - alertDialogBuilder.setTitle(R.string.wash_hands); + alertDialogBuilder.setMessage(R.string.wash_hands); LayoutInflater factory = LayoutInflater.from(this); final View view = factory.inflate(R.layout.hand_wash, null); alertDialogBuilder.setView(view); - alertDialogBuilder.setPositiveButton(R.string.generic_ok, new DialogInterface.OnClickListener() { + alertDialogBuilder.setNeutralButton(R.string.generic_ok, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); @@ -113,14 +107,6 @@ public void onClick(DialogInterface dialog, int which) { AlertDialog alertDialog = alertDialogBuilder.create(); alertDialog.show(); - sessionManager = new SessionManager(this); - - Button pb = alertDialog.getButton(AlertDialog.BUTTON_POSITIVE); - pb.setTextColor(getResources().getColor((R.color.colorPrimary))); - pb.setTypeface(Typeface.DEFAULT,Typeface.BOLD); - - //For Testing -// patientID = Long.valueOf("1"); selectedExamsList = new ArrayList<>(); Intent intent = this.getIntent(); // The intent was passed to the activity if (intent != null) { @@ -131,23 +117,16 @@ public void onClick(DialogInterface dialog, int which) { state = intent.getStringExtra("state"); patientName = intent.getStringExtra("name"); intentTag = intent.getStringExtra("tag"); - // selectedExamsList = intent.getStringArrayListExtra("exams"); -// Log.v(TAG, "Patient ID: " + patientID); -// Log.v(TAG, "Visit ID: " + visitID); -// Log.v(TAG, "Patient Name: " + patientName); -// Log.v(TAG, "Intent Tag: " + intentTag); - SharedPreferences mSharedPreference = this.getSharedPreferences( - "visit_summary", Context.MODE_PRIVATE); - Set selectedExams = mSharedPreference.getStringSet("exam_" + patientUuid, null); + Set selectedExams = sessionManager.getVisitSummary(patientUuid); selectedExamsList.clear(); if (selectedExams != null) selectedExamsList.addAll(selectedExams); filePath = new File(AppConstants.IMAGE_PATH); } - if ((selectedExamsList == null) || selectedExamsList.isEmpty()) { Log.d(TAG, "No additional exams were triggered"); + physicalExamMap = new PhysicalExam(FileUtils.encodeJSON(this, mFileName), selectedExamsList); } else { Set selectedExamsWithoutDuplicates = new LinkedHashSet<>(selectedExamsList); Log.d(TAG, selectedExamsList.toString()); @@ -156,10 +135,8 @@ public void onClick(DialogInterface dialog, int which) { Log.d(TAG, selectedExamsList.toString()); for (String string : selectedExamsList) Log.d(TAG, string); - SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); boolean hasLicense = false; -// if (sharedPreferences.contains("licensekey")) - if (!sessionManager.getLicenseKey().isEmpty()) + if (sessionManager.getLicenseKey() != null && !sessionManager.getLicenseKey().isEmpty()) hasLicense = true; if (hasLicense) { @@ -173,7 +150,6 @@ public void onClick(DialogInterface dialog, int which) { } else { physicalExamMap = new PhysicalExam(FileUtils.encodeJSON(this, mFileName), selectedExamsList); } - //physicalExamMap = new PhysicalExam(HelperMethods.encodeJSON(this, mFileName), selectedExamsList); } super.onCreate(savedInstanceState); @@ -242,14 +218,13 @@ public void onClick(View view) { intent.putExtra("state", state); intent.putExtra("name", patientName); intent.putExtra("tag", intentTag); - intent.putExtra("hasPrescription", "false"); for (String exams : selectedExamsList) { Log.i(TAG, "onClick:++ " + exams); } // intent.putStringArrayListExtra("exams", selectedExamsList); startActivity(intent); } else { - long obsId = insertDb(physicalString); + boolean obsId = insertDb(physicalString); Intent intent1 = new Intent(PhysicalExamActivity.this, VisitSummaryActivity.class); // earlier visitsummary intent1.putExtra("patientUuid", patientUuid); intent1.putExtra("visitUuid", visitUuid); @@ -258,7 +233,6 @@ public void onClick(View view) { intent1.putExtra("state", state); intent1.putExtra("name", patientName); intent1.putExtra("tag", intentTag); - intent1.putExtra("hasPrescription", "false"); // intent1.putStringArrayListExtra("exams", selectedExamsList); startActivity(intent1); } @@ -266,41 +240,28 @@ public void onClick(View view) { } else { questionsMissing(); } -// Node genExams = physicalExamMap.getOption(0); -// for (int i = 0; i < genExams.getOptionsList().size(); i++) { -//// Log.d(TAG, "current i value " + i); -// if(!genExams.getOption(i).anySubSelected()){ -//// Log.d(TAG, genExams.getOption(i).getText()); -// mViewPager.setCurrentItem(i); -// return; -// } -// } - } }); } - private long insertDb(String value) { + private boolean insertDb(String value) { Log.i(TAG, "insertDb: "); - SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this); - localdb = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); - final String CREATOR_ID = prefs.getString("creatorid", null); - - final String CONCEPT_ID = UuidDictionary.PHYSICAL_EXAMINATION; // RHK ON EXAM - - ContentValues complaintEntries = new ContentValues(); - -// complaintEntries.put("patient_id", patientUuid); -// complaintEntries.put("visit_id", visitUuid); - complaintEntries.put("uuid", UUID.randomUUID().toString()); - complaintEntries.put("encounteruuid", encounterAdultIntials); - complaintEntries.put("creator", CREATOR_ID); - complaintEntries.put("value", StringUtils.getValue(value)); - complaintEntries.put("conceptuuid", CONCEPT_ID); + ObsDAO obsDAO = new ObsDAO(); + ObsDTO obsDTO = new ObsDTO(); + obsDTO.setConceptuuid(UuidDictionary.PHYSICAL_EXAMINATION); + obsDTO.setEncounteruuid(encounterAdultIntials); + obsDTO.setCreator(sessionManager.getCreatorID()); + obsDTO.setValue(StringUtils.getValue(value)); + boolean isInserted = false; + try { + isInserted = obsDAO.insertObs(obsDTO); + } catch (DAOException e) { + Crashlytics.getInstance().core.logException(e); + } - return localdb.insert("tbl_obs", null, complaintEntries); + return isInserted; } /** @@ -336,25 +297,28 @@ public CharSequence getPageTitle(int position) { } private void updateDatabase(String string) { + ObsDTO obsDTO = new ObsDTO(); + ObsDAO obsDAO = new ObsDAO(); + try { + obsDTO.setConceptuuid(UuidDictionary.PHYSICAL_EXAMINATION); + obsDTO.setEncounteruuid(encounterAdultIntials); + obsDTO.setCreator(sessionManager.getCreatorID()); + obsDTO.setValue(string); + obsDTO.setUuid(obsDAO.getObsuuid(encounterAdultIntials, UuidDictionary.PHYSICAL_EXAMINATION)); + + obsDAO.updateObs(obsDTO); - String conceptID = UuidDictionary.PHYSICAL_EXAMINATION; - ContentValues contentValues = new ContentValues(); - contentValues.put("value", string); - localdb = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); - String selection = "encounteruuid = ? AND conceptuuid = ?"; - String[] args = {encounterAdultIntials, conceptID}; - - int i = localdb.update( - "tbl_obs", - contentValues, - selection, - args - ); - Log.i(TAG, "updateDatabase: " + i); - if (i == 0) { - insertDb(string); + } catch (DAOException dao) { + Crashlytics.getInstance().core.logException(dao); + } + + EncounterDAO encounterDAO = new EncounterDAO(); + try { + encounterDAO.updateEncounterSync("false", encounterAdultIntials); + encounterDAO.updateEncounterModifiedDate(encounterAdultIntials); + } catch (DAOException e) { + Crashlytics.getInstance().core.logException(e); } - localdb.close(); } public void questionsMissing() { @@ -378,13 +342,6 @@ private void updateImageDatabase() { } catch (DAOException e) { Crashlytics.getInstance().core.logException(e); } - -// localdb.execSQL("INSERT INTO image_records (patient_id,visit_id,image_path,image_type,delete_status) values(" -// + "'" + patientUuid + "'" + "," -// + visitUuid + "," -// + "'" + imagePath + "','" + image_Prefix + "'," + -// 0 + -// ")"); } @Override @@ -444,8 +401,6 @@ public View onCreateView(LayoutInflater inflater, final ViewGroup container, final ImageView imageView = rootView.findViewById(R.id.physical_exam_image_view); TextView textView = rootView.findViewById(R.id.physical_exam_text_view); ExpandableListView expandableListView = rootView.findViewById(R.id.physical_exam_expandable_list_view); - //ListView listView = (ListView) rootView.findViewById(R.id.physical_exam_list_view); - //VideoView videoView = (VideoView) rootView.findViewById(R.id.physical_exam_video_view); int viewNumber = getArguments().getInt(ARG_SECTION_NUMBER); final String patientUuid1 = getArguments().getString("patientUuid"); @@ -460,7 +415,6 @@ public View onCreateView(LayoutInflater inflater, final ViewGroup container, if (displayNode.isAidAvailable()) { String type = displayNode.getJobAidType(); - //Log.d(displayNode.getText(), type); if (type.equals("video")) { imageView.setVisibility(View.GONE); } else if (type.equals("image")) { diff --git a/app/src/main/java/io/intelehealth/client/activities/privacyNoticeActivity/PrivacyNotice_Activity.java b/app/src/main/java/io/intelehealth/client/activities/privacyNoticeActivity/PrivacyNotice_Activity.java index 719bf7a28b..8ce3aa27b9 100644 --- a/app/src/main/java/io/intelehealth/client/activities/privacyNoticeActivity/PrivacyNotice_Activity.java +++ b/app/src/main/java/io/intelehealth/client/activities/privacyNoticeActivity/PrivacyNotice_Activity.java @@ -3,9 +3,8 @@ import android.app.Activity; import android.content.Intent; import android.content.SharedPreferences; -import android.support.v7.app.AppCompatActivity; import android.os.Bundle; -import android.support.v7.widget.Toolbar; +import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.RadioButton; import android.widget.RadioGroup; @@ -19,9 +18,7 @@ import io.intelehealth.client.R; import io.intelehealth.client.activities.identificationActivity.IdentificationActivity; -import io.intelehealth.client.activities.settingsActivity.SettingsActivity; import io.intelehealth.client.app.AppConstants; -import io.intelehealth.client.utilities.ConfigUtils; import io.intelehealth.client.utilities.FileUtils; import io.intelehealth.client.utilities.SessionManager; @@ -40,32 +37,17 @@ protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_privacy_notice_2); - /* - * Toolbar which displays back arrow on action bar - * Add the below lines for every activity*/ - Toolbar toolbar = findViewById(R.id.toolbar); - setSupportActionBar(toolbar); - getSupportActionBar().setDisplayHomeAsUpEnabled(true); - - toolbar.setNavigationOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - onBackPressed(); - } - }); - sessionManager = new SessionManager(this); - privacy_textview = (TextView) findViewById(R.id.privacy_text); + privacy_textview = findViewById(R.id.privacy_text); - radiogrp = (RadioGroup) findViewById(R.id.radio_privacy_grp); - radio_acc = (RadioButton) findViewById(R.id.radio_accept); - radio_rej = (RadioButton) findViewById(R.id.radio_reject); + radiogrp = findViewById(R.id.radio_privacy_grp); + radio_acc = findViewById(R.id.radio_accept); + radio_rej = findViewById(R.id.radio_reject); - txt_next = (TextView) findViewById(R.id.txt_privacy); + txt_next = findViewById(R.id.txt_privacy); -// if (sessionManager.valueContains("licensekey")) - if (!sessionManager.getLicenseKey().isEmpty()) + if (sessionManager.valueContains("licensekey")) hasLicense = true; //Check for license key and load the correct config file @@ -122,7 +104,7 @@ else if(sharedPreferences.getAll().values().contains("or")) public void onClick(View view) { int selected_radio = radiogrp.getCheckedRadioButtonId(); - radiobtn = (RadioButton) findViewById(selected_radio); + radiobtn = findViewById(selected_radio); if (radio_acc.isChecked() || radio_rej.isChecked()) { @@ -150,8 +132,6 @@ public void onClick(View view) { } catch (JSONException e) { Crashlytics.getInstance().core.logException(e); -// Issue #627 -// added the catch exception to check the config and throwing back to setup activity Toast.makeText(getApplicationContext(), "JsonException" + e, Toast.LENGTH_LONG).show(); } diff --git a/app/src/main/java/io/intelehealth/client/activities/questionNodeActivity/QuestionNodeActivity.java b/app/src/main/java/io/intelehealth/client/activities/questionNodeActivity/QuestionNodeActivity.java index 0b0047b561..b6c89b3306 100644 --- a/app/src/main/java/io/intelehealth/client/activities/questionNodeActivity/QuestionNodeActivity.java +++ b/app/src/main/java/io/intelehealth/client/activities/questionNodeActivity/QuestionNodeActivity.java @@ -1,14 +1,9 @@ package io.intelehealth.client.activities.questionNodeActivity; -import android.content.ContentValues; -import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.SharedPreferences; -import android.database.sqlite.SQLiteDatabase; import android.os.Bundle; -import android.os.Environment; -import android.preference.PreferenceManager; import android.support.design.widget.FloatingActionButton; import android.support.v7.app.AlertDialog; import android.support.v7.app.AppCompatActivity; @@ -17,20 +12,16 @@ import android.util.Log; import android.view.View; import android.widget.ExpandableListView; -import android.widget.Toast; import com.crashlytics.android.Crashlytics; -import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import java.io.File; import java.util.ArrayList; import java.util.Arrays; -import java.util.Collection; import java.util.HashMap; -import java.util.HashSet; import java.util.LinkedHashSet; import java.util.List; import java.util.Set; @@ -41,11 +32,16 @@ import io.intelehealth.client.activities.physcialExamActivity.CustomExpandableListAdapter; import io.intelehealth.client.activities.physcialExamActivity.PhysicalExamActivity; import io.intelehealth.client.app.AppConstants; +import io.intelehealth.client.database.dao.EncounterDAO; +import io.intelehealth.client.database.dao.ImagesDAO; +import io.intelehealth.client.database.dao.ObsDAO; import io.intelehealth.client.knowledgeEngine.Node; +import io.intelehealth.client.models.dto.ObsDTO; import io.intelehealth.client.utilities.FileUtils; import io.intelehealth.client.utilities.SessionManager; import io.intelehealth.client.utilities.StringUtils; import io.intelehealth.client.utilities.UuidDictionary; +import io.intelehealth.client.utilities.exception.DAOException; public class QuestionNodeActivity extends AppCompatActivity { final String TAG = "Question Node Activity"; @@ -58,6 +54,7 @@ public class QuestionNodeActivity extends AppCompatActivity { String imageName; File filePath; Boolean complaintConfirmed = false; + SessionManager sessionManager = null; // Knowledge mKnowledge; //Knowledge engine ExpandableListView questionListView; @@ -72,24 +69,16 @@ public class QuestionNodeActivity extends AppCompatActivity { CustomExpandableListAdapter adapter; boolean nodeComplete = false; - String image_Prefix = "QN"; - String imageDir = "Question Node"; int lastExpandedPosition = -1; String insertion = ""; private SharedPreferences prefs; private String encounterVitals; private String encounterAdultIntials; - SessionManager sessionManager; - private List optionsList = new ArrayList<>(); - Node assoSympNode; - Node optionSympNode; - private JSONObject assoSympObj = new JSONObject(); - private JSONArray assoSympArr = new JSONArray(); - private JSONObject finalAssoSympObj = new JSONObject(); - @Override protected void onCreate(Bundle savedInstanceState) { + sessionManager = new SessionManager(this); + filePath = new File(AppConstants.IMAGE_PATH); Intent intent = this.getIntent(); // The intent was passed to the activity if (intent != null) { patientUuid = intent.getStringExtra("patientUuid"); @@ -100,22 +89,13 @@ protected void onCreate(Bundle savedInstanceState) { patientName = intent.getStringExtra("name"); intentTag = intent.getStringExtra("tag"); complaints = intent.getStringArrayListExtra("complaints"); -// Log.v(TAG, "Patient ID: " + patientID); -// Log.v(TAG, "Visit ID: " + visitID); -// Log.v(TAG, "Patient Name: " + patientName); -// Log.v(TAG, "Intent Tag: " + intentTag); } complaintDetails = new HashMap<>(); physicalExams = new ArrayList<>(); -//mKnowledge = new Knowledge(HelperMethods.encodeJSON(this, mFileName)); complaintsNodes = new ArrayList<>(); - sessionManager = new SessionManager(this); - - SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); boolean hasLicense = false; -// if (sharedPreferences.contains("licensekey")) - if (!sessionManager.getLicenseKey().isEmpty()) + if (sessionManager.getLicenseKey() != null && !sessionManager.getLicenseKey().isEmpty()) hasLicense = true; JSONObject currentFile = null; @@ -156,12 +136,6 @@ public void onClick(View view) { questionListView.setOnChildClickListener(new ExpandableListView.OnChildClickListener() { @Override public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) { - - imageName = patientUuid + "_" + visitUuid + "_" + image_Prefix; - String baseDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES).getAbsolutePath(); - filePath = new File(baseDir + File.separator + "Patient Images" + File.separator + - patientUuid + File.separator + visitUuid + File.separator + imageDir); - if ((currentNode.getOption(groupPosition).getChoiceType().equals("single")) && !currentNode.getOption(groupPosition).anySubSelected()) { Node question = currentNode.getOption(groupPosition).getOption(childPosition); question.toggleSelected(); @@ -177,6 +151,7 @@ public boolean onChildClick(ExpandableListView parent, View v, int groupPosition if (!filePath.exists()) { filePath.mkdirs(); } + imageName = UUID.randomUUID().toString(); Node.handleQuestion(question, QuestionNodeActivity.this, adapter, filePath.toString(), imageName); } else { Node.handleQuestion(question, QuestionNodeActivity.this, adapter, null, null); @@ -255,29 +230,11 @@ public void onGroupExpand(int groupPosition) { * All exams are also stored into a string, which will be passed through the activities to the Physical Exam Activity. */ private void fabClick() { -// for (int i = 0; i < adapter.getGroupCount(); i++) { -// if (!currentNode.getOption(i).isSelected()) { -// nodeComplete = false; -// questionListView.expandGroup(i); -// break; -// } else { -// nodeComplete = true; -// } -// } nodeComplete = true; if (!complaintConfirmed) { questionsMissing(); } else { - - //TODO: Under this new scheme where there is just a list of existing JSONS, need to parse out associated symptomsArrayList selectedAssociations = currentNode.getSelectedAssociations(); -// for (int i = 0; i < selectedAssociations.size(); i++) { -// if (!complaints.contains(selectedAssociations.get(i))) { -// complaints.add(selectedAssociations.get(i)); -// complaintsNodes.add(mKnowledge.getComplaint(selectedAssociations.get(i))); -// } -// } - List imagePathList = currentNode.getImagePathList(); if (imagePathList != null) { @@ -295,6 +252,9 @@ private void fabClick() { // complaintDetails.put(complaint, complaintFormatted); insertion = insertion.concat(Node.bullet_arrow + "" + complaint + "" + ": " + Node.next_line + complaintString + " "); + } else { + String complaint = currentNode.getText(); + insertion = insertion.concat(Node.bullet_arrow + "" + complaint + "" + ": " + Node.next_line + " "); } ArrayList selectedAssociatedComplaintsList = currentNode.getSelectedAssociations(); if (selectedAssociatedComplaintsList != null && !selectedAssociatedComplaintsList.isEmpty()) { @@ -314,17 +274,13 @@ private void fabClick() { physicalExams.addAll(childNodeSelectedPhysicalExams); //For Selected child nodes ArrayList rootNodePhysicalExams = parseExams(currentNode); - if (!rootNodePhysicalExams.isEmpty()) + if (rootNodePhysicalExams != null && !rootNodePhysicalExams.isEmpty()) physicalExams.addAll(rootNodePhysicalExams); //For Root Node if (complaintNumber < complaints.size() - 1) { complaintNumber++; setupQuestions(complaintNumber); complaintConfirmed = false; - } else if (complaints.size() > 1 && complaintNumber == complaints.size() - 1) { - complaintNumber++; - removeDuplicateSymptoms(); - complaintConfirmed = false; } else { if (intentTag != null && intentTag.equals("edit")) { Log.i(TAG, "fabClick: update" + insertion); @@ -337,13 +293,10 @@ private void fabClick() { intent.putExtra("state", state); intent.putExtra("name", patientName); intent.putExtra("tag", intentTag); - SharedPreferences sharedPreference = this.getSharedPreferences( - "visit_summary", Context.MODE_PRIVATE); - SharedPreferences.Editor editor = sharedPreference.edit(); + Set selectedExams = new LinkedHashSet<>(physicalExams); - editor.putStringSet("exam_" + patientUuid, selectedExams); - editor.commit(); - //intent.putStringArrayListExtra("exams", physicalExams); + sessionManager.setVisitSummary(patientUuid, selectedExams); + startActivity(intent); } else { Log.i(TAG, "fabClick: " + insertion); @@ -356,13 +309,9 @@ private void fabClick() { intent.putExtra("state", state); intent.putExtra("name", patientName); intent.putExtra("tag", intentTag); - SharedPreferences sharedPreference = this.getSharedPreferences( - "visit_summary", Context.MODE_PRIVATE); - SharedPreferences.Editor editor = sharedPreference.edit(); Set selectedExams = new LinkedHashSet<>(physicalExams); - editor.putStringSet("exam_" + patientUuid, selectedExams); - editor.commit(); - //intent.putStringArrayListExtra("exams", physicalExams); + sessionManager.setVisitSummary(patientUuid, selectedExams); + startActivity(intent); } } @@ -371,7 +320,6 @@ private void fabClick() { } - /** * Insert into DB could be made into a Helper Method, but isn't because there are specific concept IDs used each time. * Although this could also be made into a function, for now it has now been. @@ -379,67 +327,63 @@ private void fabClick() { * @param value String to put into DB * @return DB Row number, never used */ - private long insertDb(String value) { + private boolean insertDb(String value) { Log.i(TAG, "insertDb: " + patientUuid + " " + visitUuid + " " + UuidDictionary.CURRENT_COMPLAINT); + ObsDAO obsDAO = new ObsDAO(); + ObsDTO obsDTO = new ObsDTO(); + obsDTO.setConceptuuid(UuidDictionary.CURRENT_COMPLAINT); + obsDTO.setEncounteruuid(encounterAdultIntials); + obsDTO.setCreator(sessionManager.getCreatorID()); + obsDTO.setValue(StringUtils.getValue1(value)); + boolean isInserted = false; + try { + isInserted = obsDAO.insertObs(obsDTO); + } catch (DAOException e) { + Crashlytics.getInstance().core.logException(e); + } - prefs = PreferenceManager.getDefaultSharedPreferences(this); - - String CREATOR_ID = prefs.getString("creatorid", null); - - String CONCEPT_ID = UuidDictionary.CURRENT_COMPLAINT; //OpenMRS complaint concept ID - - ContentValues complaintEntries = new ContentValues(); - complaintEntries.put("uuid", UUID.randomUUID().toString()); - complaintEntries.put("encounteruuid", encounterAdultIntials); - complaintEntries.put("creator", CREATOR_ID); - complaintEntries.put("value", StringUtils.getValue(value)); - complaintEntries.put("conceptuuid", CONCEPT_ID); - complaintEntries.put("sync", "false"); - - SQLiteDatabase localdb = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); - long insertedvalues = localdb.insert("tbl_obs", null, complaintEntries); - localdb.close(); - - return insertedvalues; + return isInserted; } private void updateImageDatabase(String imagePath) { - SQLiteDatabase localdb = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); - localdb.execSQL("INSERT INTO image_records (patient_id,visit_id,image_path,image_type,delete_status) values(" - + "'" + patientUuid + "'" + "," - + visitUuid + "," - + "'" + imagePath + "','" + "CO" + "'," + - 0 + - ")"); - localdb.close(); + + ImagesDAO imagesDAO = new ImagesDAO(); + + try { + imagesDAO.insertObsImageDatabase(imageName, encounterAdultIntials, ""); + } catch (DAOException e) { + Crashlytics.getInstance().core.logException(e); + } } private void updateDatabase(String string) { Log.i(TAG, "updateDatabase: " + patientUuid + " " + visitUuid + " " + UuidDictionary.CURRENT_COMPLAINT); - SQLiteDatabase localdb = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); - - String conceptID = UuidDictionary.CURRENT_COMPLAINT; - ContentValues contentValues = new ContentValues(); - contentValues.put("value", string); - contentValues.put("sync", "false"); - - String selection = "encounteruuid = ? AND conceptuuid = ?"; - String[] args = {encounterVitals, conceptID}; - - int i = localdb.update( - "tbl_obs", - contentValues, - selection, - args - ); - localdb.close(); - if (i == 0) { - insertDb(string); +// } + ObsDTO obsDTO = new ObsDTO(); + ObsDAO obsDAO = new ObsDAO(); + try { + obsDTO.setConceptuuid(UuidDictionary.CURRENT_COMPLAINT); + obsDTO.setEncounteruuid(encounterAdultIntials); + obsDTO.setCreator(sessionManager.getCreatorID()); + obsDTO.setValue(string); + obsDTO.setUuid(obsDAO.getObsuuid(encounterAdultIntials, UuidDictionary.CURRENT_COMPLAINT)); + + obsDAO.updateObs(obsDTO); + + } catch (DAOException dao) { + Crashlytics.getInstance().core.logException(dao); } + EncounterDAO encounterDAO = new EncounterDAO(); + try { + encounterDAO.updateEncounterSync("false", encounterAdultIntials); + encounterDAO.updateEncounterModifiedDate(encounterAdultIntials); + } catch (DAOException e) { + Crashlytics.getInstance().core.logException(e); + } } @@ -449,94 +393,13 @@ private void updateDatabase(String string) { * @param complaintIndex Index of complaint being displayed to user. */ private void setupQuestions(int complaintIndex) { - nodeComplete = false; - - if (complaints.size() > 1) { - getAssociatedSymptoms(complaintIndex); - } else { - currentNode = complaintsNodes.get(complaintIndex); - } - + currentNode = complaintsNodes.get(complaintIndex); adapter = new CustomExpandableListAdapter(this, currentNode, this.getClass().getSimpleName()); questionListView.setAdapter(adapter); questionListView.setChoiceMode(ExpandableListView.CHOICE_MODE_MULTIPLE); questionListView.expandGroup(0); setTitle(patientName + ": " + currentNode.findDisplay()); - - } - - private void getAssociatedSymptoms(int complaintIndex) { - - List assoComplaintsNodes = new ArrayList<>(); - assoComplaintsNodes.addAll(complaintsNodes); - - for (int i = 0; i < complaintsNodes.get(complaintIndex).size(); i++) { - - if (complaintsNodes.get(complaintIndex).getOptionsList().get(i).getText() - .equalsIgnoreCase("Associated symptoms")) { - - optionsList.addAll(complaintsNodes.get(complaintIndex).getOptionsList().get(i).getOptionsList()); - - assoComplaintsNodes.get(complaintIndex).getOptionsList().remove(i); - currentNode = assoComplaintsNodes.get(complaintIndex); - Log.e("CurrentNode", "" + currentNode); - - } - } - } - - private void removeDuplicateSymptoms() { - - nodeComplete = false; - - HashSet hashSet = new HashSet<>(); - - List finalOptionsList = new ArrayList<>(optionsList); - - if (optionsList.size() != 0) { - - for (int i = 0; i < optionsList.size(); i++) { - - if (hashSet.contains(optionsList.get(i).getText())) { - - finalOptionsList.remove(optionsList.get(i)); - - } else { - hashSet.add(optionsList.get(i).getText()); - } - } - - try { - assoSympObj.put("id", "ID_294177528"); - assoSympObj.put("text", "Associated symptoms"); - assoSympObj.put("display", "Do you have the following symptom(s)?"); - assoSympObj.put("display-or", "ତମର ଏହି ଲକ୍ଷଣ ସବୁ ଅଛି କି?"); - assoSympObj.put("pos-condition", "c."); - assoSympObj.put("neg-condition", "s."); - assoSympArr.put(0, assoSympObj); - finalAssoSympObj.put("id", "ID_844006222"); - finalAssoSympObj.put("text", "Associated symptoms"); - finalAssoSympObj.put("display-or", "ପେଟଯନ୍ତ୍ରଣା"); - finalAssoSympObj.put("perform-physical-exam", ""); - finalAssoSympObj.put("options", assoSympArr); - - } catch (JSONException e) { - e.printStackTrace(); - } - - assoSympNode = new Node(finalAssoSympObj); - assoSympNode.getOptionsList().get(0).setOptionsList(finalOptionsList); - assoSympNode.getOptionsList().get(0).setTerminal(false); - - currentNode = assoSympNode; - adapter = new CustomExpandableListAdapter(this, currentNode, this.getClass().getSimpleName()); - questionListView.setAdapter(adapter); - questionListView.setChoiceMode(ExpandableListView.CHOICE_MODE_MULTIPLE); - questionListView.expandGroup(0); - setTitle(patientName + ": " + currentNode.getText()); - - } } //Dialog Alert forcing user to answer all questions. diff --git a/app/src/main/java/io/intelehealth/client/activities/searchPatientActivity/SearchPatientActivity.java b/app/src/main/java/io/intelehealth/client/activities/searchPatientActivity/SearchPatientActivity.java old mode 100644 new mode 100755 index e94d358006..c2e2f16b0a --- a/app/src/main/java/io/intelehealth/client/activities/searchPatientActivity/SearchPatientActivity.java +++ b/app/src/main/java/io/intelehealth/client/activities/searchPatientActivity/SearchPatientActivity.java @@ -5,9 +5,12 @@ import android.content.DialogInterface; import android.content.Intent; import android.database.Cursor; +import android.database.SQLException; import android.database.sqlite.SQLiteDatabase; +import android.graphics.drawable.Drawable; import android.os.Bundle; import android.provider.SearchRecentSuggestions; +import android.support.v4.content.ContextCompat; import android.support.v7.app.AlertDialog; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.DefaultItemAnimator; @@ -25,13 +28,14 @@ import android.widget.ListView; import android.widget.TextView; +import com.crashlytics.android.Crashlytics; + import java.util.ArrayList; import java.util.List; import io.intelehealth.client.R; import io.intelehealth.client.activities.homeActivity.HomeActivity; import io.intelehealth.client.app.AppConstants; -import io.intelehealth.client.database.InteleHealthDatabaseHelper; import io.intelehealth.client.database.dao.ProviderDAO; import io.intelehealth.client.models.dto.PatientDTO; import io.intelehealth.client.utilities.Logger; @@ -41,7 +45,6 @@ public class SearchPatientActivity extends AppCompatActivity { SearchView searchView; - InteleHealthDatabaseHelper mDbHelper; String query; private SearchPatientAdapter recycler; RecyclerView recyclerView; @@ -57,17 +60,16 @@ protected void onCreate(Bundle savedInstanceState) { setContentView(R.layout.activity_search_patient); Toolbar toolbar = findViewById(R.id.toolbar); -// Drawable drawable = ContextCompat.getDrawable(getApplicationContext(), -// R.drawable.ic_sort_white_24dp); -// toolbar.setOverflowIcon(drawable); + Drawable drawable = ContextCompat.getDrawable(getApplicationContext(), + R.drawable.ic_sort_white_24dp); + toolbar.setOverflowIcon(drawable); setSupportActionBar(toolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayShowTitleEnabled(false); // Get the intent, verify the action and get the query sessionManager = new SessionManager(this); - mDbHelper = new InteleHealthDatabaseHelper(this); - db = mDbHelper.getWritableDatabase(); + db = AppConstants.inteleHealthDatabaseHelper.getWriteDb(); msg = findViewById(R.id.textviewmessage); recyclerView = findViewById(R.id.recycle); Intent intent = getIntent(); @@ -75,23 +77,6 @@ protected void onCreate(Bundle savedInstanceState) { query = intent.getStringExtra(SearchManager.QUERY); SearchRecentSuggestions suggestions = new SearchRecentSuggestions(this, SearchSuggestionProvider.AUTHORITY, SearchSuggestionProvider.MODE); suggestions.saveRecentQuery(query, null); -// searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() { -// @Override -// public boolean onQueryTextSubmit(String s) { -// return false; -// } -// -// @Override -// public boolean onQueryTextChange(String s) { -// Log.d("Hack", "in query text change"); -// SearchRecentSuggestions suggestions = new SearchRecentSuggestions(SearchPatientActivity.this, -// SearchSuggestionProvider.AUTHORITY, SearchSuggestionProvider.MODE); -// suggestions.clearHistory(); -// doQuery(s); -// return true; -//// return false; -// } -// }); if (sessionManager.isPullSyncFinished()) { msg.setVisibility(View.GONE); recyclerView.setVisibility(View.VISIBLE); @@ -116,13 +101,13 @@ protected void onCreate(Bundle savedInstanceState) { private void doQuery(String query) { try { recycler = new SearchPatientAdapter(getQueryPatients(query), SearchPatientActivity.this); -// Log.i("db data", "" + getQueryPatients(query)); RecyclerView.LayoutManager reLayoutManager = new LinearLayoutManager(getApplicationContext()); recyclerView.setLayoutManager(reLayoutManager); recyclerView.setItemAnimator(new DefaultItemAnimator()); recyclerView.setAdapter(recycler); } catch (Exception e) { + Crashlytics.getInstance().core.logException(e); Logger.logE("doquery", "doquery", e); } } @@ -141,6 +126,7 @@ private void firstQuery() { recyclerView.setAdapter(recycler); } catch (Exception e) { + Crashlytics.getInstance().core.logException(e); Logger.logE("firstquery", "exception", e); } } @@ -150,17 +136,13 @@ public boolean onCreateOptionsMenu(Menu menu) { // Inflate the options menu from XMLz MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.menu_search, menu); + inflater.inflate(R.menu.today_filter, menu); // inflater.inflate(R.menu.today_filter, menu); // Get the SearchView and set the searchable configuration SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE); searchView = (SearchView) menu.findItem(R.id.action_search).getActionView(); // Assumes current activity is the searchable activity searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName())); -// searchView.setIconifiedByDefault(false); // Do not iconify the widget; expand it by default - //searchView.setMaxWidth(Integer.MAX_VALUE); - -// searchView.setFocusable(true); -// searchView.requestFocus(); searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() { @Override @@ -196,7 +178,6 @@ public boolean onOptionsItemSelected(MenuItem item) { case R.id.action_search: - default: return super.onOptionsItemSelected(item); } @@ -220,9 +201,8 @@ public void noneFound(ListView lvItems, String query) { public List getAllPatientsFromDB() { List modelList = new ArrayList(); String table = "tbl_patient"; - final Cursor searchCursor = db.rawQuery("SELECT * FROM " + table + - " ORDER BY first_name ASC", null); - + final Cursor searchCursor = db.rawQuery("SELECT * FROM " + table + " ORDER BY first_name ASC", null); + try { if (searchCursor.moveToFirst()) { do { PatientDTO model = new PatientDTO(); @@ -231,15 +211,16 @@ public List getAllPatientsFromDB() { model.setLastname(searchCursor.getString(searchCursor.getColumnIndexOrThrow("last_name"))); model.setOpenmrsId(searchCursor.getString(searchCursor.getColumnIndexOrThrow("openmrs_id"))); model.setUuid(searchCursor.getString(searchCursor.getColumnIndexOrThrow("uuid"))); + model.setDateofbirth(searchCursor.getString(searchCursor.getColumnIndexOrThrow("date_of_birth"))); + model.setPhonenumber(StringUtils.mobileNumberEmpty(phoneNumber(searchCursor.getString(searchCursor.getColumnIndexOrThrow("uuid"))))); + modelList.add(model); } while (searchCursor.moveToNext()); } searchCursor.close(); - - - // Log.d("student data", modelList.toString()); - - + } catch (DAOException e) { + e.printStackTrace(); + } return modelList; } @@ -267,7 +248,9 @@ private void endAllVisit() { } while (cursor.moveToNext()); } } - cursor.close(); + if (cursor != null) { + cursor.close(); + } if (failedUploads == 0) { Intent intent = new Intent(this, HomeActivity.class); @@ -306,8 +289,6 @@ private void displaySingleSelectionDialog() { } catch (DAOException e) { e.printStackTrace(); } -// boolean[] checkedItems = {false, false, false, false}; - // ngo_numbers = getResources().getStringArray(R.array.ngo_numbers); dialogBuilder = new AlertDialog.Builder(SearchPatientActivity.this); dialogBuilder.setTitle("Filter by creator"); @@ -321,13 +302,15 @@ public void onClick(DialogInterface dialogInterface, int which, boolean isChecke Logger.logD(TAG, "multichoice" + which + isChecked); if (isChecked) { // If the user checked the item, add it to the selected items - selectedItems.add(finalCreator_uuid[which]); - Logger.logD(TAG, finalCreator_names[which] + finalCreator_uuid[which]); + if (finalCreator_uuid != null) { + selectedItems.add(finalCreator_uuid[which]); + } } else if (selectedItems.contains(which)) { // Else, if the item is already in the array, remove it - selectedItems.remove(finalCreator_uuid[which]); - Logger.logD(TAG, finalCreator_names[which] + finalCreator_uuid[which]); + if (finalCreator_uuid != null) { + selectedItems.remove(finalCreator_uuid[which]); + } } } @@ -339,7 +322,6 @@ public void onClick(DialogInterface dialogInterface, int i) { //display filter query code on list menu Logger.logD(TAG, "onclick" + i); doQueryWithProviders(query, selectedItems); -// select distinct a.uuid,c.first_name,c.middle_name,c.last_name,c.openmrs_id,c.phone_number,c.date_of_birth from tbl_visit a,tbl_encounter b ,tbl_patient c where b.visituuid=a.uuid and b.provider_uuid in ('163b48e5-26fb-40c1-8d94-a6c873dd2869') and a.patientuuid=c.uuid and a.enddate is null order by c.first_name } }); @@ -358,84 +340,158 @@ public void onClick(DialogInterface dialogInterface, int i) { } public List getQueryPatients(String query) { - String search = query.trim(); + String search = query.trim().replaceAll("\\s", ""); List modelList = new ArrayList(); SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); String table = "tbl_patient"; - final Cursor searchCursor = db.rawQuery("SELECT * FROM " + table + - " WHERE first_name LIKE " + "'" + search + - "%' OR last_name LIKE '" + search + - "%' OR openmrs_id LIKE '" + search + - "%' OR middle_name LIKE '" + search + "%' " + - "ORDER BY first_name ASC", null); - - if (searchCursor.moveToFirst()) { - do { - PatientDTO model = new PatientDTO(); - model.setOpenmrsId(searchCursor.getString(searchCursor.getColumnIndexOrThrow("openmrs_id"))); - model.setFirstname(searchCursor.getString(searchCursor.getColumnIndexOrThrow("first_name"))); - model.setLastname(searchCursor.getString(searchCursor.getColumnIndexOrThrow("last_name"))); - model.setOpenmrsId(searchCursor.getString(searchCursor.getColumnIndexOrThrow("openmrs_id"))); - model.setMiddlename(searchCursor.getString(searchCursor.getColumnIndexOrThrow("middle_name"))); - model.setUuid(searchCursor.getString(searchCursor.getColumnIndexOrThrow("uuid"))); - - modelList.add(model); - } while (searchCursor.moveToNext()); + final Cursor searchCursor = db.rawQuery("SELECT * FROM " + table + " WHERE first_name LIKE " + "'%" + search + "%' OR middle_name LIKE '%" + search + "%' OR last_name LIKE '%" + search + "%' OR openmrs_id LIKE '%" + search + "%' " + "ORDER BY first_name ASC", null); + try { + if (searchCursor.moveToFirst()) { + do { + PatientDTO model = new PatientDTO(); + model.setOpenmrsId(searchCursor.getString(searchCursor.getColumnIndexOrThrow("openmrs_id"))); + model.setFirstname(searchCursor.getString(searchCursor.getColumnIndexOrThrow("first_name"))); + model.setLastname(searchCursor.getString(searchCursor.getColumnIndexOrThrow("last_name"))); + model.setOpenmrsId(searchCursor.getString(searchCursor.getColumnIndexOrThrow("openmrs_id"))); + model.setMiddlename(searchCursor.getString(searchCursor.getColumnIndexOrThrow("middle_name"))); + model.setUuid(searchCursor.getString(searchCursor.getColumnIndexOrThrow("uuid"))); + model.setDateofbirth(searchCursor.getString(searchCursor.getColumnIndexOrThrow("date_of_birth"))); + model.setPhonenumber(StringUtils.mobileNumberEmpty(phoneNumber(searchCursor.getString(searchCursor.getColumnIndexOrThrow("uuid"))))); + modelList.add(model); + } while (searchCursor.moveToNext()); + } + } catch (DAOException e) { + Crashlytics.getInstance().core.logException(e); } return modelList; } private void doQueryWithProviders(String querytext, List providersuuids) { - if (null != querytext && !querytext.isEmpty()) { - String search = querytext.trim(); - List modelList = new ArrayList(); + if (querytext == null) { + List modelListwihtoutQuery = new ArrayList(); String query = - "select * " + - "from tbl_encounter a ,tbl_patient b " + - "left join tbl_patient_attribute c on c.patientuuid=b.uuid " + - " WHERE first_name LIKE " + "'" + search + - "%' OR last_name LIKE '" + search + - "%' OR openmrs_id LIKE '" + search + - "%' OR middle_name LIKE '" + search + "%' " + - "AND a.provider_uuid in ('" + StringUtils.convertUsingStringBuilder(providersuuids) + "') " + - "group by b.uuid order by b.uuid ASC"; + "select b.openmrs_id,b.first_name,b.last_name,b.middle_name,b.uuid,b.date_of_birth from tbl_visit a, tbl_patient b, tbl_encounter c WHERE a.patientuuid = b.uuid AND c.visituuid=a.uuid and c.provider_uuid in " + + "('" + StringUtils.convertUsingStringBuilder(providersuuids) + "') " + + "group by a.uuid order by b.uuid ASC"; Logger.logD(TAG, query); final Cursor cursor = db.rawQuery(query, null); + Logger.logD(TAG, "Cursour count" + cursor.getCount()); - if (cursor != null) { - if (cursor.moveToFirst()) { - do { - PatientDTO model = new PatientDTO(); - model.setOpenmrsId(cursor.getString(cursor.getColumnIndexOrThrow("openmrs_id"))); - model.setFirstname(cursor.getString(cursor.getColumnIndexOrThrow("first_name"))); - model.setLastname(cursor.getString(cursor.getColumnIndexOrThrow("last_name"))); - model.setOpenmrsId(cursor.getString(cursor.getColumnIndexOrThrow("openmrs_id"))); - model.setMiddlename(cursor.getString(cursor.getColumnIndexOrThrow("middle_name"))); - model.setUuid(cursor.getString(cursor.getColumnIndexOrThrow("uuid"))); + try { + if (cursor != null) { + if (cursor.moveToFirst()) { + do { + PatientDTO model = new PatientDTO(); + model.setOpenmrsId(cursor.getString(cursor.getColumnIndexOrThrow("openmrs_id"))); + model.setFirstname(cursor.getString(cursor.getColumnIndexOrThrow("first_name"))); + model.setLastname(cursor.getString(cursor.getColumnIndexOrThrow("last_name"))); + model.setMiddlename(cursor.getString(cursor.getColumnIndexOrThrow("middle_name"))); + model.setUuid(cursor.getString(cursor.getColumnIndexOrThrow("uuid"))); + model.setDateofbirth(cursor.getString(cursor.getColumnIndexOrThrow("date_of_birth"))); + model.setPhonenumber(StringUtils.mobileNumberEmpty(phoneNumber(cursor.getString(cursor.getColumnIndexOrThrow("uuid"))))); + modelListwihtoutQuery.add(model); + + } while (cursor.moveToNext()); + } + } + if (cursor != null) { + cursor.close(); + } - modelList.add(model); + } catch (DAOException e) { + e.printStackTrace(); + } + + try { + recycler = new SearchPatientAdapter(modelListwihtoutQuery, SearchPatientActivity.this); +// Log.i("db data", "" + getQueryPatients(query)); + RecyclerView.LayoutManager reLayoutManager = new LinearLayoutManager(getApplicationContext()); + recyclerView.setLayoutManager(reLayoutManager); + recyclerView.setItemAnimator(new DefaultItemAnimator()); + recyclerView.setAdapter(recycler); - } while (cursor.moveToNext()); + } catch (Exception e) { + Logger.logE("doquery", "doquery", e); + } + } else { + String search = querytext.trim().replaceAll("\\s", ""); + List modelList = new ArrayList(); + String query = + "select b.openmrs_id,b.firstname,b.last_name,b.middle_name,b.uuid,b.date_of_birth from tbl_visit a, tbl_patient b, tbl_encounter c WHERE" + + "first_name LIKE " + "'%" + search + + "%' OR middle_name LIKE '%" + search + + "%' OR last_name LIKE '%" + search + + "%' OR openmrs_id LIKE '%" + search + + "%' " + + "AND a.provider_uuid in ('" + StringUtils.convertUsingStringBuilder(providersuuids) + "') " + + "AND a.patientuuid = b.uuid AND c.visituuid=a.uuid " + + "group by a.uuid order by b.uuid ASC"; + Logger.logD(TAG, query); + final Cursor cursor = db.rawQuery(query, null); + Logger.logD(TAG, "Cursour count" + cursor.getCount()); + try { + if (cursor != null) { + if (cursor.moveToFirst()) { + do { + PatientDTO model = new PatientDTO(); + model.setOpenmrsId(cursor.getString(cursor.getColumnIndexOrThrow("openmrs_id"))); + model.setFirstname(cursor.getString(cursor.getColumnIndexOrThrow("first_name"))); + model.setLastname(cursor.getString(cursor.getColumnIndexOrThrow("last_name"))); + model.setMiddlename(cursor.getString(cursor.getColumnIndexOrThrow("middle_name"))); + model.setUuid(cursor.getString(cursor.getColumnIndexOrThrow("uuid"))); + model.setDateofbirth(cursor.getString(cursor.getColumnIndexOrThrow("date_of_birth"))); + model.setPhonenumber(StringUtils.mobileNumberEmpty(phoneNumber(cursor.getString(cursor.getColumnIndexOrThrow("uuid"))))); + modelList.add(model); + + } while (cursor.moveToNext()); + } } + cursor.close(); + } catch (DAOException sql) { + Crashlytics.getInstance().core.logException(sql); } - cursor.close(); + try { recycler = new SearchPatientAdapter(modelList, SearchPatientActivity.this); -// Log.i("db data", "" + getQueryPatients(query)); RecyclerView.LayoutManager reLayoutManager = new LinearLayoutManager(getApplicationContext()); recyclerView.setLayoutManager(reLayoutManager); recyclerView.setItemAnimator(new DefaultItemAnimator()); recyclerView.setAdapter(recycler); } catch (Exception e) { + Crashlytics.getInstance().core.logException(e); Logger.logE("doquery", "doquery", e); } } + } + private String phoneNumber(String patientuuid) throws DAOException { + String phone = null; + Cursor idCursor = db.rawQuery("SELECT value FROM tbl_patient_attribute where patientuuid = ? AND person_attribute_type_uuid='14d4f066-15f5-102d-96e4-000c29c2a5d7' ", new String[]{patientuuid}); + try { + if (idCursor.getCount() != 0) { + while (idCursor.moveToNext()) { + + phone = idCursor.getString(idCursor.getColumnIndexOrThrow("value")); + + } + } + } catch (SQLException s) { + Crashlytics.getInstance().core.logException(s); + } + idCursor.close(); + + return phone; + } + + @Override + protected void onStop() { + super.onStop(); + } } diff --git a/app/src/main/java/io/intelehealth/client/activities/searchPatientActivity/SearchPatientAdapter.java b/app/src/main/java/io/intelehealth/client/activities/searchPatientActivity/SearchPatientAdapter.java old mode 100644 new mode 100755 index 82df4b1af3..70fc4c182d --- a/app/src/main/java/io/intelehealth/client/activities/searchPatientActivity/SearchPatientAdapter.java +++ b/app/src/main/java/io/intelehealth/client/activities/searchPatientActivity/SearchPatientAdapter.java @@ -16,6 +16,7 @@ import io.intelehealth.client.R; import io.intelehealth.client.activities.patientDetailActivity.PatientDetailActivity; import io.intelehealth.client.models.dto.PatientDTO; +import io.intelehealth.client.utilities.DateAndTimeUtils; public class SearchPatientAdapter extends RecyclerView.Adapter { List patients; @@ -38,8 +39,17 @@ public Myholder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { @Override public void onBindViewHolder(@NonNull SearchPatientAdapter.Myholder holder, int position) { final PatientDTO patinet = patients.get(position); - holder.headTextView.setText(patinet.getFirstname() + " " + patinet.getLastname()); - holder.bodyTextView.setText(patinet.getOpenmrsId()); + if (patinet != null) { + int age = DateAndTimeUtils.getAge(patinet.getDateofbirth()); + String dob = DateAndTimeUtils.SimpleDatetoLongDate(patinet.getDateofbirth()); + String body = String.format(context.getString(R.string.id_number) + ": %s \n" + + context.getString(R.string.identification_screen_prompt_phone_number) + ": %s\n" + + context.getString(R.string.identification_screen_prompt_birthday) + + ": %s (" + context.getString(R.string.identification_screen_prompt_age) + " %d)", patinet.getOpenmrsId(), patinet.getPhonenumber(), + dob, age); + holder.headTextView.setText(patinet.getFirstname() + " " + patinet.getLastname()); + holder.bodyTextView.setText(body); + } holder.linearLayout.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { diff --git a/app/src/main/java/io/intelehealth/client/activities/searchPatientActivity/SearchSuggestionProvider.java b/app/src/main/java/io/intelehealth/client/activities/searchPatientActivity/SearchSuggestionProvider.java old mode 100644 new mode 100755 index 44f712b5a6..d3b68a1d60 --- a/app/src/main/java/io/intelehealth/client/activities/searchPatientActivity/SearchSuggestionProvider.java +++ b/app/src/main/java/io/intelehealth/client/activities/searchPatientActivity/SearchSuggestionProvider.java @@ -9,7 +9,7 @@ */ public class SearchSuggestionProvider extends SearchRecentSuggestionsProvider { - public final static String AUTHORITY = "io.intelehealth.client.searchPatientActivity.SearchSuggestionProvider"; + public final static String AUTHORITY = "io.intelehealth.client.activities.searchPatientActivity.SearchSuggestionProvider"; public final static int MODE = DATABASE_MODE_QUERIES; public SearchSuggestionProvider() { diff --git a/app/src/main/java/io/intelehealth/client/activities/settingsActivity/SettingsActivity.java b/app/src/main/java/io/intelehealth/client/activities/settingsActivity/SettingsActivity.java old mode 100644 new mode 100755 index 77edc95f2a..2898ba8876 --- a/app/src/main/java/io/intelehealth/client/activities/settingsActivity/SettingsActivity.java +++ b/app/src/main/java/io/intelehealth/client/activities/settingsActivity/SettingsActivity.java @@ -348,9 +348,6 @@ public boolean onOptionsItemSelected(MenuItem item) { } } - - //prajwal end - @TargetApi(Build.VERSION_CODES.HONEYCOMB) public static class CloudRestoreFragment extends Fragment { @Override @@ -385,9 +382,6 @@ public void setLocale(String lang) { Configuration conf = res.getConfiguration(); conf.locale = myLocale; res.updateConfiguration(conf, dm); - //Intent refresh = new Intent(this, HomeActivity.class); - //finish(); - // startActivity(refresh); } @@ -395,7 +389,9 @@ public void loadLocale() { String langPref = "Language"; SharedPreferences prefs = this.getActivity().getSharedPreferences("Intelehealth", Activity.MODE_PRIVATE); String language = prefs.getString(langPref, ""); - setLocale(language); + if (language != null) { + setLocale(language); + } } public void saveLocale(String lang) { @@ -458,7 +454,6 @@ public boolean onOptionsItemSelected(MenuItem item) { int id = item.getItemId(); if (id == android.R.id.home) { - //setLocale("or"); startActivity(new Intent(getActivity(), HomeActivity.class)); return true; } diff --git a/app/src/main/java/io/intelehealth/client/activities/setupActivity/LocationArrayAdapter.java b/app/src/main/java/io/intelehealth/client/activities/setupActivity/LocationArrayAdapter.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/activities/setupActivity/SetupActivity.java b/app/src/main/java/io/intelehealth/client/activities/setupActivity/SetupActivity.java index 0df9f8f879..a6f4a02a27 100644 --- a/app/src/main/java/io/intelehealth/client/activities/setupActivity/SetupActivity.java +++ b/app/src/main/java/io/intelehealth/client/activities/setupActivity/SetupActivity.java @@ -4,22 +4,15 @@ import android.accounts.AccountManager; import android.app.AlertDialog; import android.app.Dialog; -import android.app.DownloadManager; import android.app.ProgressDialog; -import android.content.Context; import android.content.DialogInterface; import android.content.Intent; -import android.graphics.Typeface; -import android.net.Uri; -import android.os.AsyncTask; import android.os.Bundle; -import android.os.Environment; import android.os.Handler; import android.os.StrictMode; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.text.Editable; -import android.text.Html; import android.text.TextUtils; import android.text.TextWatcher; import android.util.Log; @@ -37,28 +30,18 @@ import android.widget.TextView; import android.widget.Toast; +import com.crashlytics.android.Crashlytics; import com.google.gson.Gson; import com.parse.Parse; -import java.io.BufferedInputStream; import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.net.HttpURLConnection; -import java.net.URL; import java.util.ArrayList; import java.util.List; -import java.util.zip.ZipEntry; -import java.util.zip.ZipInputStream; import io.intelehealth.client.R; import io.intelehealth.client.activities.homeActivity.HomeActivity; import io.intelehealth.client.app.AppConstants; import io.intelehealth.client.app.IntelehealthApplication; -import io.intelehealth.client.models.DownloadMindMapRes; import io.intelehealth.client.models.Location; import io.intelehealth.client.models.Results; import io.intelehealth.client.models.loginModel.LoginModel; @@ -69,12 +52,10 @@ import io.intelehealth.client.utilities.AdminPassword; import io.intelehealth.client.utilities.Base64Utils; import io.intelehealth.client.utilities.DialogUtils; -import io.intelehealth.client.utilities.DownloadMindMaps; import io.intelehealth.client.utilities.Logger; import io.intelehealth.client.utilities.OfflineLogin; import io.intelehealth.client.utilities.SessionManager; import io.intelehealth.client.utilities.UrlModifiers; -import io.intelehealth.client.widget.materialprogressbar.CustomProgressDialog; import io.reactivex.Observable; import io.reactivex.Observer; import io.reactivex.android.schedulers.AndroidSchedulers; @@ -113,11 +94,6 @@ public class SetupActivity extends AppCompatActivity { private RadioButton r2; final Handler mHandler = new Handler(); - Context context; - private String mindmapURL = ""; - private DownloadMindMaps mTask; - CustomProgressDialog customProgressDialog; - @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -129,9 +105,6 @@ protected void onCreate(Bundle savedInstanceState) { Toolbar toolbar = findViewById(R.id.toolbar); setSupportActionBar(toolbar); - context = SetupActivity.this; - customProgressDialog = new CustomProgressDialog(context); - // Set up the login form. mEmailView = findViewById(R.id.email); // populateAutoComplete(); TODO: create our own autocomplete code @@ -210,7 +183,7 @@ public void run() { // user didn't typed for 1.5 seconds, do whatever you want if (!mUrlField.getText().toString().trim().isEmpty() && mUrlField.getText().toString().length() >= 12) { if (Patterns.WEB_URL.matcher(mUrlField.getText().toString()).matches()) { - String BASE_URL = "http://" + mUrlField.getText().toString() + "/openmrs/ws/rest/v1/"; + String BASE_URL = "https://" + mUrlField.getText().toString() + "/openmrs/ws/rest/v1/"; if (URLUtil.isValidUrl(BASE_URL) && !isLocationFetched) getLocationFromServer(BASE_URL); else @@ -221,6 +194,8 @@ public void run() { }; }); + + } /** @@ -349,8 +324,7 @@ public void onComplete() { } }); } catch (IllegalArgumentException e) { - Log.e(TAG, "changeApiBaseUrl: " + e.getMessage()); - Log.e(TAG, "changeApiBaseUrl: " + e.getStackTrace()); + Crashlytics.getInstance().core.logException(e); mUrlField.setError(getString(R.string.url_invalid)); } @@ -386,9 +360,11 @@ public void onRadioClick(View v) { case R.id.downloadMindmap: if (checked) { r1.setChecked(false); - AlertDialog.Builder dialog = new AlertDialog.Builder(this, R.style.AlertDialogStyle); + AlertDialog.Builder dialog = new AlertDialog.Builder(this); LayoutInflater li = LayoutInflater.from(this); View promptsView = li.inflate(R.layout.dialog_mindmap_cred, null); + + dialog.setTitle(getString(R.string.enter_license_key)) .setView(promptsView) @@ -398,10 +374,22 @@ public void onClick(DialogInterface dialog, int which) { Dialog d = (Dialog) dialog; EditText text = d.findViewById(R.id.licensekey); - //text.setPadding(50,0,50,0); //padding on editText. EditText url = d.findViewById(R.id.licenseurl); + if (text.getText().toString().isEmpty() && text.getText() == null || url.getText().toString().isEmpty() && url.getText() == null) { + text.setFocusable(true); + text.setError("Enter license key"); + } + + if (sessionManager.getLicenseKey() != null && sessionManager.getLicenseKey().equalsIgnoreCase("http://mindmaps.intelehealth.io:4040")) { + text.setText(sessionManager.getLicenseKey()); + url.setText(sessionManager.getMindMapServerUrl()); + } + + key = text.getText().toString(); licenseUrl = url.getText().toString(); + + sessionManager.setMindMapServerUrl(licenseUrl); //Toast.makeText(SetupActivity.this, "" + key, Toast.LENGTH_SHORT).show(); if (keyVerified(key)) { @@ -414,11 +402,9 @@ public void onClick(DialogInterface dialog, int which) { // UpdateProtocolsTask updateProtocolsTask = new UpdateProtocolsTask(SetupActivity.this); // updateProtocolsTask.execute(null, "AllFiles", "TRUE"); + DownloadProtocolsTask downloadProtocolsTask = new DownloadProtocolsTask(SetupActivity.this); + downloadProtocolsTask.execute(key); -// DownloadProtocolsTask downloadProtocolsTask = new DownloadProtocolsTask(SetupActivity.this); -// downloadProtocolsTask.execute(key); - - getMindmapDownloadURL("http://" + licenseUrl + ":3004/"); } } @@ -428,23 +414,22 @@ public void onClick(DialogInterface dialog, int which) { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); + r2.setChecked(false); + r1.setChecked(true); + } }); AlertDialog alertDialog = dialog.create(); - //will provide spacing i.e margin to the dialog. - alertDialog.setView(promptsView, 20, 0, 20, 0); alertDialog.show(); // Get the alert dialog buttons reference Button positiveButton = alertDialog.getButton(AlertDialog.BUTTON_POSITIVE); Button negativeButton = alertDialog.getButton(AlertDialog.BUTTON_NEGATIVE); // Change the alert dialog buttons text and background color - positiveButton.setTextColor(getResources().getColor(R.color.colorPrimary)); - positiveButton.setTypeface(Typeface.DEFAULT, Typeface.BOLD); + positiveButton.setTextColor(getResources().getColor(R.color.colorPrimaryDark)); + negativeButton.setTextColor(getResources().getColor(R.color.colorPrimaryDark)); - negativeButton.setTextColor(getResources().getColor(R.color.colorPrimary)); - negativeButton.setTypeface(Typeface.DEFAULT, Typeface.BOLD); } break; @@ -463,32 +448,8 @@ private boolean keyVerified(String key) { */ public void TestSetup(String CLEAN_URL, String USERNAME, String PASSWORD, String ADMIN_PASSWORD, Location location) { -// String USERNAME; -// String PASSWORD; -// String CLEAN_URL; -// String ADMIN_PASSWORD; ProgressDialog progress; -// Location LOCATION; -// int responsecode; - -// TestSetup(String url, String username, String password, String adminPassword, Location location) { -// CLEAN_URL = url; -// USERNAME = username; -// PASSWORD = password; -// LOCATION = location; -// ADMIN_PASSWORD = adminPassword; -// } - -// @Override -// protected void onPreExecute() { -// super.onPreExecute(); - -// } - - -// @Override -// protected Integer doInBackground(Void... params) { String urlString = urlModifiers.loginUrl(CLEAN_URL); Logger.logD(TAG, "usernaem and password" + USERNAME + PASSWORD); encoded = base64Utils.encoded(USERNAME, PASSWORD); @@ -511,7 +472,6 @@ public void onSubscribe(Disposable d) { public void onNext(LoginModel loginModel) { Boolean authencated = loginModel.getAuthenticated(); Gson gson = new Gson(); - Logger.logD(TAG, "success" + gson.toJson(loginModel)); sessionManager.setChwname(loginModel.getUser().getDisplay()); sessionManager.setCreatorID(loginModel.getUser().getUuid()); sessionManager.setSessionID(loginModel.getSessionId()); @@ -539,7 +499,7 @@ public void onNext(LoginProviderModel loginProviderModel) { sessionManager.setLocationDescription(location.getDescription()); sessionManager.setServerUrl(CLEAN_URL); sessionManager.setServerUrlRest(BASE_URL); - sessionManager.setServerUrlBase("http://" + CLEAN_URL + "/openmrs"); + sessionManager.setServerUrlBase("https://" + CLEAN_URL + "/openmrs"); sessionManager.setBaseUrl(BASE_URL); sessionManager.setSetupComplete(true); @@ -548,17 +508,15 @@ public void onNext(LoginProviderModel loginProviderModel) { Parse.initialize(new Parse.Configuration.Builder(getApplicationContext()) .applicationId(AppConstants.IMAGE_APP_ID) - .server("http://" + CLEAN_URL + ":1337/parse/") + .server("https://" + CLEAN_URL + ":4040/parse/") .build() ); Log.i(TAG, "onPostExecute: Parse init"); Intent intent = new Intent(SetupActivity.this, HomeActivity.class); intent.putExtra("setup", true); if (r2.isChecked()) { - if (!sessionManager.getLicenseKey().isEmpty()) { -// if (sessionManager.valueContains("licensekey")) { + if (sessionManager.getLicenseKey() != null && !sessionManager.getLicenseKey().isEmpty()) { startActivity(intent); -// startJobDispatcherService(SetupActivity.this); finish(); } else { Toast.makeText(SetupActivity.this, "Please enter a valid license key", Toast.LENGTH_LONG).show(); @@ -568,14 +526,6 @@ public void onNext(LoginProviderModel loginProviderModel) { finish(); } progress.dismiss(); - -// } else if (success == 201) { -// activitySetupBinding.password.setError(getString(R.string.error_incorrect_password)); -// activitySetupBinding.password.requestFocus(); -// } else if (success == 3) { -// activitySetupBinding.editTextURL.setError(getString(R.string.url_invalid)); -// activitySetupBinding.editTextURL.requestFocus(); -// } } } @@ -602,8 +552,6 @@ public void onError(Throwable e) { DialogUtils dialogUtils = new DialogUtils(); dialogUtils.showerrorDialog(SetupActivity.this, "Error Login", getString(R.string.error_incorrect_password), "ok"); mEmailView.requestFocus(); - // mEmailView.setError(getString(R.string.error_incorrect_password)); - // mPasswordView.setError(getString(R.string.error_incorrect_password)); mPasswordView.requestFocus(); } @@ -612,107 +560,9 @@ public void onComplete() { Logger.logD(TAG, "completed"); } }); - } - - private void getMindmapDownloadURL(String url) { - customProgressDialog.show(); - ApiClient.changeApiBaseUrl(url); - ApiInterface apiService = ApiClient.createService(ApiInterface.class); - try { - Observable resultsObservable = apiService.DOWNLOAD_MIND_MAP_RES_OBSERVABLE(key); - resultsObservable - .subscribeOn(Schedulers.io()) - .observeOn(AndroidSchedulers.mainThread()) - .subscribe(new DisposableObserver() { - @Override - public void onNext(DownloadMindMapRes res) { - customProgressDialog.dismiss(); - if (res.getMessage() != null && res.getMessage().equalsIgnoreCase("Success")) { - - Log.e("MindMapURL", "Successfully get MindMap URL"); - mTask = new DownloadMindMaps(context); - mindmapURL = res.getMindmap().trim(); - sessionManager.setLicenseKey(key); - checkExistingMindMaps(); - - } else { - Toast.makeText(SetupActivity.this, getResources().getString(R.string.no_mindmaps_found), Toast.LENGTH_SHORT).show(); - } - } - - @Override - public void onError(Throwable e) { - customProgressDialog.dismiss(); - Toast.makeText(SetupActivity.this, getResources().getString(R.string.unable_to_get_proper_response), Toast.LENGTH_SHORT).show(); - } - - @Override - public void onComplete() { - - } - }); - } catch (IllegalArgumentException e) { - Log.e(TAG, "changeApiBaseUrl: " + e.getMessage()); - Log.e(TAG, "changeApiBaseUrl: " + e.getStackTrace()); - } - } - - private void checkExistingMindMaps() { - - //Check is there any existing mindmaps are present, if yes then delete. - - File engines = new File(context.getFilesDir().getAbsolutePath(), "/Engines"); - Log.e(TAG, "Engines folder=" + engines.exists()); - if (engines.exists()) { - engines.delete(); - } - File logo = new File(context.getFilesDir().getAbsolutePath(), "/logo"); - Log.e(TAG, "Logo folder=" + logo.exists()); - if (logo.exists()) { - logo.delete(); - } - File physicalExam = new File(context.getFilesDir().getAbsolutePath() + "/physExam.json"); - Log.e(TAG, "physExam.json=" + physicalExam.exists()); - if (physicalExam.exists()) { - physicalExam.delete(); - } - File familyHistory = new File(context.getFilesDir().getAbsolutePath() + "/famHist.json"); - Log.e(TAG, "famHist.json=" + familyHistory.exists()); - if (familyHistory.exists()) { - familyHistory.delete(); - } - File pastMedicalHistory = new File(context.getFilesDir().getAbsolutePath() + "/patHist.json"); - Log.e(TAG, "patHist.json=" + pastMedicalHistory.exists()); - if (pastMedicalHistory.exists()) { - pastMedicalHistory.delete(); - } - File config = new File(context.getFilesDir().getAbsolutePath() + "/config.json"); - Log.e(TAG, "config.json=" + config.exists()); - if (config.exists()) { - config.delete(); - } - //Start downloading mindmaps - mTask.execute(mindmapURL, context.getFilesDir().getAbsolutePath() + "/mindmaps.zip"); - Log.e("DOWNLOAD", "isSTARTED"); } -// public void downloadByDownloadManager(String url, String outputFileName) { -// DownloadManager.Request request = new DownloadManager.Request(Uri.parse(url)); -// request.setDescription("Mindmaps - Intelehealth"); -// request.setTitle("Mindmaps"); -// request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED); -// request.allowScanningByMediaScanner(); -// request.setDestinationInExternalPublicDir(context.getFilesDir().getAbsolutePath(), outputFileName); -// -// Log.d("MainActivity: ", "download folder>>>>" + Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).getAbsolutePath()); -// -// // get download service and enqueue file -// DownloadManager manager = (DownloadManager) getSystemService(Context.DOWNLOAD_SERVICE); -// manager.enqueue(request); -// -// unpackZip(context.getFilesDir().getAbsolutePath() + "mindMaps.zip"); -// } } diff --git a/app/src/main/java/io/intelehealth/client/activities/splash_activity/SplashActivity.java b/app/src/main/java/io/intelehealth/client/activities/splash_activity/SplashActivity.java old mode 100644 new mode 100755 index 1b463a983c..458858d284 --- a/app/src/main/java/io/intelehealth/client/activities/splash_activity/SplashActivity.java +++ b/app/src/main/java/io/intelehealth/client/activities/splash_activity/SplashActivity.java @@ -17,7 +17,6 @@ import java.util.List; import java.util.Locale; -import io.intelehealth.client.BuildConfig; import io.intelehealth.client.R; import io.intelehealth.client.activities.loginActivity.LoginActivity; import io.intelehealth.client.activities.setupActivity.SetupActivity; @@ -25,8 +24,6 @@ import io.intelehealth.client.utilities.Logger; import io.intelehealth.client.utilities.SessionManager; -import static io.intelehealth.client.app.AppConstants.APP_VERSION_CODE; - public class SplashActivity extends AppCompatActivity { SessionManager sessionManager = null; @@ -70,7 +67,9 @@ public void onPermissionGranted() { TempDialog.setProgress(i); TempDialog.show(); - if (BuildConfig.VERSION_CODE <= APP_VERSION_CODE && sessionManager.isFirstTimeLaunched()) { + if (sessionManager.isMigration()) { + nextActivity(); + } else { final Handler handler = new Handler(); handler.postDelayed(new Runnable() { @Override @@ -88,8 +87,6 @@ public void run() { } }, 2000); - } else { - nextActivity(); } } @@ -136,4 +133,9 @@ protected void onDestroy() { TempDialog.dismiss(); super.onDestroy(); } + + @Override + public void onBackPressed() { + super.onBackPressed(); + } } diff --git a/app/src/main/java/io/intelehealth/client/activities/todayPatientActivity/TodayPatientActivity.java b/app/src/main/java/io/intelehealth/client/activities/todayPatientActivity/TodayPatientActivity.java index a381738491..e6d1223816 100644 --- a/app/src/main/java/io/intelehealth/client/activities/todayPatientActivity/TodayPatientActivity.java +++ b/app/src/main/java/io/intelehealth/client/activities/todayPatientActivity/TodayPatientActivity.java @@ -18,7 +18,6 @@ import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; -import android.widget.Button; import com.crashlytics.android.Crashlytics; @@ -29,6 +28,7 @@ import io.intelehealth.client.R; import io.intelehealth.client.activities.homeActivity.HomeActivity; +import io.intelehealth.client.app.AppConstants; import io.intelehealth.client.database.InteleHealthDatabaseHelper; import io.intelehealth.client.database.dao.ProviderDAO; import io.intelehealth.client.models.TodayPatientModel; @@ -64,8 +64,7 @@ protected void onCreate(Bundle savedInstanceState) { mTodayPatientList = findViewById(R.id.today_patient_recycler_view); sessionManager = new SessionManager(this); - mDbHelper = new InteleHealthDatabaseHelper(this); - db = mDbHelper.getWritableDatabase(); + db = AppConstants.inteleHealthDatabaseHelper.getWriteDb(); if (sessionManager.isPullSyncFinished()) { doQuery(); } @@ -73,38 +72,15 @@ protected void onCreate(Bundle savedInstanceState) { } - /** - * This method retrieves visit details about patient for a particular - *

- *

- *

- *

- *

- *

- * date. - * - * @return void - */ private void doQuery() { List todayPatientList = new ArrayList<>(); Date cDate = new Date(); String currentDate = new SimpleDateFormat("yyyy-MM-dd").format(cDate); - String query = -// "SELECT tbl_visit.uuid, tbl_visit.patientuuid, tbl_visit.startdate, tbl_visit.enddate," + -// "tbl_visit.uuid, tbl_patient.first_name, tbl_patient.middle_name, tbl_patient.last_name, " + -// "tbl_patient.date_of_birth,tbl_patient.openmrs_id,a.value As phone_number " + -// "FROM tbl_visit, tbl_patient,tbl_patient_attribute a " + -// "WHERE tbl_visit.patientuuid = tbl_patient.uuid " + -// "AND a.patientuuid=tbl_patient.uuid and a.person_attribute_type_uuid='14d4f066-15f5-102d-96e4-000c29c2a5d7' " + -// "AND tbl_visit.startdate LIKE '" + currentDate + "T%'" + -// "ORDER BY tbl_patient.first_name ASC"; -// - "SELECT a.uuid, a.patientuuid, a.startdate, a.enddate, b.first_name, b.middle_name, b.last_name, b.date_of_birth,b.openmrs_id " + + String query = "SELECT a.uuid, a.patientuuid, a.startdate, a.enddate, b.first_name, b.middle_name, b.last_name, b.date_of_birth,b.openmrs_id " + "FROM tbl_visit a, tbl_patient b " + "WHERE a.patientuuid = b.uuid " + - "AND a.startdate LIKE '2019-08-07T%' " + + "AND a.startdate LIKE '" + currentDate + "T%' " + "GROUP BY a.uuid ORDER BY a.patientuuid ASC"; - // "SELECT * FROM visit, patient WHERE visit.patient_id = patient._id AND visit.start_datetime LIKE '" + currentDate + "T%'"; Logger.logD(TAG, query); final Cursor cursor = db.rawQuery(query, null); @@ -130,7 +106,9 @@ private void doQuery() { } while (cursor.moveToNext()); } } - cursor.close(); + if (cursor != null) { + cursor.close(); + } if (!todayPatientList.isEmpty()) { for (TodayPatientModel todayPatientModel : todayPatientList) @@ -176,19 +154,6 @@ public boolean onOptionsItemSelected(MenuItem item) { private void displaySingleSelectionDialog() { - - /* View checkBoxView = View.inflate(this, R.layout.checkbox_view, null); - CheckBox checkBox = (CheckBox) checkBoxView.findViewById(R.id.checkbox); - checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { - - @Override - public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { - - // Save to shared preferences - } - }); - checkBox.setText("Text to the right of the check box.");*/ - ProviderDAO providerDAO = new ProviderDAO(); ArrayList selectedItems = new ArrayList<>(); String[] creator_names = null; @@ -202,7 +167,7 @@ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { // boolean[] checkedItems = {false, false, false, false}; // ngo_numbers = getResources().getStringArray(R.array.ngo_numbers); dialogBuilder = new AlertDialog.Builder(TodayPatientActivity.this); - dialogBuilder.setTitle("Filter by creator"); + dialogBuilder.setTitle("Filter by Creator"); String[] finalCreator_names = creator_names; String[] finalCreator_uuid = creator_uuid; @@ -230,46 +195,11 @@ public void onClick(DialogInterface dialogInterface, int i) { //display filter query code on list menu Logger.logD(TAG, "onclick" + i); doQueryWithProviders(selectedItems); -// select distinct a.uuid,c.first_name,c.middle_name,c.last_name,c.openmrs_id,c.phone_number,c.date_of_birth from tbl_visit a,tbl_encounter b ,tbl_patient c where b.visituuid=a.uuid and b.provider_uuid in ('163b48e5-26fb-40c1-8d94-a6c873dd2869') and a.patientuuid=c.uuid and a.enddate is null order by c.first_name } }); dialogBuilder.setNegativeButton("Cancel", null); - //dialogBuilder.setView(checkBoxView); - //dialogBuilder.setIcon(R.drawable.ic_sort_white_24dp); - // dialogBuilder.setItems(creator_names, new DialogInterface.OnClickListener() { - // @Override - // public void onClick(DialogInterface dialog, int which) { - // the user clicked on colors[which] - /* final String a = "tel:"+"9769025715"; - final String b = "tel:"+"7304154312"; - - if("Team 1".equals(ngo_numbers[which])) - { - Intent i = new Intent(Intent.ACTION_DIAL, Uri.parse(a)); - i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - getApplicationContext().startActivity(i); - } - - else if("Team 2".equals(ngo_numbers[which])) - { - Intent i = new Intent(Intent.ACTION_DIAL, Uri.parse(b)); - i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - getApplicationContext().startActivity(i); - }*/ - // } - // }); - // dialogBuilder.show(); - - AlertDialog alertDialog = dialogBuilder.create(); - alertDialog.show(); - - Button positiveButton = alertDialog.getButton(android.app.AlertDialog.BUTTON_POSITIVE); - positiveButton.setTextColor(getResources().getColor(R.color.colorPrimary)); - - Button negativeButton = alertDialog.getButton(android.app.AlertDialog.BUTTON_NEGATIVE); - negativeButton.setTextColor(getResources().getColor(R.color.colorPrimary)); - + dialogBuilder.show(); } @@ -277,23 +207,12 @@ private void doQueryWithProviders(List providersuuids) { List todayPatientList = new ArrayList<>(); Date cDate = new Date(); String currentDate = new SimpleDateFormat("yyyy-MM-dd").format(cDate); - String query = -// "SELECT tbl_visit.uuid, tbl_visit.patientuuid, tbl_visit.startdate, tbl_visit.enddate," + -// "tbl_visit.uuid, tbl_patient.first_name, tbl_patient.middle_name, tbl_patient.last_name, " + -// "tbl_patient.date_of_birth,tbl_patient.openmrs_id,a.value As phone_number " + -// "FROM tbl_visit, tbl_patient,tbl_patient_attribute a " + -// "WHERE tbl_visit.patientuuid = tbl_patient.uuid " + -// "AND a.patientuuid=tbl_patient.uuid and a.person_attribute_type_uuid='14d4f066-15f5-102d-96e4-000c29c2a5d7' " + -// "AND tbl_visit.startdate LIKE '" + currentDate + "T%'" + -// "ORDER BY tbl_patient.first_name ASC"; -// - "SELECT distinct a.uuid, a.patientuuid, a.startdate, a.enddate, b.first_name, b.middle_name, b.last_name, b.date_of_birth,b.openmrs_id " + + String query = "SELECT distinct a.uuid, a.patientuuid, a.startdate, a.enddate, b.first_name, b.middle_name, b.last_name, b.date_of_birth,b.openmrs_id " + "FROM tbl_visit a, tbl_patient b, tbl_encounter c " + "WHERE a.patientuuid = b.uuid " + "AND c.visituuid=a.uuid and c.provider_uuid in ('" + StringUtils.convertUsingStringBuilder(providersuuids) + "') " + "AND a.startdate LIKE '" + currentDate + "T%'" + "ORDER BY a.patientuuid ASC "; - // "SELECT * FROM visit, patient WHERE visit.patient_id = patient._id AND visit.start_datetime LIKE '" + currentDate + "T%'"; Logger.logD(TAG, query); final Cursor cursor = db.rawQuery(query, null); @@ -319,7 +238,9 @@ private void doQueryWithProviders(List providersuuids) { } while (cursor.moveToNext()); } } - cursor.close(); + if (cursor != null) { + cursor.close(); + } if (!todayPatientList.isEmpty()) { for (TodayPatientModel todayPatientModel : todayPatientList) diff --git a/app/src/main/java/io/intelehealth/client/activities/todayPatientActivity/TodayPatientAdapter.java b/app/src/main/java/io/intelehealth/client/activities/todayPatientActivity/TodayPatientAdapter.java index 6345f90aec..d27680985e 100644 --- a/app/src/main/java/io/intelehealth/client/activities/todayPatientActivity/TodayPatientAdapter.java +++ b/app/src/main/java/io/intelehealth/client/activities/todayPatientActivity/TodayPatientAdapter.java @@ -45,7 +45,7 @@ public void onBindViewHolder(TodayPatientViewHolder holder, int position) { final TodayPatientModel todayPatientModel = todayPatientModelList.get(position); String header; if (todayPatientModel.getOpenmrs_id() != null) { - header = String.format("%s %s, %s", todayPatientModel.getFirst_name(), + header = String.format("%s %s - " + context.getString(R.string.visit_summary_heading_id) + ": %s", todayPatientModel.getFirst_name(), todayPatientModel.getLast_name(), todayPatientModel.getOpenmrs_id()); } else { header = String.format("%s %s", todayPatientModel.getFirst_name(), @@ -53,51 +53,21 @@ public void onBindViewHolder(TodayPatientViewHolder holder, int position) { } int age = DateAndTimeUtils.getAge(todayPatientModel.getDate_of_birth()); String dob = DateAndTimeUtils.SimpleDatetoLongDate(todayPatientModel.getDate_of_birth()); - String body = String.format(context.getString(R.string.identification_screen_prompt_age) + " %d yrs", age); + String body = String.format(context.getString(R.string.id_number) + ": %s \n" + + context.getString(R.string.identification_screen_prompt_phone_number) + ": %s\n" + + context.getString(R.string.identification_screen_prompt_birthday) + + ": %s (" + context.getString(R.string.identification_screen_prompt_age) + " %d)", todayPatientModel.getOpenmrs_id(), todayPatientModel.getPhone_number(), + dob, age); -// holder.listItemTodayPatientBinding.listItemHeadTextView.setText(header); -// holder.listItemTodayPatientBinding.listItemBodyTextView.setText(body); holder.getHeadTextView().setText(header); holder.getBodyTextView().setText(body); if (todayPatientModel.getEnddate() == null) { - /* Drawable drawable = DrawableHelper - .withContext(context) - //TODO: Dummy color. Change color before release. - .withColor(R.color.green) - .withDrawable(R.drawable.circle) - .tint() - .get(); -// holder.getIndicatorImageView().setImageDrawable(drawable);*/ -// holder.listItemTodayPatientBinding.listItemIndicatorTextView.setText("Active"); holder.getIndicatorTextView().setText("Active"); -// holder.listItemTodayPatientBinding.listItemIndicatorTextView.setBackgroundColor(Color.GREEN); holder.getIndicatorTextView().setBackgroundColor(Color.GREEN); } else { - /* Drawable drawable = DrawableHelper - .withContext(context) - //TODO: Dummy color. Change color before release. - .withColor(R.color.red) - .withDrawable(R.drawable.circle) - .tint() - .get(); - holder.getIndicatorImageView().setImageDrawable(drawable); - */ -// holder.listItemTodayPatientBinding.listItemIndicatorTextView.setText("Closed"); -// holder.listItemTodayPatientBinding.listItemIndicatorTextView.setBackgroundColor(Color.RED); holder.getIndicatorTextView().setText("Closed"); holder.getIndicatorTextView().setBackgroundColor(Color.RED); } -// holder.listItemTodayPatientBinding.getRoot().setOnClickListener(new View.OnClickListener() { -// @Override -// public void onClick(View v) { -// String patientStatus = "returning"; -// Intent intent = new Intent(context, PatientDetailActivity.class); -// intent.putExtra("patientUuid", todayPatientModel.getPatientuuid()); -// intent.putExtra("status", patientStatus); -// intent.putExtra("tag", ""); -// context.startActivity(intent); -// } -// }); holder.getRootView().setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { @@ -106,7 +76,6 @@ public void onClick(View v) { intent.putExtra("patientUuid", todayPatientModel.getPatientuuid()); intent.putExtra("status", patientStatus); intent.putExtra("tag", ""); - intent.putExtra("hasPrescription", "false"); context.startActivity(intent); } }); @@ -125,7 +94,6 @@ class TodayPatientViewHolder extends RecyclerView.ViewHolder { private TextView bodyTextView; private TextView indicatorTextView; private View rootView; -// ListItemTodayPatientBinding listItemTodayPatientBinding; public TodayPatientViewHolder(View itemView) { super(itemView); diff --git a/app/src/main/java/io/intelehealth/client/activities/videoLibraryActivity/VideoLibraryActivity.java b/app/src/main/java/io/intelehealth/client/activities/videoLibraryActivity/VideoLibraryActivity.java old mode 100644 new mode 100755 index 5b82bcb08b..a515055154 --- a/app/src/main/java/io/intelehealth/client/activities/videoLibraryActivity/VideoLibraryActivity.java +++ b/app/src/main/java/io/intelehealth/client/activities/videoLibraryActivity/VideoLibraryActivity.java @@ -16,8 +16,10 @@ import java.io.File; import io.intelehealth.client.R; +import io.intelehealth.client.utilities.Logger; public class VideoLibraryActivity extends AppCompatActivity implements VideoLibraryFragment.OnFragmentInteractionListener { + private static final String TAG = VideoLibraryActivity.class.getSimpleName(); final String LOG_TAG = VideoLibraryActivity.class.getSimpleName(); Toolbar mToolbar; @@ -46,15 +48,6 @@ public void onClick(View v) { if (isSDPresent) { if (isExternalStorageWritable()) { - /* - File[] files = getExternalFilesDirs(null); - if (files != null || files.length != 0) { - rootFile = files[files.length - 1]; - rootFile = new File(rootFile.getAbsolutePath() + File.separator + "Intelehealth Videos"); - if (!rootFile.exists()) rootFile.mkdir(); - openFragment(rootFile.getAbsolutePath()); - } - */ rootFile = getExtVideoStorageDir(this, "Intelehealth Videos"); openFragment(rootFile.getAbsolutePath()); @@ -108,9 +101,18 @@ public File getExtVideoStorageDir(Context context, String folderName) { // Get the directory for the app's private pictures directory. File file = new File(Environment.getExternalStoragePublicDirectory( Environment.DIRECTORY_MOVIES), folderName); + Logger.logD(TAG, file.getAbsolutePath()); if (!file.mkdirs()) { Log.e(LOG_TAG, "Directory not created"); } return file; } + + @Override + public boolean onSupportNavigateUp() { + onBackPressed(); + return super.onSupportNavigateUp(); + + } + } diff --git a/app/src/main/java/io/intelehealth/client/activities/videoLibraryActivity/VideoLibraryAdapter.java b/app/src/main/java/io/intelehealth/client/activities/videoLibraryActivity/VideoLibraryAdapter.java old mode 100644 new mode 100755 index 50b1b23d78..29620b16fd --- a/app/src/main/java/io/intelehealth/client/activities/videoLibraryActivity/VideoLibraryAdapter.java +++ b/app/src/main/java/io/intelehealth/client/activities/videoLibraryActivity/VideoLibraryAdapter.java @@ -43,6 +43,7 @@ public VideoLibraryHolder onCreateViewHolder(ViewGroup parent, int viewType) { @Override public void onBindViewHolder(VideoLibraryHolder holder, final int position) { //set Thumbnail + if(videoList.get(position).isDirectory()) holder.image.setImageResource (R.drawable.ic_action_folder_open); else if(videoList.get(position).isFile()) holder.image.setImageBitmap( diff --git a/app/src/main/java/io/intelehealth/client/activities/videoLibraryActivity/VideoLibraryFragment.java b/app/src/main/java/io/intelehealth/client/activities/videoLibraryActivity/VideoLibraryFragment.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/activities/visitSummaryActivity/HorizontalAdapter.java b/app/src/main/java/io/intelehealth/client/activities/visitSummaryActivity/HorizontalAdapter.java old mode 100644 new mode 100755 index d74b5186cc..8c50721f74 --- a/app/src/main/java/io/intelehealth/client/activities/visitSummaryActivity/HorizontalAdapter.java +++ b/app/src/main/java/io/intelehealth/client/activities/visitSummaryActivity/HorizontalAdapter.java @@ -121,16 +121,6 @@ public boolean onResourceReady(GlideDrawable glideDrawable, File file, Target() { - protected Bitmap doInBackground(Void... params) { - return decodeSampledBitmapFromResource(file.getAbsolutePath(),screen_width,screen_height); - } - protected void onPostExecute(Bitmap result) { - imageView.setImageBitmap(result); - } - - }.execute(); */ } }); diff --git a/app/src/main/java/io/intelehealth/client/activities/visitSummaryActivity/MyViewHolder.java b/app/src/main/java/io/intelehealth/client/activities/visitSummaryActivity/MyViewHolder.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/activities/visitSummaryActivity/VisitSummaryActivity.java b/app/src/main/java/io/intelehealth/client/activities/visitSummaryActivity/VisitSummaryActivity.java index 9f54ec2cab..65c5eced2a 100644 --- a/app/src/main/java/io/intelehealth/client/activities/visitSummaryActivity/VisitSummaryActivity.java +++ b/app/src/main/java/io/intelehealth/client/activities/visitSummaryActivity/VisitSummaryActivity.java @@ -3,7 +3,6 @@ import android.app.NotificationManager; import android.app.ProgressDialog; import android.content.BroadcastReceiver; -import android.content.ContentValues; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; @@ -11,8 +10,10 @@ import android.content.SharedPreferences; import android.database.Cursor; import android.database.CursorIndexOutOfBoundsException; +import android.database.SQLException; import android.database.sqlite.SQLiteDatabase; -import android.graphics.Typeface; +import android.graphics.Color; +import android.graphics.Paint; import android.net.ConnectivityManager; import android.net.NetworkInfo; import android.os.Build; @@ -50,13 +51,13 @@ import android.widget.CompoundButton; import android.widget.EditText; import android.widget.ImageButton; -import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.ProgressBar; import android.widget.TextView; import android.widget.Toast; import com.crashlytics.android.Crashlytics; +import com.sandro.restaurant.Restaurant; import org.apache.commons.lang3.StringUtils; import org.json.JSONException; @@ -68,6 +69,7 @@ import java.util.ArrayList; import java.util.Calendar; import java.util.Date; +import java.util.List; import java.util.Locale; import java.util.Set; @@ -83,8 +85,9 @@ import io.intelehealth.client.app.AppConstants; import io.intelehealth.client.database.dao.EncounterDAO; import io.intelehealth.client.database.dao.ImagesDAO; +import io.intelehealth.client.database.dao.ObsDAO; import io.intelehealth.client.database.dao.PatientsDAO; -import io.intelehealth.client.database.dao.PullDataDAO; +import io.intelehealth.client.database.dao.SyncDAO; import io.intelehealth.client.database.dao.VisitsDAO; import io.intelehealth.client.knowledgeEngine.Node; import io.intelehealth.client.models.Patient; @@ -109,8 +112,6 @@ public class VisitSummaryActivity extends AppCompatActivity { boolean uploaded = false; boolean downloaded = false; - boolean dataChanged = false; - String failedMessage; Context context; @@ -176,7 +177,7 @@ public class VisitSummaryActivity extends AppCompatActivity { String medHistory; String baseDir; String filePathPhyExam; - File phyExamDir; + File obsImgdir; NotificationManager mNotificationManager; NotificationCompat.Builder mBuilder; @@ -220,8 +221,6 @@ public class VisitSummaryActivity extends AppCompatActivity { public static String prescriptionHeader1; public static String prescriptionHeader2; - String additionalDocumentDir = "Additional Documents"; - String physicalExamDocumentDir = "Physical Exam"; SharedPreferences mSharedPreference; boolean hasLicense = false; String mFileName = "config.json"; @@ -230,7 +229,7 @@ public class VisitSummaryActivity extends AppCompatActivity { SessionManager sessionManager; String encounterUuid; String encounterVitals; - String encounterAdultIntials; + String encounterUuidAdultIntial; ProgressBar mProgressBar; TextView mProgressText; @@ -239,9 +238,8 @@ public class VisitSummaryActivity extends AppCompatActivity { ImageButton onExaminationDownload; DownloadPrescriptionService downloadPrescriptionService; - - ImageView ivPrescription; - private String hasPrescription = ""; + private TextView additionalImageDownloadText; + private TextView physcialExaminationDownloadText; @Override public boolean onCreateOptionsMenu(Menu menu) { @@ -270,12 +268,6 @@ public boolean onCreateOptionsMenu(Menu menu) { @Override public void onReceive(Context context, Intent intent) { -// if (intent.getAction().equals(AppConstants.MESSAGE_PROGRESS)) { -// Download download = intent.getParcelableExtra("download"); -// if (download.getProgress() == 100) { -// } else { -// } -// } onResume(); physicalDoumentsUpdates(); @@ -366,15 +358,14 @@ protected void onCreate(Bundle savedInstanceState) { patientUuid = intent.getStringExtra("patientUuid"); visitUuid = intent.getStringExtra("visitUuid"); encounterVitals = intent.getStringExtra("encounterUuidVitals"); - encounterAdultIntials = intent.getStringExtra("encounterUuidAdultIntial"); + encounterUuidAdultIntial = intent.getStringExtra("encounterUuidAdultIntial"); mSharedPreference = this.getSharedPreferences( "visit_summary", Context.MODE_PRIVATE); patientName = intent.getStringExtra("name"); intentTag = intent.getStringExtra("tag"); isPastVisit = intent.getBooleanExtra("pastVisit", false); - hasPrescription = intent.getStringExtra("hasPrescription"); - Set selectedExams = mSharedPreference.getStringSet("exam_" + patientUuid, null); + Set selectedExams = sessionManager.getVisitSummary(patientUuid); if (physicalExams == null) physicalExams = new ArrayList<>(); physicalExams.clear(); if (selectedExams != null && !selectedExams.isEmpty()) { @@ -383,9 +374,7 @@ protected void onCreate(Bundle savedInstanceState) { } registerBroadcastReceiverDynamically(); registerDownloadPrescription(); - SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); -// if (sharedPreferences.contains("licensekey")) - if (!sessionManager.getLicenseKey().isEmpty()) + if (sessionManager.getLicenseKey() != null && !sessionManager.getLicenseKey().isEmpty()) hasLicense = true; //Check for license key and load the correct config file @@ -409,7 +398,7 @@ protected void onCreate(Bundle savedInstanceState) { setTitle(R.string.title_activity_patient_summary); setTitle(patientName + ": " + getTitle()); - db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); + db = AppConstants.inteleHealthDatabaseHelper.getWriteDb(); super.onCreate(savedInstanceState); @@ -441,42 +430,10 @@ protected void onCreate(Bundle savedInstanceState) { additionalCommentsTextView = findViewById(R.id.textView_content_additional_comments); followUpDateTextView = findViewById(R.id.textView_content_follow_up_date); - ivPrescription = findViewById(R.id.iv_prescription); - - if (hasPrescription.equalsIgnoreCase("true")) { - ivPrescription.setImageDrawable(getResources().getDrawable(R.drawable.ic_prescription_green)); - } - - baseDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES).getAbsolutePath(); -// -// filePathPhyExam = baseDir + File.separator + "Patient Images" + File.separator + patientUuid + File.separator + -// visitUuid + File.separator + physicalExamDocumentDir; - - phyExamDir = new File(AppConstants.IMAGE_PATH); + obsImgdir = new File(AppConstants.IMAGE_PATH); flag = findViewById(R.id.flaggedcheckbox); -// EncounterDAO encounterDAO = new EncounterDAO(); -// VisitsDAO visitsDAO = new VisitsDAO(); -// try { -// visitsDAO.isUpdatedEmergencyColumn(visitUuid, encounterDAO.isEmergency(visitUuid)); -// } catch (DAOException e) { -// e.printStackTrace(); -// } -// db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); -// String query = "Select ifnull(emergency,'') as emergency FROM tbl_visit WHERE uuid = '" + visitUuid + "'"; -// Cursor cursor = db.rawQuery(query, null); -// if (cursor != null) { -// while (cursor.moveToNext()) { -// String emergency = cursor.getString(cursor.getColumnIndex("emergency")); -// if (emergency.equalsIgnoreCase("true") || emergency.equalsIgnoreCase("1")) { -// flag.setChecked(true); -// } -// } -// } -// if (cursor != null) { -// cursor.close(); -// } EncounterDAO encounterDAO = new EncounterDAO(); String emergencyUuid = ""; try { @@ -506,10 +463,30 @@ protected void onCreate(Bundle savedInstanceState) { additionalDocumentsDownlaod = findViewById(R.id.imagebutton_download_additional_document); onExaminationDownload = findViewById(R.id.imagebutton_download_physexam); + additionalDocumentsDownlaod.setVisibility(View.GONE); + + physcialExaminationDownloadText = findViewById(R.id.physcial_examination_download); + onExaminationDownload.setVisibility(View.GONE); + + //image download for additional documents + additionalImageDownloadText = findViewById(R.id.additional_documents_download); + Paint p = new Paint(); + p.setColor(Color.BLUE); + additionalImageDownloadText.setPaintFlags(p.getColor()); + additionalImageDownloadText.setPaintFlags(Paint.UNDERLINE_TEXT_FLAG); + + + additionalDocumentImagesDownload(); + + //image download for physcialExamination documents + physcialExaminationDownloadText.setPaintFlags(p.getColor()); + physcialExaminationDownloadText.setPaintFlags(Paint.UNDERLINE_TEXT_FLAG); + physcialExaminationImagesDownload(); + + downloadButton.setEnabled(false); downloadButton.setVisibility(View.GONE); - db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); if (isPastVisit) { editVitals.setVisibility(View.GONE); editComplaint.setVisibility(View.GONE); @@ -546,37 +523,12 @@ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { } } }); - db.close(); uploadButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { - -// db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); -// EmergencyEncounterDAO emergencyEncounterDAO = new EmergencyEncounterDAO(); - -// if (flag.isChecked()) { -//// Log.d(TAG, "Emergency flag val: " + flag.isChecked()); -//// String emergency_checked = String.valueOf(flag.isChecked()); -//// String updateQuery = "UPDATE tbl_visit SET emergency ='" + emergency_checked + "' WHERE uuid = '" + visitUuid + "'"; -//// db.execSQL(updateQuery); -//// db.close(); -// emergencyEncounterDAO.uploadEncounterEmergency(visitUuid, 0); -// } else { -//// db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); -//// Log.d(TAG, "Emergency flag val: " + flag.isChecked()); -//// String emergency_checked = String.valueOf(flag.isChecked()); -//// String updateQuery = "UPDATE tbl_visit SET emergency ='" + emergency_checked + "' WHERE uuid = '" + visitUuid + "'"; -//// db.execSQL(updateQuery); -//// db.close(); -// emergencyEncounterDAO.uploadEncounterEmergency(visitUuid, 1); -//// if (NetworkConnection.isOnline(getApplication())) { -//// emergencyEncounterDAO.removeEncounterEmergency(visitUuid, db); -//// } -// } if (patient.getOpenmrs_id() == null || patient.getOpenmrs_id().isEmpty()) { String patientSelection = "uuid = ?"; String[] patientArgs = {String.valueOf(patient.getUuid())}; - db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); String table = "tbl_patient"; String[] columnsToReturn = {"openmrs_id"}; final Cursor idCursor = db.query(table, columnsToReturn, patientSelection, patientArgs, null, null, null); @@ -603,8 +555,6 @@ public void onClick(View view) { if (visitIDCursor != null) visitIDCursor.close(); } - db.close(); - db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); String[] columnsToReturn = {"startdate"}; String visitIDorderBy = "startdate"; String visitIDSelection = "uuid = ?"; @@ -617,32 +567,39 @@ public void onClick(View view) { if (!flag.isChecked()) { // } - Snackbar.make(view, "Uploading to doctor.", Snackbar.LENGTH_LONG).show(); + + new Restaurant(VisitSummaryActivity.this, "Uploading to doctor.", Snackbar.LENGTH_LONG) + .setBackgroundColor(Color.BLACK) + .setTextColor(Color.WHITE) + .show(); + if (NetworkConnection.isOnline(getApplication())) { - AppConstants.notificationUtils.showNotifications("Visit Data Upload", "Uploading visit data", VisitSummaryActivity.this); - PullDataDAO pullDataDAO = new PullDataDAO(); + AppConstants.notificationUtils.showNotifications("Visit Data Upload", "Uploading visit data", 3, VisitSummaryActivity.this); + SyncDAO syncDAO = new SyncDAO(); + ProgressDialog pd = new ProgressDialog(VisitSummaryActivity.this); + pd.setTitle("Syncing"); + pd.show(); + pd.setCancelable(false); + final Handler handler = new Handler(); handler.postDelayed(new Runnable() { @Override public void run() { // Added the 4 sec delay and then push data.For some reason doing immediately does not work //Do something after 100ms -// pullDataDAO.pushDataApi(); -// imagesPushDAO.patientProfileImagesPush(); -// imagesPushDAO.obsImagesPush(); -// pullDataDAO.pullData(VisitSummaryActivity.this); SyncUtils syncUtils = new SyncUtils(); boolean isSynced = syncUtils.syncForeground(); if (isSynced) - AppConstants.notificationUtils.DownloadDone("Visit Data Upload", "Uploaded visit data", VisitSummaryActivity.this); + AppConstants.notificationUtils.DownloadDone("Visit Data Upload", "Uploaded visit data", 3, VisitSummaryActivity.this); else - AppConstants.notificationUtils.DownloadDone("Visit Data Upload", "failed to Uploaded", VisitSummaryActivity.this); + AppConstants.notificationUtils.DownloadDone("Visit Data Upload", "failed to Uploaded", 3, VisitSummaryActivity.this); uploaded = true; + pd.dismiss(); Toast.makeText(VisitSummaryActivity.this, "Upload Completed", Toast.LENGTH_SHORT).show(); } }, 4000); } else { - AppConstants.notificationUtils.showNotifications("Visit Data Upload", "Check your connectivity", VisitSummaryActivity.this); + AppConstants.notificationUtils.showNotifications("Visit Data Upload", "Check your connectivity", 3, VisitSummaryActivity.this); } } @@ -672,12 +629,10 @@ public void run() { bpView = findViewById(R.id.textView_bp_value); tempView = findViewById(R.id.textView_temp_value); -// textView_temp tempfaren = findViewById(R.id.textView_temp_faren); tempcel = findViewById(R.id.textView_temp); try { JSONObject obj = null; -// #630 if (hasLicense) { obj = new JSONObject(FileUtils.readFileRoot(mFileName, VisitSummaryActivity.this)); //Load the config file } else { @@ -732,11 +687,7 @@ public void run() { respiratory.setText(resp.getValue()); spO2View.setText(spO2.getValue()); if (complaint.getValue() != null) - complaintView.setText(Html.fromHtml(complaint.getValue().replace("○ c.", "
○ " + getResources().getString(R.string.patient_reports) + " ") - .replace("○ s.", "
○ " + getResources().getString(R.string.patient_denies) + " ") - .replace("c.", "") - .replace("s.", "") - .replace("
• Associated symptoms -", ""))); + complaintView.setText(Html.fromHtml(complaint.getValue())); if (famHistory.getValue() != null) famHistView.setText(Html.fromHtml(famHistory.getValue())); if (patHistory.getValue() != null) @@ -744,8 +695,6 @@ public void run() { if (phyExam.getValue() != null) physFindingsView.setText(Html.fromHtml(phyExam.getValue())); - SharedPreferences.Editor e = sharedPreferences.edit(); - editVitals.setOnClickListener(new View.OnClickListener() { @Override @@ -754,9 +703,8 @@ public void onClick(View v) { intent1.putExtra("patientUuid", patientUuid); intent1.putExtra("visitUuid", visitUuid); intent1.putExtra("encounterUuidVitals", encounterVitals); - intent1.putExtra("encounterUuidAdultIntial", encounterAdultIntials); + intent1.putExtra("encounterUuidAdultIntial", encounterUuidAdultIntial); intent1.putExtra("name", patientName); - // intent.putStringArrayListExtra("exams", physicalExams); intent1.putExtra("tag", "edit"); startActivity(intent1); } @@ -825,7 +773,7 @@ public void onClick(DialogInterface dialogInterface, int i) { intent1.putExtra("patientUuid", patientUuid); intent1.putExtra("visitUuid", visitUuid); intent1.putExtra("encounterUuidVitals", encounterVitals); - intent1.putExtra("encounterUuidAdultIntial", encounterAdultIntials); + intent1.putExtra("encounterUuidAdultIntial", encounterUuidAdultIntial); intent1.putExtra("name", patientName); intent1.putExtra("tag", "edit"); startActivity(intent1); @@ -833,20 +781,7 @@ public void onClick(DialogInterface dialogInterface, int i) { } }); - //famHistDialog.show(); - AlertDialog alertDialog = famHistDialog.create(); - alertDialog.show(); - Button pb = alertDialog.getButton(AlertDialog.BUTTON_POSITIVE); - pb.setTextColor(getResources().getColor((R.color.colorPrimary))); - pb.setTypeface(Typeface.DEFAULT, Typeface.BOLD); - - Button nb = alertDialog.getButton(AlertDialog.BUTTON_NEGATIVE); - nb.setTextColor(getResources().getColor((R.color.colorPrimary))); - nb.setTypeface(Typeface.DEFAULT, Typeface.BOLD); - - Button neutralb = alertDialog.getButton(AlertDialog.BUTTON_NEUTRAL); - neutralb.setTextColor(getResources().getColor((R.color.colorPrimary))); - neutralb.setTypeface(Typeface.DEFAULT, Typeface.BOLD); + famHistDialog.show(); } }); @@ -860,13 +795,8 @@ public void onClick(View v) { complaintDialog.setView(convertView); final TextView complaintText = convertView.findViewById(R.id.textView_entry); - if (complaint.getValue() != null) { - complaintText.setText(Html.fromHtml(complaint.getValue().replace("○ c.", "
○ " + getResources().getString(R.string.patient_reports) + " ") - .replace("○ s.", "
○ " + getResources().getString(R.string.patient_denies) + " ") - .replace("c.", "") - .replace("s.", "") - .replace("
• Associated symptoms -", ""))); - } + if (complaint.getValue() != null) + complaintText.setText(Html.fromHtml(complaint.getValue())); complaintText.setEnabled(false); complaintDialog.setPositiveButton(getString(R.string.generic_manual_entry), new DialogInterface.OnClickListener() { @@ -875,31 +805,18 @@ public void onClick(DialogInterface dialogInterface, int i) { final AlertDialog.Builder textInput = new AlertDialog.Builder(VisitSummaryActivity.this); textInput.setTitle(R.string.question_text_input); final EditText dialogEditText = new EditText(VisitSummaryActivity.this); - if (complaint.getValue() != null) { - dialogEditText.setText(Html.fromHtml(complaint.getValue().replace("○ c.", "
○ " + getResources().getString(R.string.patient_reports) + " ") - .replace("○ s.", "
○ " + getResources().getString(R.string.patient_denies) + " ") - .replace("c.", "") - .replace("s.", "") - .replace("
• Associated symptoms -", ""))); - } else { + if (complaint.getValue() != null) + dialogEditText.setText(Html.fromHtml(complaint.getValue())); + else dialogEditText.setText(""); - } textInput.setView(dialogEditText); textInput.setPositiveButton(R.string.generic_ok, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { - complaint.setValue(dialogEditText.getText().toString().replace("\n", "
")); + complaint.setValue(dialogEditText.getText().toString()); if (complaint.getValue() != null) { - complaintText.setText(Html.fromHtml(complaint.getValue().replace("○ c.", "
○ " + getResources().getString(R.string.patient_reports) + " ") - .replace("○ s.", "
○ " + getResources().getString(R.string.patient_denies) + " ") - .replace("c.", "") - .replace("s.", "") - .replace("
• Associated symptoms -", ""))); - complaintView.setText(Html.fromHtml(complaint.getValue().replace("○ c.", "
○ " + getResources().getString(R.string.patient_reports) + " ") - .replace("○ s.", "
○ " + getResources().getString(R.string.patient_denies) + " ") - .replace("c.", "") - .replace("s.", "") - .replace("
• Associated symptoms -", ""))); + complaintText.setText(Html.fromHtml(complaint.getValue())); + complaintView.setText(Html.fromHtml(complaint.getValue())); } updateDatabase(complaint.getValue(), UuidDictionary.CURRENT_COMPLAINT); dialog.dismiss(); @@ -919,11 +836,27 @@ public void onClick(DialogInterface dialog, int which) { complaintDialog.setNegativeButton(getString(R.string.generic_erase_redo), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { + //Deleting the old image in physcial examination + if (obsImgdir.exists()) { + ImagesDAO imagesDAO = new ImagesDAO(); + + try { + List imageList = imagesDAO.getImages(encounterUuidAdultIntial, UuidDictionary.COMPLEX_IMAGE_PE); + for (String obsImageUuid : imageList) { + String imageName = obsImageUuid + ".jpg"; + new File(obsImgdir, imageName).deleteOnExit(); + } + imagesDAO.deleteConceptImages(encounterUuidAdultIntial, UuidDictionary.COMPLEX_IMAGE_PE); + } catch (DAOException e1) { + Crashlytics.getInstance().core.logException(e1); + } + } + Intent intent1 = new Intent(VisitSummaryActivity.this, ComplaintNodeActivity.class); intent1.putExtra("patientUuid", patientUuid); intent1.putExtra("visitUuid", visitUuid); intent1.putExtra("encounterUuidVitals", encounterVitals); - intent1.putExtra("encounterUuidAdultIntial", encounterAdultIntials); + intent1.putExtra("encounterUuidAdultIntial", encounterUuidAdultIntial); intent1.putExtra("name", patientName); intent1.putExtra("tag", "edit"); startActivity(intent1); @@ -938,21 +871,7 @@ public void onClick(DialogInterface dialogInterface, int i) { } }); - //complaintDialog.show(); - AlertDialog alertDialog = complaintDialog.create(); - alertDialog.show(); - Button pb = alertDialog.getButton(AlertDialog.BUTTON_POSITIVE); - pb.setTextColor(getResources().getColor((R.color.colorPrimary))); - pb.setTypeface(Typeface.DEFAULT, Typeface.BOLD); - - Button nb = alertDialog.getButton(AlertDialog.BUTTON_NEGATIVE); - nb.setTextColor(getResources().getColor((R.color.colorPrimary))); - nb.setTypeface(Typeface.DEFAULT, Typeface.BOLD); - - Button neutralb = alertDialog.getButton(AlertDialog.BUTTON_NEUTRAL); - neutralb.setTextColor(getResources().getColor((R.color.colorPrimary))); - neutralb.setTypeface(Typeface.DEFAULT, Typeface.BOLD); - + complaintDialog.show(); } }); @@ -985,7 +904,7 @@ public void onClick(DialogInterface dialogInterface, int i) { @Override public void onClick(DialogInterface dialog, int which) { - phyExam.setValue(dialogEditText.getText().toString().replace("\n", "
")); + phyExam.setValue(dialogEditText.getText().toString()); if (phyExam.getValue() != null) { physicalText.setText(Html.fromHtml(phyExam.getValue())); physFindingsView.setText(Html.fromHtml(phyExam.getValue())); @@ -1008,43 +927,25 @@ public void onClick(DialogInterface dialog, int which) { physicalDialog.setNegativeButton(getString(R.string.generic_erase_redo), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { - if (phyExamDir.exists()) { - String[] children = phyExamDir.list(); - String[] childList = children; - //SQLiteDatabase localdb = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); - for (String child : childList) { - new File(phyExamDir, child).delete(); - -// String[] coloumns = {"uuid","image_path"}; -// String[] selectionArgs = {phyExamDir.getAbsolutePath() + File.separator + child}; - ImagesDAO imagesDAO = new ImagesDAO(); - try { - imagesDAO.deleteImageFromDatabase(io.intelehealth.client.utilities.StringUtils.getFileNameWithoutExtensionString(child)); - } catch (DAOException e1) { - e1.printStackTrace(); + if (obsImgdir.exists()) { + ImagesDAO imagesDAO = new ImagesDAO(); + + try { + List imageList = imagesDAO.getImages(encounterUuidAdultIntial, UuidDictionary.COMPLEX_IMAGE_PE); + for (String obsImageUuid : imageList) { + String imageName = obsImageUuid + ".jpg"; + new File(obsImgdir, imageName).deleteOnExit(); } -// Cursor cursor = localdb.query("tbl_image_records", coloumns, "image_path = ?", selectionArgs, null, null, null); -// if (cursor != null && cursor.moveToFirst()) { -// String parse_id = cursor.getString(cursor.getColumnIndexOrThrow("image_path")); -// if (parse_id != null && !parse_id.isEmpty()) { -// ContentValues contentValues = new ContentValues(); -// contentValues.put("delete_status", 1); -// String[] whereArgs = {parse_id}; -// localdb.update("image_records", contentValues, "parse_id = ?", whereArgs); -// } else { -// localdb.execSQL("DELETE FROM image_records WHERE image_path=" + -// "'" + phyExamDir.getAbsolutePath() + File.separator + child + "'"); -// } -// } + imagesDAO.deleteConceptImages(encounterUuidAdultIntial, UuidDictionary.COMPLEX_IMAGE_PE); + } catch (DAOException e1) { + Crashlytics.getInstance().core.logException(e1); } - phyExamDir.delete(); - //localdb.close(); } Intent intent1 = new Intent(VisitSummaryActivity.this, PhysicalExamActivity.class); intent1.putExtra("patientUuid", patientUuid); intent1.putExtra("visitUuid", visitUuid); intent1.putExtra("encounterUuidVitals", encounterVitals); - intent1.putExtra("encounterUuidAdultIntial", encounterAdultIntials); + intent1.putExtra("encounterUuidAdultIntial", encounterUuidAdultIntial); intent1.putExtra("name", patientName); intent1.putExtra("tag", "edit"); // intent1.putStringArrayListExtra("exams", physicalExams); @@ -1062,20 +963,7 @@ public void onClick(DialogInterface dialogInterface, int i) { } }); - //physicalDialog.show(); - AlertDialog alertDialog = physicalDialog.create(); - alertDialog.show(); - Button pb = alertDialog.getButton(AlertDialog.BUTTON_POSITIVE); - pb.setTextColor(getResources().getColor((R.color.colorPrimary))); - pb.setTypeface(Typeface.DEFAULT, Typeface.BOLD); - - Button nb = alertDialog.getButton(AlertDialog.BUTTON_NEGATIVE); - nb.setTextColor(getResources().getColor((R.color.colorPrimary))); - nb.setTypeface(Typeface.DEFAULT, Typeface.BOLD); - - Button neutralb = alertDialog.getButton(AlertDialog.BUTTON_NEUTRAL); - neutralb.setTextColor(getResources().getColor((R.color.colorPrimary))); - neutralb.setTypeface(Typeface.DEFAULT, Typeface.BOLD); + physicalDialog.show(); } }); @@ -1134,7 +1022,7 @@ public void onClick(DialogInterface dialogInterface, int i) { intent1.putExtra("patientUuid", patientUuid); intent1.putExtra("visitUuid", visitUuid); intent1.putExtra("encounterUuidVitals", encounterVitals); - intent1.putExtra("encounterUuidAdultIntial", encounterAdultIntials); + intent1.putExtra("encounterUuidAdultIntial", encounterUuidAdultIntial); intent1.putExtra("name", patientName); intent1.putExtra("tag", "edit"); startActivity(intent1); @@ -1149,21 +1037,7 @@ public void onClick(DialogInterface dialogInterface, int i) { } }); - //historyDialog.show(); - AlertDialog alertDialog = historyDialog.create(); - alertDialog.show(); - Button pb = alertDialog.getButton(AlertDialog.BUTTON_POSITIVE); - pb.setTextColor(getResources().getColor((R.color.colorPrimary))); - pb.setTypeface(Typeface.DEFAULT, Typeface.BOLD); - - Button nb = alertDialog.getButton(AlertDialog.BUTTON_NEGATIVE); - nb.setTextColor(getResources().getColor((R.color.colorPrimary))); - nb.setTypeface(Typeface.DEFAULT, Typeface.BOLD); - - Button neutralb = alertDialog.getButton(AlertDialog.BUTTON_NEUTRAL); - neutralb.setTextColor(getResources().getColor((R.color.colorPrimary))); - neutralb.setTypeface(Typeface.DEFAULT, Typeface.BOLD); - + historyDialog.show(); } }); @@ -1174,7 +1048,7 @@ public void onClick(View v) { addDocs.putExtra("patientUuid", patientUuid); addDocs.putExtra("visitUuid", visitUuid); addDocs.putExtra("encounterUuidVitals", encounterVitals); - addDocs.putExtra("encounterUuidAdultIntial", encounterAdultIntials); + addDocs.putExtra("encounterUuidAdultIntial", encounterUuidAdultIntial); startActivity(addDocs); } }); @@ -1182,19 +1056,12 @@ public void onClick(View v) { downloadButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { -// if (uploaded) { SyncUtils syncUtils = new SyncUtils(); syncUtils.syncForeground(); - -// boolean pull = pullDataDAO.pullData(VisitSummaryActivity.this); -// if (pull) - AppConstants.notificationUtils.DownloadDone("download from doctor", "prescription Downloaded", VisitSummaryActivity.this); -// else -// AppConstants.notificationUtils.DownloadDone("download from doctor", "no prescription Downloaded", VisitSummaryActivity.this); + AppConstants.notificationUtils.DownloadDone("download from doctor", "prescription Downloaded", 3, VisitSummaryActivity.this); uploaded = true; ProgressDialog pd = new ProgressDialog(VisitSummaryActivity.this); pd.setTitle("Downloading prescription"); - pd.setMessage("Please wait..."); pd.show(); final Handler handler = new Handler(); handler.postDelayed(new Runnable() { @@ -1203,13 +1070,7 @@ public void run() { downloadPrescription(); pd.dismiss(); } - }, 2000); - -// } else { -// DialogUtils dialogUtils = new DialogUtils(); -// dialogUtils.showOkDialog(VisitSummaryActivity.this, "Error", "first need to upload", "ok"); -// } - //mLayout.addView(downloadButton, mLayout.getChildCount()); + }, 5000); } }); additionalDocumentsDownlaod.setOnClickListener(new View.OnClickListener() { @@ -1226,13 +1087,58 @@ public void onClick(View v) { }); } + private void physcialExaminationImagesDownload() { + ImagesDAO imagesDAO = new ImagesDAO(); + try { + List imageList = imagesDAO.isImageListObsExists(encounterUuidAdultIntial, UuidDictionary.COMPLEX_IMAGE_PE); + for (String images : imageList) { + if (imagesDAO.isLocalImageUuidExists(images)) + physcialExaminationDownloadText.setVisibility(View.GONE); + else + physcialExaminationDownloadText.setVisibility(View.VISIBLE); + } + } catch (DAOException e) { + e.printStackTrace(); + } + physcialExaminationDownloadText.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + startDownload(UuidDictionary.COMPLEX_IMAGE_PE); + physcialExaminationDownloadText.setVisibility(View.GONE); + } + }); + } + + private void additionalDocumentImagesDownload() { + ImagesDAO imagesDAO = new ImagesDAO(); + try { + List imageList = imagesDAO.isImageListObsExists(encounterUuidAdultIntial, UuidDictionary.COMPLEX_IMAGE_AD); + for (String images : imageList) { + if (imagesDAO.isLocalImageUuidExists(images)) + additionalImageDownloadText.setVisibility(View.GONE); + else + additionalImageDownloadText.setVisibility(View.VISIBLE); + } + } catch (DAOException e) { + e.printStackTrace(); + } + additionalImageDownloadText.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + startDownload(UuidDictionary.COMPLEX_IMAGE_AD); + additionalImageDownloadText.setVisibility(View.GONE); + } + }); + + } + private void physicalDoumentsUpdates() { ImagesDAO imagesDAO = new ImagesDAO(); ArrayList fileuuidList = new ArrayList(); ArrayList fileList = new ArrayList(); try { - fileuuidList = imagesDAO.getImageUuid(encounterAdultIntials, UuidDictionary.COMPLEX_IMAGE_PE); + fileuuidList = imagesDAO.getImageUuid(encounterUuidAdultIntial, UuidDictionary.COMPLEX_IMAGE_PE); for (String fileuuid : fileuuidList) { String filename = AppConstants.IMAGE_PATH + fileuuid + ".jpg"; if (new File(filename).exists()) { @@ -1248,17 +1154,6 @@ private void physicalDoumentsUpdates() { } catch (Exception file) { Logger.logD(TAG, file.getMessage()); } -// if (!phyExamDir.exists()) { -// phyExamDir.mkdirs(); -// Log.v(TAG, "directory ceated " + phyExamDir.getAbsolutePath()); -// } else { -// File[] files = phyExamDir.listFiles(); -// List fileList = Arrays.asList(files); -// HorizontalAdapter horizontalAdapter = new HorizontalAdapter(fileList, this); -// mPhysicalExamsLayoutManager = new LinearLayoutManager(VisitSummaryActivity.this, LinearLayoutManager.HORIZONTAL, false); -// mPhysicalExamsRecyclerView.setLayoutManager(mPhysicalExamsLayoutManager); -// mPhysicalExamsRecyclerView.setAdapter(horizontalAdapter); -// } } private void startDownload(String imageType) { @@ -1267,7 +1162,7 @@ private void startDownload(String imageType) { intent.putExtra("patientUuid", patientUuid); intent.putExtra("visitUuid", visitUuid); intent.putExtra("encounterUuidVitals", encounterVitals); - intent.putExtra("encounterUuidAdultIntial", encounterAdultIntials); + intent.putExtra("encounterUuidAdultIntial", encounterUuidAdultIntial); intent.putExtra("ImageType", imageType); startService(intent); @@ -1365,18 +1260,6 @@ public void onPageFinished(WebView view, String url) { } catch (Exception e) { Crashlytics.getInstance().core.logException(e); } -// if (temperature.getValue() != null) { -// if (Integer.parseInt(temperature.getValue()) > 80) { -// mTemp = "Temperature(F): " + temperature.getValue(); -// } else { -// mTemp = "Temperature(C): " + temperature.getValue(); -// } -// }else{ -// mTemp=""; -// } - -// mTemp = temperature.getValue(); - mresp = resp.getValue(); mSPO2 = "SpO2(%): " + spO2.getValue(); String mComplaint = complaint.getValue(); @@ -1490,7 +1373,6 @@ public void onPageFinished(WebView view, String url) { // Keep a reference to WebView object until you pass the PrintDocumentAdapter // to the PrintManager mWebView = webView; - db.close(); } /** @@ -1537,11 +1419,10 @@ public void onClick(DialogInterface dialog, int which) { intent.putExtra("patientUuid", patientUuid); intent.putExtra("visitUuid", visitUuid); intent.putExtra("encounterUuidVitals", encounterVitals); - intent.putExtra("encounterUuidAdultIntial", encounterAdultIntials); + intent.putExtra("encounterUuidAdultIntial", encounterUuidAdultIntial); intent.putExtra("state", state); intent.putExtra("name", patientName); intent.putExtra("tag", intentTag); - // intent.putStringArrayListExtra("exams", physicalExams); startActivity(intent); } }); @@ -1551,11 +1432,10 @@ public void onClick(DialogInterface dialog, int which) { intent.putExtra("patientUuid", patientUuid); intent.putExtra("visitUuid", visitUuid); intent.putExtra("encounterUuidVitals", encounterVitals); - intent.putExtra("encounterUuidAdultIntial", encounterAdultIntials); + intent.putExtra("encounterUuidAdultIntial", encounterUuidAdultIntial); intent.putExtra("state", state); intent.putExtra("name", patientName); intent.putExtra("tag", intentTag); - // intent.putStringArrayListExtra("exams", physicalExams); startActivity(intent); } } else { @@ -1584,7 +1464,6 @@ public void onClick(DialogInterface dialog, int which) { */ public void queryData(String dataString) { - db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); String patientSelection = "uuid = ?"; String[] patientArgs = {dataString}; @@ -1615,8 +1494,6 @@ public void queryData(String dataString) { } while (idCursor.moveToNext()); } idCursor.close(); - db.close(); - db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); PatientsDAO patientsDAO = new PatientsDAO(); String patientSelection1 = "patientuuid = ?"; String[] patientArgs1 = {patientUuid}; @@ -1653,13 +1530,11 @@ public void queryData(String dataString) { } while (idCursor1.moveToNext()); } idCursor1.close(); - db.close(); - db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); String[] columns = {"value", " conceptuuid"}; try { String famHistSelection = "encounteruuid = ? AND conceptuuid = ?"; - String[] famHistArgs = {encounterAdultIntials, UuidDictionary.RHK_FAMILY_HISTORY_BLURB}; + String[] famHistArgs = {encounterUuidAdultIntial, UuidDictionary.RHK_FAMILY_HISTORY_BLURB}; Cursor famHistCursor = db.query("tbl_obs", columns, famHistSelection, famHistArgs, null, null, null); famHistCursor.moveToLast(); String famHistText = famHistCursor.getString(famHistCursor.getColumnIndexOrThrow("value")); @@ -1672,7 +1547,7 @@ public void queryData(String dataString) { try { String medHistSelection = "encounteruuid = ? AND conceptuuid = ?"; - String[] medHistArgs = {encounterAdultIntials, UuidDictionary.RHK_MEDICAL_HISTORY_BLURB}; + String[] medHistArgs = {encounterUuidAdultIntial, UuidDictionary.RHK_MEDICAL_HISTORY_BLURB}; Cursor medHistCursor = db.query("tbl_obs", columns, medHistSelection, medHistArgs, null, null, null); medHistCursor.moveToLast(); @@ -1695,31 +1570,44 @@ public void queryData(String dataString) { patHistory.setValue(""); // if medical history does not exist } //vitals display code - String visitSelection = "encounteruuid = ?"; + String visitSelection = "encounteruuid = ? AND voided!='1'"; String[] visitArgs = {encounterVitals}; - Cursor visitCursor = db.query("tbl_obs", columns, visitSelection, visitArgs, null, null, null); - if (visitCursor.moveToFirst()) { - do { - String dbConceptID = visitCursor.getString(visitCursor.getColumnIndex("conceptuuid")); - String dbValue = visitCursor.getString(visitCursor.getColumnIndex("value")); - parseData(dbConceptID, dbValue); - } while (visitCursor.moveToNext()); + if (encounterVitals != null) { + try { + Cursor visitCursor = db.query("tbl_obs", columns, visitSelection, visitArgs, null, null, null); + if (visitCursor != null && visitCursor.moveToFirst()) { + do { + String dbConceptID = visitCursor.getString(visitCursor.getColumnIndex("conceptuuid")); + String dbValue = visitCursor.getString(visitCursor.getColumnIndex("value")); + parseData(dbConceptID, dbValue); + } while (visitCursor.moveToNext()); + } + if (visitCursor != null) { + visitCursor.close(); + } + } catch (SQLException e) { + Crashlytics.getInstance().core.logException(e); + } } - visitCursor.close(); //adult intails display code - String encounterselection = "encounteruuid = ? AND conceptuuid != ? AND conceptuuid != ?"; - String[] encounterargs = {encounterAdultIntials, UuidDictionary.COMPLEX_IMAGE_AD, UuidDictionary.COMPLEX_IMAGE_PE}; + String encounterselection = "encounteruuid = ? AND conceptuuid != ? AND conceptuuid != ? AND voided!='1'"; + String[] encounterargs = {encounterUuidAdultIntial, UuidDictionary.COMPLEX_IMAGE_AD, UuidDictionary.COMPLEX_IMAGE_PE}; Cursor encountercursor = db.query("tbl_obs", columns, encounterselection, encounterargs, null, null, null); - if (encountercursor.moveToFirst()) { - do { - String dbConceptID = encountercursor.getString(encountercursor.getColumnIndex("conceptuuid")); - String dbValue = encountercursor.getString(encountercursor.getColumnIndex("value")); - parseData(dbConceptID, dbValue); - } while (encountercursor.moveToNext()); + try { + if (encountercursor != null && encountercursor.moveToFirst()) { + do { + String dbConceptID = encountercursor.getString(encountercursor.getColumnIndex("conceptuuid")); + String dbValue = encountercursor.getString(encountercursor.getColumnIndex("value")); + parseData(dbConceptID, dbValue); + } while (encountercursor.moveToNext()); + } + if (encountercursor != null) { + encountercursor.close(); + } + } catch (SQLException sql) { + Crashlytics.getInstance().core.logException(sql); } - encountercursor.close(); -// setup the downloaded prescription -// downloadPrescription(); + downloadPrescriptionDefault(); } @@ -1894,21 +1782,25 @@ private void createNewCardView(String title, String content, int index) { */ private void updateDatabase(String string, String conceptID) { - SQLiteDatabase localdb = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); - - ContentValues contentValues = new ContentValues(); - contentValues.put("value", string); - contentValues.put("sync", "false"); + ObsDTO obsDTO = new ObsDTO(); + ObsDAO obsDAO = new ObsDAO(); + try { + obsDTO.setConceptuuid(String.valueOf(conceptID)); + obsDTO.setEncounteruuid(encounterUuidAdultIntial); + obsDTO.setCreator(sessionManager.getCreatorID()); + obsDTO.setValue(string); + obsDTO.setUuid(obsDAO.getObsuuid(encounterUuidAdultIntial, String.valueOf(conceptID))); - String selection = "encounteruuid = ? AND conceptuuid = ?"; - String[] args = {encounterAdultIntials, String.valueOf(conceptID)}; + obsDAO.updateObs(obsDTO); - int updated = localdb.updateWithOnConflict("tbl_obs", contentValues, selection, args, SQLiteDatabase.CONFLICT_REPLACE); + } catch (DAOException dao) { + Crashlytics.getInstance().core.logException(dao); + } - localdb.close(); EncounterDAO encounterDAO = new EncounterDAO(); try { - encounterDAO.updateEncounterSync("false", encounterAdultIntials); + encounterDAO.updateEncounterSync("false", encounterUuidAdultIntial); + encounterDAO.updateEncounterModifiedDate(encounterUuidAdultIntial); } catch (DAOException e) { Crashlytics.getInstance().core.logException(e); } @@ -1935,15 +1827,12 @@ public void onResume() // register the receiver here callBroadcastReceiver(); - String filePathAddDoc = baseDir + File.separator + "Patient Images" + File.separator + patientUuid + File.separator + - visitUuid + File.separator + additionalDocumentDir; - ImagesDAO imagesDAO = new ImagesDAO(); ArrayList fileuuidList = new ArrayList(); ArrayList fileList = new ArrayList(); try { - fileuuidList = imagesDAO.getImageUuid(encounterAdultIntials, UuidDictionary.COMPLEX_IMAGE_AD); + fileuuidList = imagesDAO.getImageUuid(encounterUuidAdultIntial, UuidDictionary.COMPLEX_IMAGE_AD); for (String fileuuid : fileuuidList) { String filename = AppConstants.IMAGE_PATH + fileuuid + ".jpg"; if (new File(filename).exists()) { @@ -1959,23 +1848,6 @@ public void onResume() // register the receiver here } catch (Exception file) { Logger.logD(TAG, file.getMessage()); } - - -// if (!addDocDir.exists()) { -// addDocDir.mkdirs(); -// Log.v(TAG, "directory created " + addDocDir.getAbsolutePath()); -// } else { -// File[] files = addDocDir.listFiles(); -// addDocDir.listFiles(new FilenameFilter() { -// @Override -// public boolean accept(File dir, String name) { -// return false; -// } -// }) - //List fileList = Arrays.asList(files); - - -// } } @Override @@ -2111,10 +1983,9 @@ public void downloadPrescription() { VisitsDAO visitsDAO = new VisitsDAO(); try { if (visitsDAO.getDownloadedValue(visitUuid).equalsIgnoreCase("false") && uploaded) { - db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); String visitnote = ""; EncounterDAO encounterDAO = new EncounterDAO(); - String encounterIDSelection = "visituuid = ?"; + String encounterIDSelection = "visituuid = ? "; String[] encounterIDArgs = {visitUuid}; Cursor encounterCursor = db.query("tbl_encounter", null, encounterIDSelection, encounterIDArgs, null, null, null); if (encounterCursor != null && encounterCursor.moveToFirst()) { @@ -2128,10 +1999,40 @@ public void downloadPrescription() { if (encounterCursor != null) { encounterCursor.close(); } - db.close(); - db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); + if (!diagnosisReturned.isEmpty()) { + diagnosisReturned = ""; + diagnosisTextView.setText(""); + diagnosisCard.setVisibility(View.GONE); + } + if (!rxReturned.isEmpty()) { + rxReturned = ""; + prescriptionTextView.setText(""); + prescriptionCard.setVisibility(View.GONE); + + } + if (!adviceReturned.isEmpty()) { + adviceReturned = ""; + medicalAdviceTextView.setText(""); + medicalAdviceCard.setVisibility(View.GONE); + } + if (!testsReturned.isEmpty()) { + testsReturned = ""; + requestedTestsTextView.setText(""); + requestedTestsCard.setVisibility(View.GONE); + } + if (!additionalReturned.isEmpty()) { + additionalReturned = ""; + additionalCommentsTextView.setText(""); + additionalCommentsCard.setVisibility(View.GONE); + + } + if (!followUpDate.isEmpty()) { + followUpDate = ""; + followUpDateTextView.setText(""); + followUpDateCard.setVisibility(View.GONE); + } String[] columns = {"value", " conceptuuid"}; - String visitSelection = "encounteruuid = ? "; + String visitSelection = "encounteruuid = ? and voided!='1'"; String[] visitArgs = {visitnote}; Cursor visitCursor = db.query("tbl_obs", columns, visitSelection, visitArgs, null, null, null); if (visitCursor.moveToFirst()) { @@ -2142,7 +2043,6 @@ public void downloadPrescription() { } while (visitCursor.moveToNext()); } visitCursor.close(); - db.close(); if (uploaded) { try { @@ -2152,10 +2052,11 @@ public void downloadPrescription() { } } - } else { - downloaded = false; } + additionalDocumentImagesDownload(); + physcialExaminationImagesDownload(); + } catch (DAOException e) { e.printStackTrace(); } @@ -2163,7 +2064,6 @@ public void downloadPrescription() { } public void downloadPrescriptionDefault() { - db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); String visitnote = ""; EncounterDAO encounterDAO = new EncounterDAO(); String encounterIDSelection = "visituuid = ?"; @@ -2178,10 +2078,8 @@ public void downloadPrescriptionDefault() { } encounterCursor.close(); - db.close(); - db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); String[] columns = {"value", " conceptuuid"}; - String visitSelection = "encounteruuid = ? "; + String visitSelection = "encounteruuid = ? and voided!='1' "; String[] visitArgs = {visitnote}; Cursor visitCursor = db.query("tbl_obs", columns, visitSelection, visitArgs, null, null, null); if (visitCursor.moveToFirst()) { @@ -2192,7 +2090,6 @@ public void downloadPrescriptionDefault() { } while (visitCursor.moveToNext()); } visitCursor.close(); - db.close(); downloaded = true; } @@ -2226,7 +2123,10 @@ public void onReceive(Context context, Intent intent) { private void handleMessage(Intent msg) { Log.i(TAG, "handleMessage: Entered"); Bundle data = msg.getExtras(); - int check = data.getInt("Restart"); + int check = 0; + if (data != null) { + check = data.getInt("Restart"); + } if (check == 100) { Log.i(TAG, "handleMessage: 100"); diagnosisReturned = ""; @@ -2249,13 +2149,6 @@ private void handleMessage(Intent msg) { visitCursor.close(); } else if (check == 200) { Log.i(TAG, "handleMessage: 200"); - //meera - // addDownloadButton(); - -// <----- code to end the visit only after doctor sends anything -----> - - - //if(downloaded){ String[] columns = {"concept_id"}; String orderBy = "visit_id"; @@ -2295,20 +2188,8 @@ private void handleMessage(Intent msg) { //endVisit(); } -// <-----if obs not found restrict user to end the visit -----> else { Log.i(TAG, "found sothing for test"); - /* downloaded=false; - AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this); - alertDialogBuilder.setMessage(R.string.error_no_data); - alertDialogBuilder.setNeutralButton(R.string.generic_ok, new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialog, int which) { - dialog.dismiss(); - } - }); - AlertDialog alertDialog = alertDialogBuilder.create(); - alertDialog.show();*/ } @@ -2322,23 +2203,6 @@ private void addDownloadButton() { if (!downloadButton.isEnabled()) { downloadButton.setEnabled(true); downloadButton.setVisibility(View.VISIBLE); - /* - final float scale = getResources().getDisplayMetrics().density; - int pixels = (int) (11 * scale + 0.5f); - - downloadButton = new Button((new ContextThemeWrapper(context, R.style.RobotoButtonStyle))); - LinearLayoutCompat.LayoutParams layoutParams= new LinearLayoutCompat.LayoutParams( - LinearLayoutCompat.LayoutParams.MATCH_PARENT, LinearLayoutCompat.LayoutParams.WRAP_CONTENT); - layoutParams.setMargins(10,10,10,10); - downloadButton.setPadding(0,0,0,0); - downloadButton.setLayoutParams(layoutParams); - downloadButton.setAllCaps(false); - downloadButton.setTextSize(TypedValue.COMPLEX_UNIT_SP,20); - downloadButton.setBackgroundColor(getResources().getColor(R.color.divider)); - downloadButton.setText(R.string.visit_summary_button_download); - */ - - // Toast.makeText(this, getString(R.string.visit_summary_button_download), Toast.LENGTH_SHORT).show(); } @@ -2359,8 +2223,6 @@ private void isNetworkAvailable(Context context) { if (internetCheck != null) { internetCheck.setIcon(R.mipmap.ic_data_on); flag = 1; -// SyncUtils syncUtils = new SyncUtils(); -// syncUtils.syncBackground(); } } } @@ -2380,6 +2242,7 @@ private void isNetworkAvailable(Context context) { public class DownloadPrescriptionService extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { + Logger.logD(TAG, "Download prescription happen" + new SimpleDateFormat("yyyy MM dd_HH mm ss").format(Calendar.getInstance().getTime())); downloadPrescriptionDefault(); } } diff --git a/app/src/main/java/io/intelehealth/client/activities/vitalActivity/VitalsActivity.java b/app/src/main/java/io/intelehealth/client/activities/vitalActivity/VitalsActivity.java index 4401ec5d3d..b64b1f97f2 100644 --- a/app/src/main/java/io/intelehealth/client/activities/vitalActivity/VitalsActivity.java +++ b/app/src/main/java/io/intelehealth/client/activities/vitalActivity/VitalsActivity.java @@ -111,8 +111,7 @@ protected void onCreate(Bundle savedInstanceState) { try { JSONObject obj = null; // #633 #632 - if (!sessionManager.getLicenseKey().isEmpty()) { -// if (sessionManager.valueContains("licensekey")) { + if (sessionManager.valueContains("licensekey")) { obj = new JSONObject(FileUtils.readFileRoot(AppConstants.CONFIG_FILE_NAME, this)); //Load the config file } else { obj = new JSONObject(String.valueOf(FileUtils.encodeJSON(this, AppConstants.CONFIG_FILE_NAME))); @@ -437,9 +436,9 @@ public void calculateBMI() { } public void loadPrevious() { - SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); + SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWriteDb(); String[] columns = {"value", " conceptuuid"}; - String visitSelection = "encounteruuid = ? "; + String visitSelection = "encounteruuid = ? and voided!='1'"; String[] visitArgs = {encounterVitals}; Cursor visitCursor = db.query("tbl_obs", columns, visitSelection, visitArgs, null, null, null); if (visitCursor.moveToFirst()) { @@ -450,7 +449,6 @@ public void loadPrevious() { } while (visitCursor.moveToNext()); } visitCursor.close(); - db.close(); } private void parseData(String concept_id, String value) { @@ -692,104 +690,109 @@ public void validateTable() { // } + ObsDAO obsDAO=new ObsDAO(); ObsDTO obsDTO=new ObsDTO(); if (intentTag != null && intentTag.equals("edit")) { - obsDTO=new ObsDTO(); - obsDTO.setConceptuuid(UuidDictionary.HEIGHT); - obsDTO.setEncounteruuid(encounterVitals); - obsDTO.setCreator(1); - obsDTO.setValue(results.getHeight()); - obsDTO.setUuid(AppConstants.NEW_UUID); - - obsDAO.updateObs(obsDTO); - - obsDTO=new ObsDTO(); - obsDTO.setConceptuuid(UuidDictionary.WEIGHT); - obsDTO.setEncounteruuid(encounterVitals); - obsDTO.setCreator(1); - obsDTO.setValue(results.getWeight()); - obsDTO.setUuid(AppConstants.NEW_UUID); - - obsDAO.updateObs(obsDTO); - - obsDTO=new ObsDTO(); - obsDTO.setConceptuuid(UuidDictionary.PULSE); - obsDTO.setEncounteruuid(encounterVitals); - obsDTO.setCreator(1); - obsDTO.setValue(results.getPulse()); - obsDTO.setUuid(AppConstants.NEW_UUID); - - obsDAO.updateObs(obsDTO); - - obsDTO=new ObsDTO(); - obsDTO.setConceptuuid(UuidDictionary.SYSTOLIC_BP); - obsDTO.setEncounteruuid(encounterVitals); - obsDTO.setCreator(1); - obsDTO.setValue(results.getBpsys()); - obsDTO.setUuid(AppConstants.NEW_UUID); - - obsDAO.updateObs(obsDTO); - - obsDTO=new ObsDTO(); - obsDTO.setConceptuuid(UuidDictionary.DIASTOLIC_BP); - obsDTO.setEncounteruuid(encounterVitals); - obsDTO.setCreator(1); - obsDTO.setValue(results.getBpdia()); - obsDTO.setUuid(AppConstants.NEW_UUID); - - obsDAO.updateObs(obsDTO); - - obsDTO=new ObsDTO(); - obsDTO.setConceptuuid(UuidDictionary.TEMPERATURE); - obsDTO.setEncounteruuid(encounterVitals); - obsDTO.setCreator(1); - obsDTO.setValue(results.getTemperature()); - obsDTO.setUuid(AppConstants.NEW_UUID); - - obsDAO.updateObs(obsDTO); - - obsDTO=new ObsDTO(); - obsDTO.setConceptuuid(UuidDictionary.RESPIRATORY); - obsDTO.setEncounteruuid(encounterVitals); - obsDTO.setCreator(1); - obsDTO.setValue(results.getResp()); - obsDTO.setUuid(AppConstants.NEW_UUID); - - obsDAO.updateObs(obsDTO); - - obsDTO=new ObsDTO(); - obsDTO.setConceptuuid(UuidDictionary.SPO2); - obsDTO.setEncounteruuid(encounterVitals); - obsDTO.setCreator(1); - obsDTO.setValue(results.getSpo2()); - obsDTO.setUuid(AppConstants.NEW_UUID); - - obsDAO.updateObs(obsDTO); - //making flag to false in the encounter table so it will sync again - EncounterDAO encounterDAO = new EncounterDAO(); try { - encounterDAO.updateEncounterSync("false", encounterVitals); - } catch (DAOException e) { - Crashlytics.getInstance().core.logException(e); - } + obsDTO = new ObsDTO(); + obsDTO.setConceptuuid(UuidDictionary.HEIGHT); + obsDTO.setEncounteruuid(encounterVitals); + obsDTO.setCreator(sessionManager.getCreatorID()); + obsDTO.setValue(results.getHeight()); + obsDTO.setUuid(obsDAO.getObsuuid(encounterVitals, UuidDictionary.HEIGHT)); + + obsDAO.updateObs(obsDTO); + + obsDTO = new ObsDTO(); + obsDTO.setConceptuuid(UuidDictionary.WEIGHT); + obsDTO.setEncounteruuid(encounterVitals); + obsDTO.setCreator(sessionManager.getCreatorID()); + obsDTO.setValue(results.getWeight()); + obsDTO.setUuid(obsDAO.getObsuuid(encounterVitals, UuidDictionary.WEIGHT)); + + obsDAO.updateObs(obsDTO); + + obsDTO = new ObsDTO(); + obsDTO.setConceptuuid(UuidDictionary.PULSE); + obsDTO.setEncounteruuid(encounterVitals); + obsDTO.setCreator(sessionManager.getCreatorID()); + obsDTO.setValue(results.getPulse()); + obsDTO.setUuid(obsDAO.getObsuuid(encounterVitals, UuidDictionary.PULSE)); + + obsDAO.updateObs(obsDTO); + + obsDTO = new ObsDTO(); + obsDTO.setConceptuuid(UuidDictionary.SYSTOLIC_BP); + obsDTO.setEncounteruuid(encounterVitals); + obsDTO.setCreator(sessionManager.getCreatorID()); + obsDTO.setValue(results.getBpsys()); + obsDTO.setUuid(obsDAO.getObsuuid(encounterVitals, UuidDictionary.SYSTOLIC_BP)); + + obsDAO.updateObs(obsDTO); + + obsDTO = new ObsDTO(); + obsDTO.setConceptuuid(UuidDictionary.DIASTOLIC_BP); + obsDTO.setEncounteruuid(encounterVitals); + obsDTO.setCreator(sessionManager.getCreatorID()); + obsDTO.setValue(results.getBpdia()); + obsDTO.setUuid(obsDAO.getObsuuid(encounterVitals, UuidDictionary.DIASTOLIC_BP)); + + obsDAO.updateObs(obsDTO); + + obsDTO = new ObsDTO(); + obsDTO.setConceptuuid(UuidDictionary.TEMPERATURE); + obsDTO.setEncounteruuid(encounterVitals); + obsDTO.setCreator(sessionManager.getCreatorID()); + obsDTO.setValue(results.getTemperature()); + obsDTO.setUuid(obsDAO.getObsuuid(encounterVitals, UuidDictionary.TEMPERATURE)); + + obsDAO.updateObs(obsDTO); + + obsDTO = new ObsDTO(); + obsDTO.setConceptuuid(UuidDictionary.RESPIRATORY); + obsDTO.setEncounteruuid(encounterVitals); + obsDTO.setCreator(sessionManager.getCreatorID()); + obsDTO.setValue(results.getResp()); + obsDTO.setUuid(obsDAO.getObsuuid(encounterVitals, UuidDictionary.RESPIRATORY)); + + obsDAO.updateObs(obsDTO); + + obsDTO = new ObsDTO(); + obsDTO.setConceptuuid(UuidDictionary.SPO2); + obsDTO.setEncounteruuid(encounterVitals); + obsDTO.setCreator(sessionManager.getCreatorID()); + obsDTO.setValue(results.getSpo2()); + obsDTO.setUuid(obsDAO.getObsuuid(encounterVitals, UuidDictionary.SPO2)); + + obsDAO.updateObs(obsDTO); + //making flag to false in the encounter table so it will sync again + EncounterDAO encounterDAO = new EncounterDAO(); + try { + encounterDAO.updateEncounterSync("false", encounterVitals); + encounterDAO.updateEncounterModifiedDate(encounterVitals); + } catch (DAOException e) { + Crashlytics.getInstance().core.logException(e); + } - Intent intent = new Intent(VitalsActivity.this, VisitSummaryActivity.class); - intent.putExtra("patientUuid", patientUuid); - intent.putExtra("visitUuid", visitUuid); - intent.putExtra("encounterUuidVitals", encounterVitals); - intent.putExtra("encounterUuidAdultIntial", encounterAdultIntials); - intent.putExtra("state", state); - intent.putExtra("name", patientName); - intent.putExtra("hasPrescription", "false"); - intent.putExtra("tag", intentTag); - startActivity(intent); + Intent intent = new Intent(VitalsActivity.this, VisitSummaryActivity.class); + intent.putExtra("patientUuid", patientUuid); + intent.putExtra("visitUuid", visitUuid); + intent.putExtra("encounterUuidVitals", encounterVitals); + intent.putExtra("encounterUuidAdultIntial", encounterAdultIntials); + intent.putExtra("state", state); + intent.putExtra("name", patientName); + intent.putExtra("tag", intentTag); + startActivity(intent); + } catch (DAOException dao) { + Crashlytics.getInstance().core.logException(dao); + } } else { obsDTO=new ObsDTO(); obsDTO.setConceptuuid(UuidDictionary.HEIGHT); obsDTO.setEncounteruuid(encounterVitals); - obsDTO.setCreator(1); + obsDTO.setCreator(sessionManager.getCreatorID()); obsDTO.setValue(results.getHeight()); obsDTO.setUuid(AppConstants.NEW_UUID); @@ -802,7 +805,7 @@ public void validateTable() { obsDTO=new ObsDTO(); obsDTO.setConceptuuid(UuidDictionary.WEIGHT); obsDTO.setEncounteruuid(encounterVitals); - obsDTO.setCreator(1); + obsDTO.setCreator(sessionManager.getCreatorID()); obsDTO.setValue(results.getWeight()); try { @@ -814,7 +817,7 @@ public void validateTable() { obsDTO=new ObsDTO(); obsDTO.setConceptuuid(UuidDictionary.PULSE); obsDTO.setEncounteruuid(encounterVitals); - obsDTO.setCreator(1); + obsDTO.setCreator(sessionManager.getCreatorID()); obsDTO.setValue(results.getPulse()); try { @@ -826,7 +829,7 @@ public void validateTable() { obsDTO=new ObsDTO(); obsDTO.setConceptuuid(UuidDictionary.SYSTOLIC_BP); obsDTO.setEncounteruuid(encounterVitals); - obsDTO.setCreator(1); + obsDTO.setCreator(sessionManager.getCreatorID()); obsDTO.setValue(results.getBpsys()); try { @@ -838,7 +841,7 @@ public void validateTable() { obsDTO=new ObsDTO(); obsDTO.setConceptuuid(UuidDictionary.DIASTOLIC_BP); obsDTO.setEncounteruuid(encounterVitals); - obsDTO.setCreator(1); + obsDTO.setCreator(sessionManager.getCreatorID()); obsDTO.setValue(results.getBpdia()); try { @@ -850,7 +853,7 @@ public void validateTable() { obsDTO=new ObsDTO(); obsDTO.setConceptuuid(UuidDictionary.TEMPERATURE); obsDTO.setEncounteruuid(encounterVitals); - obsDTO.setCreator(1); + obsDTO.setCreator(sessionManager.getCreatorID()); obsDTO.setValue(results.getTemperature()); try { @@ -862,7 +865,7 @@ public void validateTable() { obsDTO=new ObsDTO(); obsDTO.setConceptuuid(UuidDictionary.RESPIRATORY); obsDTO.setEncounteruuid(encounterVitals); - obsDTO.setCreator(1); + obsDTO.setCreator(sessionManager.getCreatorID()); obsDTO.setValue(results.getResp()); try { @@ -874,7 +877,7 @@ public void validateTable() { obsDTO=new ObsDTO(); obsDTO.setConceptuuid(UuidDictionary.SPO2); obsDTO.setEncounteruuid(encounterVitals); - obsDTO.setCreator(1); + obsDTO.setCreator(sessionManager.getCreatorID()); obsDTO.setValue(results.getSpo2()); try { @@ -891,7 +894,6 @@ public void validateTable() { intent.putExtra("state", state); intent.putExtra("name", patientName); intent.putExtra("tag", intentTag); - // intent.putStringArrayListExtra("exams", physicalExams); startActivity(intent); } } diff --git a/app/src/main/java/io/intelehealth/client/app/AppConstants.java b/app/src/main/java/io/intelehealth/client/app/AppConstants.java index f579ffd3ea..9c60c2b137 100644 --- a/app/src/main/java/io/intelehealth/client/app/AppConstants.java +++ b/app/src/main/java/io/intelehealth/client/app/AppConstants.java @@ -1,14 +1,12 @@ package io.intelehealth.client.app; -import android.database.sqlite.SQLiteDatabase; import android.os.Environment; import androidx.work.Constraints; import androidx.work.NetworkType; import androidx.work.PeriodicWorkRequest; -//import com.snatik.storage.Storage; import java.io.File; import java.util.concurrent.TimeUnit; @@ -19,7 +17,6 @@ import io.intelehealth.client.syncModule.SyncWorkManager; import io.intelehealth.client.utilities.DateAndTimeUtils; import io.intelehealth.client.utilities.NotificationUtils; -import io.intelehealth.client.utilities.SqliteDbCloseHelper; import io.intelehealth.client.utilities.UuidGenerator; public class AppConstants { @@ -28,12 +25,10 @@ public class AppConstants { public static final int DATABASE_VERSION = 4; public static final String JSON_FOLDER = "Engines"; public static final String JSON_FOLDER_Update = "Engines_Update"; - public static final String MIND_MAP_SERVER_URL = "http://mindmaps.intelehealth.io/"; public static final String IMAGE_APP_ID = "app2"; public static final String dbfilepath = Environment.getExternalStorageDirectory() + File.separator + "InteleHealth_DB" + File.separator + "Intelehealth.db"; // directory: Intelehealth_DB , filename: Intelehealth.db public static String CONFIG_FILE_NAME = "config.json"; public static final String IMAGE_PATH = IntelehealthApplication.getAppContext().getExternalFilesDir(Environment.DIRECTORY_PICTURES) + File.separator; - public static final String PATIENT_IMAGE_PATH = IntelehealthApplication.getAppContext().getExternalFilesDir(Environment.DIRECTORY_PICTURES) + File.separator + "Patient_Images/"; public static final String MESSAGE_PROGRESS = "message_progress"; @@ -57,24 +52,17 @@ public class AppConstants { public static final String MINIMUM_RESPIRATORY = "10"; //functions constants -// public static Storage storage = new Storage(IntelehealthApplication.getAppContext()); public static InteleHealthDatabaseHelper inteleHealthDatabaseHelper = new InteleHealthDatabaseHelper(IntelehealthApplication.getAppContext()); public static final String UNIQUE_WORK_NAME = "intelehealth_workmanager"; public static ApiInterface apiInterface = ApiClient.createService(ApiInterface.class); - public static SqliteDbCloseHelper sqliteDbCloseHelper = new SqliteDbCloseHelper(); public static DateAndTimeUtils dateAndTimeUtils = new DateAndTimeUtils(); public static String NEW_UUID = new UuidGenerator().UuidGenerator(); - public static SQLiteDatabase sqLiteDatabase = inteleHealthDatabaseHelper.getWritableDatabase(); public static NotificationUtils notificationUtils = new NotificationUtils(); // Image Conversion Ratio public static int IMAGE_JPG_QUALITY = 70; - // syncBackground Timings - - public static int SYNC = 1000 * 60 * 3; - public static int MAXIMUM_DELAY = 1000 * 60 * 3; public static int REPEAT_INTERVAL = 15; public static Constraints MY_CONSTRAINTS = new Constraints.Builder() diff --git a/app/src/main/java/io/intelehealth/client/app/IntelehealthApplication.java b/app/src/main/java/io/intelehealth/client/app/IntelehealthApplication.java old mode 100644 new mode 100755 index d15e59944e..23609fec53 --- a/app/src/main/java/io/intelehealth/client/app/IntelehealthApplication.java +++ b/app/src/main/java/io/intelehealth/client/app/IntelehealthApplication.java @@ -40,14 +40,6 @@ public static String getAndroidId() { return androidId; } -// LocalRecordsDatabaseHelper mDbHelper = new LocalRecordsDatabaseHelper(this); -// SQLiteDatabase localdb = mDbHelper.getWritableDatabase(); -// -// localdb.execSQL("UPDATE "+DelayedJobQueueProvider.DELAYED_JOBS_TABLE_NAME +" SET "+ DelayedJobQueueProvider.SYNC_STATUS+"=0"); - - -// registerActivityLifecycleCallbacks(this); -// } @Override protected void attachBaseContext(Context base) { diff --git a/app/src/main/java/io/intelehealth/client/dataMigration/SmoothUpgrade.java b/app/src/main/java/io/intelehealth/client/dataMigration/SmoothUpgrade.java old mode 100644 new mode 100755 index 22e7e18acf..e61d354a77 --- a/app/src/main/java/io/intelehealth/client/dataMigration/SmoothUpgrade.java +++ b/app/src/main/java/io/intelehealth/client/dataMigration/SmoothUpgrade.java @@ -14,7 +14,6 @@ import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; -import java.io.IOException; import java.nio.channels.FileChannel; import java.util.ArrayList; import java.util.HashMap; @@ -22,7 +21,6 @@ import java.util.Map; import java.util.UUID; -import io.intelehealth.client.BuildConfig; import io.intelehealth.client.database.dao.EncounterDAO; import io.intelehealth.client.database.dao.ObsDAO; import io.intelehealth.client.database.dao.PatientsDAO; @@ -36,17 +34,14 @@ import io.intelehealth.client.utilities.SessionManager; import io.intelehealth.client.utilities.StringUtils; import io.intelehealth.client.utilities.UuidDictionary; -import io.intelehealth.client.utilities.backup.Backup; import io.intelehealth.client.utilities.exception.DAOException; -import static io.intelehealth.client.app.AppConstants.APP_VERSION_CODE; import static io.intelehealth.client.app.AppConstants.dbfilepath; public class SmoothUpgrade { public SQLiteDatabase myDataBase; SessionManager sessionManager = null; Context context; - Backup backup = new Backup(); boolean dbexist = checkdatabase(); String TAG = SmoothUpgrade.class.getSimpleName(); @@ -55,19 +50,7 @@ public SmoothUpgrade(Context context) { sessionManager = new SessionManager(context); } - public void copyDatabase() { - int versionCode = BuildConfig.VERSION_CODE; - if (versionCode <= APP_VERSION_CODE) { - try { - backup.createFileInMemory(context, true); - } catch (IOException e) { - Crashlytics.getInstance().core.logException(e); - - } - } - - } public void exportDB() { @@ -125,6 +108,8 @@ private static Object getKeyFromValue(Map hm, Object value) { return ""; } +// added the static location details,provider,creator id in the database + public void insertOfflineOldData() { myDataBase.beginTransaction(); PatientDTO patientDTO = new PatientDTO(); @@ -178,42 +163,42 @@ public void insertOfflineOldData() { patientAttributesDTO = new PatientAttributesDTO(); patientAttributesDTO.setUuid(UUID.randomUUID().toString()); patientAttributesDTO.setPatientuuid(uuid); - patientAttributesDTO.setPersonAttributeTypeUuid(patientsDAO.getUuidForAttribute("caste")); + patientAttributesDTO.setPersonAttributeTypeUuid("5a889d96-0c84-4a04-88dc-59a6e37db2d3"); patientAttributesDTO.setValue(StringUtils.getValue(cursor.getString(cursor.getColumnIndexOrThrow("caste")))); patientAttributesDTOList.add(patientAttributesDTO); patientAttributesDTO = new PatientAttributesDTO(); patientAttributesDTO.setUuid(UUID.randomUUID().toString()); patientAttributesDTO.setPatientuuid(uuid); - patientAttributesDTO.setPersonAttributeTypeUuid(patientsDAO.getUuidForAttribute("Telephone Number")); + patientAttributesDTO.setPersonAttributeTypeUuid("14d4f066-15f5-102d-96e4-000c29c2a5d7"); patientAttributesDTO.setValue(StringUtils.getValue(cursor.getString(cursor.getColumnIndexOrThrow("phone_number")))); patientAttributesDTOList.add(patientAttributesDTO); patientAttributesDTO = new PatientAttributesDTO(); patientAttributesDTO.setUuid(UUID.randomUUID().toString()); patientAttributesDTO.setPatientuuid(uuid); - patientAttributesDTO.setPersonAttributeTypeUuid(patientsDAO.getUuidForAttribute("Son/wife/daughter")); + patientAttributesDTO.setPersonAttributeTypeUuid("1b2f34f7-2bf8-4ef7-9736-f5b858afc160"); patientAttributesDTO.setValue(StringUtils.getValue(cursor.getString(cursor.getColumnIndexOrThrow("sdw")))); patientAttributesDTOList.add(patientAttributesDTO); patientAttributesDTO = new PatientAttributesDTO(); patientAttributesDTO.setUuid(UUID.randomUUID().toString()); patientAttributesDTO.setPatientuuid(uuid); - patientAttributesDTO.setPersonAttributeTypeUuid(patientsDAO.getUuidForAttribute("occupation")); + patientAttributesDTO.setPersonAttributeTypeUuid("ecdaadb6-14a0-4ed9-b5b7-cfed87b44b87"); patientAttributesDTO.setValue(StringUtils.getValue(cursor.getString(cursor.getColumnIndexOrThrow("occupation")))); patientAttributesDTOList.add(patientAttributesDTO); patientAttributesDTO = new PatientAttributesDTO(); patientAttributesDTO.setUuid(UUID.randomUUID().toString()); patientAttributesDTO.setPatientuuid(uuid); - patientAttributesDTO.setPersonAttributeTypeUuid(patientsDAO.getUuidForAttribute("Economic Status")); + patientAttributesDTO.setPersonAttributeTypeUuid("f4af0ef3-579c-448a-8157-750283409122"); patientAttributesDTO.setValue(StringUtils.getValue(cursor.getString(cursor.getColumnIndexOrThrow("economic_status")))); patientAttributesDTOList.add(patientAttributesDTO); patientAttributesDTO = new PatientAttributesDTO(); patientAttributesDTO.setUuid(UUID.randomUUID().toString()); patientAttributesDTO.setPatientuuid(uuid); - patientAttributesDTO.setPersonAttributeTypeUuid(patientsDAO.getUuidForAttribute("Education Level")); + patientAttributesDTO.setPersonAttributeTypeUuid("1c718819-345c-4368-aad6-d69b4c267db7"); patientAttributesDTO.setValue(StringUtils.getValue(cursor.getString(cursor.getColumnIndexOrThrow("education_status")))); patientAttributesDTOList.add(patientAttributesDTO); Logger.logD(TAG, "PatientAttribute list" + patientAttributesDTOList.size()); @@ -251,8 +236,8 @@ private VisitDTO getPatientId(String id) { visitDTO.setStartdate(cursor.getString(cursor.getColumnIndexOrThrow("start_datetime"))); visitDTO.setEnddate(cursor.getString(cursor.getColumnIndexOrThrow("end_datetime"))); visitDTO.setVisitTypeUuid(UuidDictionary.VISIT_TELEMEDICINE); - visitDTO.setLocationuuid(sessionManager.getLocationUuid()); - visitDTO.setCreatoruuid(sessionManager.getCreatorID()); + visitDTO.setLocationuuid("b56d5d16-bf89-4ac0-918d-e830fbfba290"); + visitDTO.setCreatoruuid("8af2f1eb-d7d1-452e-b211-9610947ee80d"); cursor.moveToNext(); } @@ -281,7 +266,7 @@ private EncounterDTO getVisitId(String id, String visituuid, String time) { encounterDTO.setVisituuid(visituuid); encounterDTO.setEncounterTypeUuid(encounterDAO.getEncounterTypeUuid(cursor.getString(cursor.getColumnIndexOrThrow("encounter_type")))); encounterDTO.setEncounterTime(time); - encounterDTO.setProvideruuid(sessionManager.getProviderID()); + encounterDTO.setProvideruuid("28cea4ab-3188-434a-82f0-055133090a38"); encounterDTO.setVoided(0); encounterDTO.setSyncd(false); @@ -316,7 +301,7 @@ private ObsDTO getEncounterId(String id, String encounterUuid) { ObsDTO.setConceptuuid(convertConcepttoUuid(cursor.getString(cursor.getColumnIndexOrThrow("concept_id")))); ObsDTO.setValue(cursor.getString(cursor.getColumnIndexOrThrow("value"))); ObsDTO.setEncounteruuid(encounterUuid); - ObsDTO.setCreator(4); + ObsDTO.setCreator("8af2f1eb-d7d1-452e-b211-9610947ee80d"); try { obsDAO.insertObs(ObsDTO); @@ -380,7 +365,7 @@ public EncounterDTO insertMissingEncounter(String uuid, String encounterType, St encounterDTO.setEncounterTypeUuid(getEncounterTypebasedonConcept(encounterType)); encounterDTO.setEncounterTime(time); encounterDTO.setSyncd(false); - encounterDTO.setProvideruuid(sessionManager.getProviderID()); + encounterDTO.setProvideruuid("28cea4ab-3188-434a-82f0-055133090a38"); encounterDTO.setVoided(0); try { encounterDAO.createEncountersToDB(encounterDTO); @@ -407,9 +392,6 @@ private String getEncounterTypebasedonConcept(String encountertype) { arr.add("5092AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"); - ArrayList arr1 = new ArrayList(); - - if (arr.contains(encountertype)) { encounter = "67a71486-1a54-468f-ac3e-7091a9a79584"; } else { @@ -441,6 +423,14 @@ private boolean checkdatabase() { public void opendatabase() throws SQLException { //Open the database String mypath = dbfilepath; - myDataBase = SQLiteDatabase.openDatabase(mypath, null, SQLiteDatabase.OPEN_READWRITE); + if (myDataBase != null && myDataBase.isOpen()) + return; + if (new File(dbfilepath).exists()) + myDataBase = SQLiteDatabase.openDatabase(mypath, null, SQLiteDatabase.OPEN_READWRITE); + else { + mypath = Environment.getExternalStoragePublicDirectory("InteleHealth_DB") + "Intelehealth.db"; + if (new File(mypath).exists()) + myDataBase = SQLiteDatabase.openDatabase(mypath, null, SQLiteDatabase.OPEN_READWRITE); + } } -} +} \ No newline at end of file diff --git a/app/src/main/java/io/intelehealth/client/database/InteleHealthDatabaseHelper.java b/app/src/main/java/io/intelehealth/client/database/InteleHealthDatabaseHelper.java old mode 100644 new mode 100755 index e625c6163a..b7f9db96da --- a/app/src/main/java/io/intelehealth/client/database/InteleHealthDatabaseHelper.java +++ b/app/src/main/java/io/intelehealth/client/database/InteleHealthDatabaseHelper.java @@ -13,12 +13,8 @@ public class InteleHealthDatabaseHelper extends SQLiteOpenHelper { // If you change the database schema, you must increment the database version. public static final int DATABASE_VERSION = AppConstants.DATABASE_VERSION; public static final String DATABASE_NAME = AppConstants.DATABASE_NAME; - /*"openmrs_obsuuid": "5e3e7c8d-e3c3-4a1d-a391-d3d04e45df0e", - "openmrs_encounteruuid": "99835c05-8c5c-4d17-b96d-095fb12ebc53", - "conceptid": 5090, - "value": "54", - "creator": 4 - * */ + public static SQLiteDatabase database; + public static final String CREATE_ENCOUNTER_MAIN = "CREATE TABLE IF NOT EXISTS tbl_encounter (" + "uuid TEXT PRIMARY KEY," + "visituuid TEXT," + @@ -30,20 +26,7 @@ public class InteleHealthDatabaseHelper extends SQLiteOpenHelper { "voided TEXT DEFAULT '0'," + "privacynotice_value TEXT" + ")"; - /* - * "openmrs_uuid": "8ab7f041-0b02-4ac0-a8f4-aa35f90ae3a1", - "openmrs_id": "10213-7", - "firstname": "John", - "middlename": "Mira", - "lastname": "Bora", - "dateofbirth": "Oct 27, 2018 12:00:00 AM", - "address1": "Everlasting Village", - "country": "Philippines", - "gender": "M" - * - * char(36) default (lower(hex(randomblob(4))) || '-' || lower(hex(randomblob(2))) || '-4' || substr(lower(hex(randomblob(2))),2) || '-' || substr('89ab',abs(random()) % 4 + 1, 1) || substr(lower(hex(randomblob(2))),2) || '-' || lower(hex(randomblob(6)))) - * - * */ + public static final String CREATE_PATIENT_MAIN = "CREATE TABLE IF NOT EXISTS tbl_patient(" + "uuid TEXT PRIMARY KEY," + "openmrs_id TEXT," + @@ -70,11 +53,7 @@ public class InteleHealthDatabaseHelper extends SQLiteOpenHelper { "voided TEXT DEFAULT '0'," + "sync TEXT DEFAULT 'false' " + ")"; - /* "openmrs_uuid": "834054d5-db4d-481c-8f2b-17da25aa93a2", - "value": "123456789", - "openmrs_person_attribute_type_uuid": "14d4f066-15f5-102d-96e4-000c29c2a5d7", - "openmrs_patientuuid": "8ab7f041-0b02-4ac0-a8f4-aa35f90ae3a1" - * */ + public static final String CREATE_ATTRIB_MAIN = "CREATE TABLE IF NOT EXISTS tbl_patient_attribute (" + "uuid TEXT PRIMARY KEY," + "value TEXT," + @@ -95,17 +74,11 @@ public class InteleHealthDatabaseHelper extends SQLiteOpenHelper { "modified_date TEXT," + "isdownloaded TEXT DEFAULT 'false'," + "voided TEXT DEFAULT '0'," + - "sync TEXT DEFAULT 'false' " + + "sync TEXT DEFAULT 'false' ," + + "issubmitted Integer DEFAULT 0 " + ")"; - /* - "openmrs_patientuuid": "8ab7f041-0b02-4ac0-a8f4-aa35f90ae3a1", - "openmrs_visituuid": "8f80610c-2a8f-487e-8ee9-0c2c7ced4d89", - "visit_type_id": 4, - "startdate": "Nov 13, 2018 1:03:55 PM", - "enddate": "Nov 14, 2018 6:37:24 AM", - "locationuuid": "1eaa9a54-0fcb-4d5c-9ec7-501d2e5bcf2a", - "creator": 4*/ + public static final String CREATE_OBS_MAIN = "CREATE TABLE IF NOT EXISTS tbl_obs (" + "uuid TEXT PRIMARY KEY ," + "encounteruuid TEXT," + @@ -113,14 +86,13 @@ public class InteleHealthDatabaseHelper extends SQLiteOpenHelper { "value TEXT," + "creator TEXT," + "voided TEXT DEFAULT '0'," + + "obsservermodifieddate TEXT," + "modified_date TEXT," + + "created_date TEXT DEFAULT CURRENT_TIMESTAMP ," + "sync TEXT DEFAULT 'false' " + ")"; SessionManager sessionManager = null; - /*"openmrs_encounteruuid": "99835c05-8c5c-4d17-b96d-095fb12ebc53", - "openmrs_visituuid": "8f80610c-2a8f-487e-8ee9-0c2c7ced4d89", - "encounter_type": "6" - * */ + public static final String CREATE_PATIENT_ATTRIBUTE_MASTER_MAIN = "CREATE TABLE IF NOT EXISTS tbl_patient_attribute_master (" + "uuid TEXT PRIMARY KEY," + "name TEXT," + @@ -129,24 +101,6 @@ public class InteleHealthDatabaseHelper extends SQLiteOpenHelper { "sync TEXT DEFAULT 'false' " + ")"; - public static final String CREATE_VISIT_ATTRIBUTE_MASTER_MAIN = "CREATE TABLE IF NOT EXISTS tbl_visit_attribute_master (" + - "uuid TEXT PRIMARY KEY," + - "name TEXT," + - "retired TEXT," + - "modified_date TEXT" + - ")"; - - public static final String CREATE_VISIT_ATTRIB = "CREATE TABLE IF NOT EXISTS tbl_visit_attribute (" + - "uuid TEXT PRIMARY KEY," + - "value TEXT," + - "visit_attribute_type_uuid TEXT ," + - "visituuid TEXT," + - "modified_date TEXT," + - "sync TEXT" + - ")"; - /* "openmrs_uuid": "8d871386-c2cc-11de-8d13-0010c6dffd0f", - "name": "Race" - * */ public static final String CREATE_LOCATION = "CREATE TABLE IF NOT EXISTS tbl_location (" + "name TEXT," + "locationuuid TEXT PRIMARY KEY," + @@ -165,12 +119,6 @@ public class InteleHealthDatabaseHelper extends SQLiteOpenHelper { "sync TEXT DEFAULT 'false' " + ")"; - public static final String CREATE_SYNC = "CREATE TABLE IF NOT EXISTS tbl_sync (" + - "locationuuid TEXT PRIMARY KEY," + - "last_pull_execution_time TEXT," + - "sync TEXT DEFAULT 'false' ," + - "devices_sync TEXT" + - ")"; public static final String CREATE_UUID_DICTIONARY = "CREATE TABLE IF NOT EXISTS tbl_uuid_dictionary (" + "uuid TEXT PRIMARY KEY," + @@ -196,7 +144,6 @@ public InteleHealthDatabaseHelper(@Nullable Context context) { public void uuidInsert(SQLiteDatabase db) { sessionManager = new SessionManager(IntelehealthApplication.getAppContext()); if (sessionManager.isFirstTimeLaunched()) { -// db.execSQL("Drop Table tbl_uuid_dictionary"); db.execSQL("INSERT OR REPLACE INTO tbl_uuid_dictionary (uuid,name) VALUES('3edb0e09-9135-481e-b8f0-07a26fa9a5ce','CURRENTCOMPLAINT')"); db.execSQL("INSERT OR REPLACE INTO tbl_uuid_dictionary (uuid,name) VALUES('e1761e85-9b50-48ae-8c4d-e6b7eeeba084','PHYSICAL_EXAMINATION')"); db.execSQL("INSERT OR REPLACE INTO tbl_uuid_dictionary (uuid,name) VALUES('5090AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA','HEIGHT')"); @@ -232,26 +179,6 @@ public void uuidInsert(SQLiteDatabase db) { db.execSQL("INSERT OR REPLACE INTO tbl_uuid_dictionary (uuid,name) VALUES('a86ac96e-2e07-47a7-8e72-8216a1a75bfd','VISIT_TELEMEDICINE')"); db.execSQL("INSERT OR REPLACE INTO tbl_uuid_dictionary (uuid,name) VALUES('78284507-fb71-4354-9b34-046ab205e18f','RATING')"); db.execSQL("INSERT OR REPLACE INTO tbl_uuid_dictionary (uuid,name) VALUES('36d207d6-bee7-4b3e-9196-7d053c6eddce','COMMENTS')"); -// patient attributes master -// db.execSQL("INSERT OR REPLACE INTO tbl_patient_attribute_master (uuid,name) VALUES('0f63da10-882f-4352-9507-8c2e295c4bf7','Commune')"); -// db.execSQL("INSERT OR REPLACE INTO tbl_patient_attribute_master (uuid,name) VALUES('14d4f066-15f5-102d-96e4-000c29c2a5d7','Telephone Number')"); -// db.execSQL("INSERT OR REPLACE INTO tbl_patient_attribute_master (uuid,name) VALUES('1b2f34f7-2bf8-4ef7-9736-f5b858afc160','Son/wife/daughter')"); -// db.execSQL("INSERT OR REPLACE INTO tbl_patient_attribute_master (uuid,name) VALUES('1c718819-345c-4368-aad6-d69b4c267db7','Education Level')"); -// db.execSQL("INSERT OR REPLACE INTO tbl_patient_attribute_master (uuid,name) VALUES('1d609ff3-6f45-44d3-a0b6-601976571979','Department')"); -// db.execSQL("INSERT OR REPLACE INTO tbl_patient_attribute_master (uuid,name) VALUES('4f07985c-88a5-4abd-aa0c-f3ec8324d8e7','Test Patient')"); -// db.execSQL("INSERT OR REPLACE INTO tbl_patient_attribute_master (uuid,name) VALUES('5a889d96-0c84-4a04-88dc-59a6e37db2d3','Caste')"); -// db.execSQL("INSERT OR REPLACE INTO tbl_patient_attribute_master (uuid,name) VALUES('8d8718c2-c2cc-11de-8d13-0010c6dffd0f','Birthplace')"); -// db.execSQL("INSERT OR REPLACE INTO tbl_patient_attribute_master (uuid,name) VALUES('8d871afc-c2cc-11de-8d13-0010c6dffd0f','Citizenship')"); -// db.execSQL("INSERT OR REPLACE INTO tbl_patient_attribute_master (uuid,name) VALUES('8d871d18-c2cc-11de-8d13-0010c6dffd0f','Mothers Name')"); -// db.execSQL("INSERT OR REPLACE INTO tbl_patient_attribute_master (uuid,name) VALUES('8d871f2a-c2cc-11de-8d13-0010c6dffd0f','Civil Status')"); -// db.execSQL("INSERT OR REPLACE INTO tbl_patient_attribute_master (uuid,name) VALUES('8d871d18-c2cc-11de-8d13-0010c6dffd0f','Health District')"); -// db.execSQL("INSERT OR REPLACE INTO tbl_patient_attribute_master (uuid,name) VALUES('8d871d18-c2cc-11de-8d13-0010c6dffd0f','Health Center')"); -// db.execSQL("INSERT OR REPLACE INTO tbl_patient_attribute_master (uuid,name) VALUES('99d5b4ef-db5a-4ae4-a5e2-2bf1ea0a251e','Cell Number')"); -// db.execSQL("INSERT OR REPLACE INTO tbl_patient_attribute_master (uuid,name) VALUES('cf17630b-b966-47e9-974b-8098ee87f773','Prison Name')"); -// db.execSQL("INSERT OR REPLACE INTO tbl_patient_attribute_master (uuid,name) VALUES('ecdaadb6-14a0-4ed9-b5b7-cfed87b44b87','occupation')"); -// db.execSQL("INSERT OR REPLACE INTO tbl_patient_attribute_master (uuid,name) VALUES('f4af0ef3-579c-448a-8157-750283409122','Economic Status')"); - - } @@ -265,14 +192,12 @@ public void onCreate(SQLiteDatabase db) { db.execSQL(CREATE_IMAGE_RECORDS); db.execSQL(CREATE_OBS_MAIN); db.execSQL(CREATE_VISIT_MAIN); -// db.execSQL(CREATE_VISIT_ATTRIBUTE_MASTER_MAIN); -// db.execSQL(CREATE_VISIT_ATTRIB); db.execSQL(CREATE_PATIENT_ATTRIBUTE_MASTER_MAIN); db.execSQL(CREATE_LOCATION); db.execSQL(CREATE_PROVIDER); - db.execSQL(CREATE_SYNC); db.execSQL(CREATE_UUID_DICTIONARY); uuidInsert(db); + database = db; } @@ -287,8 +212,6 @@ public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { //upgrade logic from version 3 to 4 case 4: //upgrade logic from version 4 - alterTables(db); - break; default: throw new IllegalStateException( "onUpgrade() with unknown oldVersion " + oldVersion); @@ -296,8 +219,11 @@ public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { } - public void alterTables(SQLiteDatabase db) { -// db.execSQL("Drop table IF Exists patients"); - } + public SQLiteDatabase getWriteDb() { + if (database != null && database.isOpen()) + return database; + else + return getWritableDatabase(); + } } diff --git a/app/src/main/java/io/intelehealth/client/database/dao/BackgroundSyncDAO.java b/app/src/main/java/io/intelehealth/client/database/dao/BackgroundSyncDAO.java deleted file mode 100644 index 1b6fa61a34..0000000000 --- a/app/src/main/java/io/intelehealth/client/database/dao/BackgroundSyncDAO.java +++ /dev/null @@ -1,39 +0,0 @@ -package io.intelehealth.client.database.dao; - -import android.content.ContentValues; -import android.database.SQLException; -import android.database.sqlite.SQLiteDatabase; - -import io.intelehealth.client.app.AppConstants; -import io.intelehealth.client.app.IntelehealthApplication; -import io.intelehealth.client.utilities.SessionManager; -import io.intelehealth.client.utilities.exception.DAOException; - -public class BackgroundSyncDAO { - SessionManager sessionManager; - private SQLiteDatabase db; - - public boolean insertAfterPull() throws DAOException { - boolean isInserted = true; - sessionManager = new SessionManager(IntelehealthApplication.getAppContext()); - db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); - ContentValues values = new ContentValues(); - db.beginTransaction(); - try { - values.put("locationuuid", sessionManager.getLocationUuid()); - values.put("last_pull_execution_time", sessionManager.getPullExcutedTime()); - values.put("sync", "false"); - values.put("devices_sync", "true"); - - db.insertWithOnConflict("tbl_sync", null, values, SQLiteDatabase.CONFLICT_REPLACE); - db.setTransactionSuccessful(); - } catch (SQLException sql) { - throw new DAOException(sql.getMessage()); - } finally { - db.endTransaction(); - db.close(); - } - - return isInserted; - } -} diff --git a/app/src/main/java/io/intelehealth/client/database/dao/EmergencyEncounterDAO.java b/app/src/main/java/io/intelehealth/client/database/dao/EmergencyEncounterDAO.java deleted file mode 100644 index 8fa6ef097e..0000000000 --- a/app/src/main/java/io/intelehealth/client/database/dao/EmergencyEncounterDAO.java +++ /dev/null @@ -1,132 +0,0 @@ -package io.intelehealth.client.database.dao; - -import android.database.Cursor; -import android.database.sqlite.SQLiteDatabase; -import android.os.StrictMode; -import android.util.Log; - -import com.crashlytics.android.Crashlytics; - -import java.io.IOException; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.Locale; -import java.util.UUID; - -import io.intelehealth.client.app.AppConstants; -import io.intelehealth.client.app.IntelehealthApplication; -import io.intelehealth.client.models.dto.EncounterDTO; -import io.intelehealth.client.models.dto.ObsDTO; -import io.intelehealth.client.utilities.SessionManager; -import io.intelehealth.client.utilities.UuidDictionary; -import io.intelehealth.client.utilities.exception.DAOException; -import retrofit2.Call; - -import static io.intelehealth.client.app.AppConstants.apiInterface; - -public class EmergencyEncounterDAO { - private SessionManager sessionManager = null; - - public boolean uploadEncounterEmergency(String visitUuid, Integer voided) { - sessionManager = new SessionManager(IntelehealthApplication.getAppContext()); - SimpleDateFormat currentDate = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ", Locale.getDefault()); - Date todayDate = new Date(); - String thisDate = currentDate.format(todayDate); - - EncounterDAO encounterDAO = new EncounterDAO(); - EncounterDTO encounterDTO = new EncounterDTO(); - ObsDAO obsDAO = new ObsDAO(); - ObsDTO obsDTO = new ObsDTO(); - - String emergencyEncounterUuid = ""; - String uuid = UUID.randomUUID().toString(); - try { - emergencyEncounterUuid = encounterDAO.getEmergencyEncounters(visitUuid, encounterDAO.getEncounterTypeUuid("EMERGENCY")); - } catch (DAOException e) { - e.printStackTrace(); - } - if (!emergencyEncounterUuid.isEmpty() || !emergencyEncounterUuid.equalsIgnoreCase("")) { - encounterDTO.setEncounterTime(thisDate); - encounterDTO.setUuid(emergencyEncounterUuid); - encounterDTO.setEncounterTypeUuid(encounterDAO.getEncounterTypeUuid("EMERGENCY")); - encounterDTO.setProvideruuid(sessionManager.getProviderID()); - encounterDTO.setVisituuid(visitUuid); - encounterDTO.setVoided(voided); - encounterDTO.setSyncd(false); - - obsDTO.setConceptuuid(UuidDictionary.EMERGENCY_OBS); - obsDTO.setCreator(1); - obsDTO.setUuid(UUID.randomUUID().toString()); - obsDTO.setEncounteruuid(emergencyEncounterUuid); - obsDTO.setValue("emergency"); - } else { - encounterDTO.setEncounterTime(thisDate); - encounterDTO.setUuid(uuid); - encounterDTO.setEncounterTypeUuid(encounterDAO.getEncounterTypeUuid("EMERGENCY")); - encounterDTO.setProvideruuid(sessionManager.getProviderID()); - encounterDTO.setVisituuid(visitUuid); - encounterDTO.setVoided(voided); - encounterDTO.setSyncd(false); - - obsDTO.setConceptuuid(UuidDictionary.EMERGENCY_OBS); - obsDTO.setCreator(1); - obsDTO.setUuid(UUID.randomUUID().toString()); - obsDTO.setEncounteruuid(uuid); - obsDTO.setValue("emergency"); - } - try { - encounterDAO.createEncountersToDB(encounterDTO); - obsDAO.insertEmergencyObs(obsDTO); - } catch (DAOException e) { - Crashlytics.getInstance().core.logException(e); - } - return true; - } - - public boolean removeEncounterEmergency(final String visitUuid, SQLiteDatabase db) { - - boolean success = false; - db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); - SessionManager session = new SessionManager(IntelehealthApplication.getAppContext()); - if (visitUuid != null) { - String selectQuery = "SELECT uuid FROM tbl_encounter WHERE visituuid='" + visitUuid + "' and encounter_type_uuid='ca5f5dc3-4f0b-4097-9cae-5cf2eb44a09c'"; - Cursor cursor = db.rawQuery(selectQuery, null); - - if (cursor != null) { - if (cursor.moveToFirst()) { - while (!cursor.isAfterLast()) { - String name = cursor.getString(cursor.getColumnIndex("uuid")); - String url = "http://" + session.getServerUrl() + "/openmrs/ws/rest/v1/encounter/" + name; - Call patientUUIDResponsemodelCall = apiInterface.DELETE_ENCOUNTER(url, "Basic " + session.getEncoded()); - StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build(); - StrictMode.setThreadPolicy(policy); - try { - - int responsecode = patientUUIDResponsemodelCall.execute().raw().code(); - if (responsecode == 204) { - String delteQuery = "DELETE FROM tbl_encounter WHERE visituuid='" + visitUuid + "' and encounter_type_uuid='ca5f5dc3-4f0b-4097-9cae-5cf2eb44a09c'"; - success = true; - db.execSQL(delteQuery); - } else if (responsecode == 403) { - Log.d("403", "unauthorized" + responsecode); - - } - } catch (IOException e) { - Crashlytics.getInstance().core.logException(e); - } - cursor.moveToNext(); - } - } - - } - if (cursor != null) { - cursor.close(); - } - db.close(); - } - - return success; - } - - -} diff --git a/app/src/main/java/io/intelehealth/client/database/dao/EncounterDAO.java b/app/src/main/java/io/intelehealth/client/database/dao/EncounterDAO.java old mode 100644 new mode 100755 index 8a895556a2..4e90535f51 --- a/app/src/main/java/io/intelehealth/client/database/dao/EncounterDAO.java +++ b/app/src/main/java/io/intelehealth/client/database/dao/EncounterDAO.java @@ -23,14 +23,12 @@ public class EncounterDAO { - long createdRecordsCount = 0; - int updatecount = 0; private String tag = EncounterDAO.class.getSimpleName(); -// private SQLiteDatabase db = null; + private long createdRecordsCount = 0; public boolean insertEncounter(List encounterDTOS) throws DAOException { boolean isInserted = true; - SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); + SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWriteDb(); db.beginTransaction(); try { for (EncounterDTO encounter : encounterDTOS) { @@ -43,7 +41,7 @@ public boolean insertEncounter(List encounterDTOS) throws DAOExcep throw new DAOException(e.getMessage(), e); } finally { db.endTransaction(); - db.close(); + } return isInserted; } @@ -67,7 +65,6 @@ private boolean createEncounters(EncounterDTO encounter, SQLiteDatabase db) thro isCreated = false; throw new DAOException(e.getMessage(), e); } finally { -// db.endTransaction(); } return isCreated; } @@ -75,7 +72,7 @@ private boolean createEncounters(EncounterDTO encounter, SQLiteDatabase db) thro public boolean createEncountersToDB(EncounterDTO encounter) throws DAOException { boolean isCreated = false; - SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); + SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWriteDb(); db.beginTransaction(); ContentValues values = new ContentValues(); try { @@ -98,14 +95,14 @@ public boolean createEncountersToDB(EncounterDTO encounter) throws DAOException throw new DAOException(e.getMessage(), e); } finally { db.endTransaction(); - db.close(); + } return isCreated; } public String getEncounterTypeUuid(String attr) { String encounterTypeUuid = ""; - SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); + SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWriteDb(); Cursor cursor = db.rawQuery("SELECT uuid FROM tbl_uuid_dictionary where name = ? COLLATE NOCASE", new String[]{attr}); if (cursor.getCount() != 0) { while (cursor.moveToNext()) { @@ -113,16 +110,15 @@ public String getEncounterTypeUuid(String attr) { } } cursor.close(); - db.close(); return encounterTypeUuid; } public List unsyncedEncounters() { List encounterDTOList = new ArrayList<>(); - SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); + SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWriteDb(); db.beginTransaction(); - Cursor idCursor = db.rawQuery("SELECT * FROM tbl_encounter where sync = ? OR sync=? COLLATE NOCASE ORDER BY voided ASC", new String[]{"false", "0"}); + Cursor idCursor = db.rawQuery("SELECT distinct a.uuid,a.visituuid,a.encounter_type_uuid,a.provider_uuid,a.encounter_time,a.voided,a.privacynotice_value FROM tbl_encounter a,tbl_obs b where (a.sync = ? OR a.sync=?) and a.uuid = b.encounteruuid and b.sync='false' AND b.voided='0' ", new String[]{"false", "0"}); EncounterDTO encounterDTO = new EncounterDTO(); if (idCursor.getCount() != 0) { while (idCursor.moveToNext()) { @@ -140,7 +136,7 @@ public List unsyncedEncounters() { idCursor.close(); db.setTransactionSuccessful(); db.endTransaction(); - db.close(); + return encounterDTOList; } @@ -174,8 +170,8 @@ public List getAllEncounters() { public boolean updateEncounterSync(String synced, String uuid) throws DAOException { boolean isUpdated = true; - Logger.logD("encounterdao", "updatesynv encounter " + uuid + synced); - SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); + Logger.logD("encounterdao", "updatesynv encounter " + uuid + "" + synced); + SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWriteDb(); db.beginTransaction(); ContentValues values = new ContentValues(); String whereclause = "uuid=?"; @@ -191,7 +187,7 @@ public boolean updateEncounterSync(String synced, String uuid) throws DAOExcepti throw new DAOException(sql.getMessage()); } finally { db.endTransaction(); - db.close(); + } @@ -205,7 +201,7 @@ public boolean setEmergency(String visitUuid, boolean emergencyChecked) throws D EncounterDAO encounterDAO = new EncounterDAO(); String emergency_uuid = encounterDAO.getEncounterTypeUuid("EMERGENCY"); SessionManager sessionManager = new SessionManager(IntelehealthApplication.getAppContext()); - SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); + SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWriteDb(); //db.beginTransaction(); ContentValues values = new ContentValues(); String whereclause = "visituuid = ? AND encounter_type_uuid = ? "; @@ -222,7 +218,7 @@ public boolean setEmergency(String visitUuid, boolean emergencyChecked) throws D throw new DAOException(sql.getMessage()); } finally { // db.endTransaction(); - db.close(); + } if (emergencyChecked) { String encounteruuid = UUID.randomUUID().toString(); @@ -240,7 +236,7 @@ public boolean setEmergency(String visitUuid, boolean emergencyChecked) throws D ObsDTO obsDTO = new ObsDTO(); ObsDAO obsDAO = new ObsDAO(); obsDTO.setConceptuuid(UuidDictionary.EMERGENCY_OBS); - obsDTO.setCreator(1); + obsDTO.setCreator(sessionManager.getCreatorID()); obsDTO.setUuid(UUID.randomUUID().toString()); obsDTO.setEncounteruuid(encounteruuid); obsDTO.setValue("emergency"); @@ -251,7 +247,7 @@ public boolean setEmergency(String visitUuid, boolean emergencyChecked) throws D public String getEmergencyEncounters(String visitUuid, String encounterType) throws DAOException { String uuid = ""; - SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); + SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWriteDb(); db.beginTransaction(); try { Cursor idCursor = db.rawQuery("SELECT uuid FROM tbl_encounter where visituuid = ? AND encounter_type_uuid=? AND voided='0' COLLATE NOCASE", new String[]{visitUuid, encounterType}); @@ -268,38 +264,37 @@ public String getEmergencyEncounters(String visitUuid, String encounterType) thr throw new DAOException(e); } finally { db.endTransaction(); - db.close(); + } return uuid; } - public boolean isEmergency(String visitUuid) throws DAOException { - boolean isEmergency = false; - SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); - String selectQuery = "SELECT uuid FROM tbl_encounter WHERE visituuid='" + visitUuid + "' AND encounter_type_uuid='ca5f5dc3-4f0b-4097-9cae-5cf2eb44a09c' AND voided='0'"; + + + public boolean updateEncounterModifiedDate(String encounterUuid) throws DAOException { + boolean isUpdated = true; + Logger.logD("encounterdao", "update encounter date and time" + encounterUuid + "" + AppConstants.dateAndTimeUtils.currentDateTime()); + SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWriteDb(); db.beginTransaction(); + ContentValues values = new ContentValues(); + String whereclause = "uuid=?"; + String[] whereargs = {encounterUuid}; try { - Cursor cursor = db.rawQuery(selectQuery, null); - if (cursor != null) { - if (cursor.moveToFirst()) { - while (!cursor.isAfterLast()) { - isEmergency = true; - cursor.moveToNext(); - } - } - } - if (cursor != null) { - cursor.close(); - } - } catch (SQLException e) { - isEmergency = false; - Crashlytics.getInstance().core.logException(e); - throw new DAOException(e); + values.put("modified_date", AppConstants.dateAndTimeUtils.currentDateTime()); + values.put("encounter_time", AppConstants.dateAndTimeUtils.currentDateTime()); + int i = db.update("tbl_encounter", values, whereclause, whereargs); + Logger.logD(tag, "updated" + i); + db.setTransactionSuccessful(); + } catch (SQLException sql) { + Logger.logD(tag, "updated" + sql.getMessage()); + throw new DAOException(sql.getMessage()); } finally { db.endTransaction(); - db.close(); + + } - return isEmergency; + + return isUpdated; } diff --git a/app/src/main/java/io/intelehealth/client/database/dao/ImagesDAO.java b/app/src/main/java/io/intelehealth/client/database/dao/ImagesDAO.java old mode 100644 new mode 100755 index a18b3bf25b..7bc613afa8 --- a/app/src/main/java/io/intelehealth/client/database/dao/ImagesDAO.java +++ b/app/src/main/java/io/intelehealth/client/database/dao/ImagesDAO.java @@ -2,11 +2,13 @@ import android.content.ContentValues; import android.database.Cursor; +import android.database.SQLException; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteException; import com.crashlytics.android.Crashlytics; +import java.io.File; import java.util.ArrayList; import java.util.List; @@ -23,7 +25,7 @@ public class ImagesDAO { public boolean insertObsImageDatabase(String uuid, String encounteruuid, String conceptUuid) throws DAOException { boolean isInserted = false; - SQLiteDatabase localdb = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); + SQLiteDatabase localdb = AppConstants.inteleHealthDatabaseHelper.getWriteDb(); localdb.beginTransaction(); ContentValues contentValues = new ContentValues(); try { @@ -41,13 +43,13 @@ public boolean insertObsImageDatabase(String uuid, String encounteruuid, String throw new DAOException(e); } finally { localdb.endTransaction(); - localdb.close(); + } return isInserted; } public boolean updateObs(String uuid) throws DAOException { - SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); + SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWriteDb(); db.beginTransaction(); int updatedCount = 0; ContentValues values = new ContentValues(); @@ -64,42 +66,55 @@ public boolean updateObs(String uuid) throws DAOException { } finally { db.endTransaction(); - db.close(); + } return true; } - public boolean deleteImageFromDatabase(String uuid) throws DAOException { + public boolean deleteConceptImages(String encounterUuid, String conceptUuid) throws DAOException { boolean isDeleted = false; int updateDeltedRows = 0; - Logger.logD(TAG, "Deleted image uuid" + uuid); - SQLiteDatabase localdb = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); + Logger.logD(TAG, "Deleted image uuid" + encounterUuid); + SQLiteDatabase localdb = AppConstants.inteleHealthDatabaseHelper.getWriteDb(); String[] coloumns = {"uuid"}; - String[] selectionArgs = {uuid}; + String[] selectionArgs = {encounterUuid}; localdb.beginTransaction(); try { - Cursor cursor = localdb.query("tbl_obs", coloumns, "uuid = ?", selectionArgs, null, null, null); - if (cursor != null && cursor.moveToFirst()) { - ContentValues cv = new ContentValues(); - cv.put("voided", "1"); //These Fields should be your String values of actual column names - cv.put("sync", "false"); - //cv.put("Field2","Male"); - updateDeltedRows = localdb.updateWithOnConflict("tbl_obs", cv, "uuid=?", new String[]{uuid}, SQLiteDatabase.CONFLICT_REPLACE); -// localdb.execSQL("UPDATE tbl_obs SET voided = '1' WHERE uuid=" + "'" + uuid + "' AND sync='false'"); -// localdb.setTransactionSuccessful(); - } - if (cursor != null) { - cursor.close(); - } - isDeleted = updateDeltedRows != 0; + ContentValues cv = new ContentValues(); + cv.put("voided", "1"); //These Fields should be your String values of actual column names + cv.put("sync", "false"); + localdb.updateWithOnConflict("tbl_obs", cv, "encounteruuid=? AND conceptuuid=?", new String[]{encounterUuid, conceptUuid}, SQLiteDatabase.CONFLICT_REPLACE); localdb.setTransactionSuccessful(); - } catch (SQLiteException e) { - Crashlytics.getInstance().core.logException(e); - throw new DAOException(e); + } catch (SQLException sql) { + Crashlytics.getInstance().core.logException(sql); + throw new DAOException(sql); + } finally { + localdb.endTransaction(); + } + return isDeleted; + + } + + public boolean deleteImageFromDatabase(String obsUuid) throws DAOException { + boolean isDeleted = false; + int updateDeltedRows = 0; + Logger.logD(TAG, "Deleted image uuid" + obsUuid); + SQLiteDatabase localdb = AppConstants.inteleHealthDatabaseHelper.getWriteDb(); + + localdb.beginTransaction(); + try { + + ContentValues cv = new ContentValues(); + cv.put("voided", "1"); //These Fields should be your String values of actual column names + cv.put("sync", "false"); + localdb.updateWithOnConflict("tbl_obs", cv, "uuid=? ", new String[]{obsUuid}, SQLiteDatabase.CONFLICT_REPLACE); + localdb.setTransactionSuccessful(); + } catch (SQLException sql) { + Crashlytics.getInstance().core.logException(sql); + throw new DAOException(sql); } finally { localdb.endTransaction(); - localdb.close(); } return isDeleted; @@ -108,7 +123,7 @@ public boolean deleteImageFromDatabase(String uuid) throws DAOException { public List getVoidedImageObs() throws DAOException { Logger.logD(TAG, "uuid for images"); ArrayList uuidList = new ArrayList<>(); - SQLiteDatabase localdb = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); + SQLiteDatabase localdb = AppConstants.inteleHealthDatabaseHelper.getWriteDb(); localdb.beginTransaction(); try { Cursor idCursor = localdb.rawQuery("SELECT uuid FROM tbl_obs where (conceptuuid=? OR conceptuuid = ?) AND voided=? AND sync = ? COLLATE NOCASE", new String[]{UuidDictionary.COMPLEX_IMAGE_AD, UuidDictionary.COMPLEX_IMAGE_PE, "1", "false"}); @@ -122,7 +137,7 @@ public List getVoidedImageObs() throws DAOException { throw new DAOException(e); } finally { localdb.endTransaction(); - localdb.close(); + } return uuidList; @@ -130,7 +145,7 @@ public List getVoidedImageObs() throws DAOException { public boolean insertPatientProfileImages(String imagepath, String patientUuid) throws DAOException { boolean isInserted = false; - SQLiteDatabase localdb = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); + SQLiteDatabase localdb = AppConstants.inteleHealthDatabaseHelper.getWriteDb(); localdb.beginTransaction(); ContentValues contentValues = new ContentValues(); try { @@ -149,7 +164,7 @@ public boolean insertPatientProfileImages(String imagepath, String patientUuid) throw new DAOException(e); } finally { localdb.endTransaction(); - localdb.close(); + } return isInserted; } @@ -157,7 +172,7 @@ public boolean insertPatientProfileImages(String imagepath, String patientUuid) public boolean updatePatientProfileImages(String imagepath, String patientuuid) throws DAOException { boolean isUpdated = false; long isupdate = 0; - SQLiteDatabase localdb = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); + SQLiteDatabase localdb = AppConstants.inteleHealthDatabaseHelper.getWriteDb(); localdb.beginTransaction(); ContentValues contentValues = new ContentValues(); String whereclause = "patientuuid = ? AND image_type = ?"; @@ -175,7 +190,7 @@ public boolean updatePatientProfileImages(String imagepath, String patientuuid) throw new DAOException(e); } finally { localdb.endTransaction(); - localdb.close(); + } if (isupdate == 0) isUpdated = insertPatientProfileImages(imagepath, patientuuid); @@ -184,7 +199,7 @@ public boolean updatePatientProfileImages(String imagepath, String patientuuid) public List getPatientProfileUnsyncedImages() throws DAOException { List patientProfiles = new ArrayList<>(); - SQLiteDatabase localdb = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); + SQLiteDatabase localdb = AppConstants.inteleHealthDatabaseHelper.getWriteDb(); Base64Utils base64Utils = new Base64Utils(); localdb.beginTransaction(); try { @@ -202,7 +217,7 @@ public List getPatientProfileUnsyncedImages() throws DAOExceptio throw new DAOException(e); } finally { localdb.endTransaction(); - localdb.close(); + } return patientProfiles; @@ -210,7 +225,7 @@ public List getPatientProfileUnsyncedImages() throws DAOExceptio public List getObsUnsyncedImages() throws DAOException { List obsImages = new ArrayList<>(); - SQLiteDatabase localdb = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); + SQLiteDatabase localdb = AppConstants.inteleHealthDatabaseHelper.getWriteDb(); localdb.beginTransaction(); try { Cursor idCursor = localdb.rawQuery("select c.uuid as patientuuid,d.conceptuuid,a.uuid as encounteruuid,d.uuid as obsuuid,d.modified_date from tbl_encounter a , tbl_visit b , tbl_patient c,tbl_obs d where a.visituuid=b.uuid and b.patientuuid=c.uuid and d.encounteruuid=a.uuid and (d.sync=0 or d.sync='false') and (d.conceptuuid=? or d.conceptuuid=?) and d.voided='0'", new String[]{UuidDictionary.COMPLEX_IMAGE_PE, UuidDictionary.COMPLEX_IMAGE_AD}); @@ -222,7 +237,6 @@ public List getObsUnsyncedImages() throws DAOException { obsPushDTO.setObsDatetime(idCursor.getString(idCursor.getColumnIndexOrThrow("modified_date"))); obsPushDTO.setUuid(idCursor.getString(idCursor.getColumnIndexOrThrow("obsuuid"))); obsPushDTO.setPerson(idCursor.getString(idCursor.getColumnIndexOrThrow("patientuuid"))); -// obsPushDTO.setPerson(getPatientUuidFromEncounter(idCursor.getString(idCursor.getColumnIndexOrThrow("encounteruuid")), localdb)); obsImages.add(obsPushDTO); } } @@ -231,38 +245,17 @@ public List getObsUnsyncedImages() throws DAOException { throw new DAOException(e); } finally { localdb.endTransaction(); - localdb.close(); + } return obsImages; } - public String getobsImagePath(String uuid) throws DAOException { - String imagePath = ""; - SQLiteDatabase localdb = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); - localdb.beginTransaction(); - try { - Cursor idCursor = localdb.rawQuery("SELECT * FROM tbl_image_records where uuid=? COLLATE NOCASE", new String[]{uuid}); - if (idCursor.getCount() != 0) { - while (idCursor.moveToNext()) { - imagePath = idCursor.getString(idCursor.getColumnIndexOrThrow("image_path")); - } - } - idCursor.close(); - } catch (SQLiteException e) { - throw new DAOException(e); - } finally { - localdb.endTransaction(); - localdb.close(); - } - - return imagePath; - } public String getPatientProfileChangeTime(String patientUuid) throws DAOException { String datetime = ""; - SQLiteDatabase localdb = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); + SQLiteDatabase localdb = AppConstants.inteleHealthDatabaseHelper.getWriteDb(); localdb.beginTransaction(); try { Cursor idCursor = localdb.rawQuery("SELECT * FROM tbl_image_records where patientuuid=? AND image_type = ? COLLATE NOCASE", new String[]{patientUuid, "PP"}); @@ -276,7 +269,7 @@ public String getPatientProfileChangeTime(String patientUuid) throws DAOExceptio throw new DAOException(e); } finally { localdb.endTransaction(); - localdb.close(); + } return datetime; @@ -286,7 +279,7 @@ public String getPatientProfileChangeTime(String patientUuid) throws DAOExceptio public boolean updateUnsyncedPatientProfile(String patientuuid, String type) throws DAOException { boolean isUpdated = false; long isupdate = 0; - SQLiteDatabase localdb = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); + SQLiteDatabase localdb = AppConstants.inteleHealthDatabaseHelper.getWriteDb(); localdb.beginTransaction(); ContentValues contentValues = new ContentValues(); String whereclause = "patientuuid = ? AND image_type = ?"; @@ -303,7 +296,7 @@ public boolean updateUnsyncedPatientProfile(String patientuuid, String type) thr throw new DAOException(e); } finally { localdb.endTransaction(); - localdb.close(); + } return isUpdated; } @@ -311,7 +304,7 @@ public boolean updateUnsyncedPatientProfile(String patientuuid, String type) thr public boolean updateUnsyncedObsImages(String uuid) throws DAOException { boolean isUpdated = false; long isupdate = 0; - SQLiteDatabase localdb = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); + SQLiteDatabase localdb = AppConstants.inteleHealthDatabaseHelper.getWriteDb(); localdb.beginTransaction(); ContentValues contentValues = new ContentValues(); String whereclause = "uuid = ?"; @@ -328,31 +321,45 @@ public boolean updateUnsyncedObsImages(String uuid) throws DAOException { throw new DAOException(e); } finally { localdb.endTransaction(); - localdb.close(); + } return isUpdated; } - private String getImageTypeUUid(String imageType) { - String imagetype = ""; - if (imageType.equalsIgnoreCase("AD")) - imagetype = UuidDictionary.COMPLEX_IMAGE_AD; - else - imagetype = UuidDictionary.COMPLEX_IMAGE_PE; - return imagetype; + public ArrayList getImageUuid(String encounterUuid, String conceptuuid) throws DAOException { + Logger.logD(TAG, "encounter uuid for image " + encounterUuid); + ArrayList uuidList = new ArrayList<>(); + SQLiteDatabase localdb = AppConstants.inteleHealthDatabaseHelper.getWriteDb(); + localdb.beginTransaction(); + try { + Cursor idCursor = localdb.rawQuery("SELECT uuid FROM tbl_obs where encounteruuid=? AND conceptuuid = ? AND voided=? COLLATE NOCASE", new String[]{encounterUuid, conceptuuid, "0"}); + if (idCursor.getCount() != 0) { + while (idCursor.moveToNext()) { + uuidList.add(idCursor.getString(idCursor.getColumnIndexOrThrow("uuid"))); + } + } + idCursor.close(); + } catch (SQLiteException e) { + throw new DAOException(e); + } finally { + localdb.endTransaction(); + + } + return uuidList; } - public String getPatientUuidFromEncounter(String encounterUuid, SQLiteDatabase localdb) throws DAOException { - Logger.logD(TAG, "encounter uuid " + encounterUuid); - String visituuid = ""; -// SQLiteDatabase localdb = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); + + public List getImages(String encounterUUid, String ConceptUuid) throws DAOException { + List imagesList = new ArrayList<>(); + + SQLiteDatabase localdb = AppConstants.inteleHealthDatabaseHelper.getWriteDb(); localdb.beginTransaction(); try { - Cursor idCursor = localdb.rawQuery("SELECT uuid FROM tbl_encounter where uuid=? AND voided=? COLLATE NOCASE", new String[]{encounterUuid, "0"}); + Cursor idCursor = localdb.rawQuery("SELECT uuid FROM tbl_obs where encounteruuid=? AND conceptuuid = ? AND voided=? COLLATE NOCASE", new String[]{encounterUUid, ConceptUuid, "0"}); if (idCursor.getCount() != 0) { while (idCursor.moveToNext()) { - visituuid = idCursor.getString(idCursor.getColumnIndexOrThrow("uuid")); + imagesList.add(idCursor.getString(idCursor.getColumnIndexOrThrow("uuid"))); } } idCursor.close(); @@ -362,24 +369,21 @@ public String getPatientUuidFromEncounter(String encounterUuid, SQLiteDatabase l } catch (SQLiteException e) { throw new DAOException(e); } finally { -// localdb.endTransaction(); -// localdb.close(); + localdb.endTransaction(); } - VisitsDAO visitsDAO = new VisitsDAO(); - return visitsDAO.patientUuidByViistUuid(visituuid); - + return imagesList; } - public ArrayList getImageUuid(String encounterUuid, String conceptuuid) throws DAOException { - Logger.logD(TAG, "encounter uuid for image " + encounterUuid); - ArrayList uuidList = new ArrayList<>(); - SQLiteDatabase localdb = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); + + public List isImageListObsExists(String encounterUuid, String conceptUuid) throws DAOException { + List imagesList = new ArrayList<>(); + SQLiteDatabase localdb = AppConstants.inteleHealthDatabaseHelper.getWriteDb(); localdb.beginTransaction(); try { - Cursor idCursor = localdb.rawQuery("SELECT uuid FROM tbl_obs where encounteruuid=? AND conceptuuid = ? AND voided=? COLLATE NOCASE", new String[]{encounterUuid, conceptuuid, "0"}); + Cursor idCursor = localdb.rawQuery("SELECT uuid FROM tbl_obs where encounteruuid=? AND conceptuuid = ? AND voided=? COLLATE NOCASE order by modified_date", new String[]{encounterUuid, conceptUuid, "0"}); if (idCursor.getCount() != 0) { while (idCursor.moveToNext()) { - uuidList.add(idCursor.getString(idCursor.getColumnIndexOrThrow("uuid"))); + imagesList.add(idCursor.getString(idCursor.getColumnIndexOrThrow("uuid"))); } } idCursor.close(); @@ -387,11 +391,23 @@ public ArrayList getImageUuid(String encounterUuid, String conceptuuid) throws D throw new DAOException(e); } finally { localdb.endTransaction(); - localdb.close(); } - return uuidList; + + return imagesList; } + public boolean isLocalImageUuidExists(String imageuuid) throws DAOException { + boolean isLocalImageExists = false; + File imagesPath = new File(AppConstants.IMAGE_PATH); + String imageName = imageuuid + ".jpg"; + if (new File(imagesPath + "/" + imageName).exists()) { + isLocalImageExists = true; + } + return isLocalImageExists; + } + + + } diff --git a/app/src/main/java/io/intelehealth/client/database/dao/ImagesPushDAO.java b/app/src/main/java/io/intelehealth/client/database/dao/ImagesPushDAO.java old mode 100644 new mode 100755 index 6352dc4ba2..77eb369da5 --- a/app/src/main/java/io/intelehealth/client/database/dao/ImagesPushDAO.java +++ b/app/src/main/java/io/intelehealth/client/database/dao/ImagesPushDAO.java @@ -31,16 +31,6 @@ public class ImagesPushDAO { String TAG = ImagesPushDAO.class.getSimpleName(); SessionManager sessionManager = null; -// public PatientProfile PatientProfileFrameJson(String uuid) { -// -// -// PatientProfile patientProfile = new PatientProfile(); -// patientProfile.setBase64EncodedImage(""); -// patientProfile.setPerson(""); -// -// -// return patientProfile; -// } public boolean patientProfileImagesPush() { @@ -69,18 +59,18 @@ public void onSuccess(ResponseBody responseBody) { } catch (DAOException e) { Crashlytics.getInstance().core.logException(e); } - AppConstants.notificationUtils.DownloadDone("Patient Profile", "Uploaded Patient Profile", IntelehealthApplication.getAppContext()); + AppConstants.notificationUtils.DownloadDone("Patient Profile", "Uploaded Patient Profile", 4, IntelehealthApplication.getAppContext()); } @Override public void onError(Throwable e) { Logger.logD(TAG, "Onerror " + e.getMessage()); - AppConstants.notificationUtils.DownloadDone("Patient Profile", "Error Uploading Patient Profile", IntelehealthApplication.getAppContext()); + AppConstants.notificationUtils.DownloadDone("Patient Profile", "Error Uploading Patient Profile", 4, IntelehealthApplication.getAppContext()); } }); } sessionManager.setPullSyncFinished(true); - AppConstants.notificationUtils.DownloadDone("Patient Profile", "Completed Uploading Patient Profile", IntelehealthApplication.getAppContext()); + AppConstants.notificationUtils.DownloadDone("Patient Profile", "Completed Uploading Patient Profile", 4, IntelehealthApplication.getAppContext()); return true; } @@ -135,7 +125,7 @@ public void onComplete() { }); } sessionManager.setPushSyncFinished(true); - AppConstants.notificationUtils.DownloadDone("Patient Profile", "Completed Uploading Patient Profile", IntelehealthApplication.getAppContext()); + AppConstants.notificationUtils.DownloadDone("Patient Profile", "Completed Uploading Patient Profile", 4, IntelehealthApplication.getAppContext()); return true; } @@ -176,11 +166,4 @@ public void onComplete() { return true; } - public boolean isImageUuidExisits(String uuidImage) { - - - return true; - } - - } diff --git a/app/src/main/java/io/intelehealth/client/database/dao/LocationDAO.java b/app/src/main/java/io/intelehealth/client/database/dao/LocationDAO.java old mode 100644 new mode 100755 index 446720b85d..d352876e80 --- a/app/src/main/java/io/intelehealth/client/database/dao/LocationDAO.java +++ b/app/src/main/java/io/intelehealth/client/database/dao/LocationDAO.java @@ -14,28 +14,15 @@ public class LocationDAO { long createdRecordsCount = 0; - int updatecount = 0; -// private SQLiteDatabase db = null; public boolean insertLocations(List locationDTOS) throws DAOException { boolean isInserted = true; - SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); -// AppConstants.inteleHealthDatabaseHelper.onCreate(db); - ContentValues values = new ContentValues(); + SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWriteDb(); db.beginTransaction(); try { for (LocationDTO location : locationDTOS) { -// Cursor cursor = db.rawQuery("SELECT locationuuid FROM tbl_location where locationuuid = ?", new String[]{location.getLocationuuid()}); -// if (cursor.getCount() != 0) { -// while (cursor.moveToNext()) { -// updateLocation(location); -// } -// } else { -// Logger.logD("insert", "insert has to happen"); createLocation(location, db); -// } -// AppConstants.sqliteDbCloseHelper.cursorClose(cursor); } db.setTransactionSuccessful(); } catch (SQLException e) { @@ -43,7 +30,7 @@ public boolean insertLocations(List locationDTOS) throws DAOExcepti throw new DAOException(e.getMessage(), e); } finally { db.endTransaction(); - AppConstants.sqliteDbCloseHelper.dbClose(db); + } return isInserted; @@ -52,55 +39,19 @@ public boolean insertLocations(List locationDTOS) throws DAOExcepti private boolean createLocation(LocationDTO location, SQLiteDatabase db) throws DAOException { boolean isCreated = true; ContentValues values = new ContentValues(); -// db.beginTransaction(); try { -// for (LocationDTO l : locationDTOS) { -// Logger.logD("insert", "insert has to happen"); values.put("name", location.getName()); values.put("locationuuid", location.getLocationuuid()); values.put("retired", location.getRetired()); - values.put("modified_date", AppConstants.dateAndTimeUtils.currentDateTime()); + values.put("modified_date", AppConstants.dateAndTimeUtils.currentDateTime()); values.put("sync", "TRUE"); -// Logger.logD("pulldata", "datadumper" + values); - createdRecordsCount = db.insertWithOnConflict("tbl_location", null, values, SQLiteDatabase.CONFLICT_REPLACE); -// } -// db.setTransactionSuccessful(); -// Logger.logD("created records", "created records count" + createdRecordsCount); + createdRecordsCount = db.insertWithOnConflict("tbl_location", null, values, SQLiteDatabase.CONFLICT_REPLACE); } catch (SQLException e) { isCreated = false; throw new DAOException(e.getMessage(), e); } finally { -// db.endTransaction(); -// AppConstants.sqliteDbCloseHelper.dbClose(db); } return isCreated; } -// private boolean updateLocation(LocationDTO location) throws DAOException { -// boolean isUpdated = true; -// ContentValues values = new ContentValues(); -// String selection = "locationuuid = ?"; -// db.beginTransaction(); -// try { -//// for (LocationDTO l : locationDTOS) { -//// Logger.logD("insert", "insert has to happen"); -// values.put("name", location.getName()); -// values.put("retired", location.getRetired()); -// values.put("modified_date", AppConstants.dateAndTimeUtils.currentDateTime()); -// values.put("synced", "TRUE"); -//// Logger.logD("pulldata", "datadumper" + values); -// updatecount = db.updateWithOnConflict("tbl_location", values, selection, new String[]{location.getLocationuuid()}, SQLiteDatabase.CONFLICT_REPLACE); -//// } -// db.setTransactionSuccessful(); -//// Logger.logD("updated", "updatedrecords count" + updatecount); -// } catch (SQLException e) { -// isUpdated = false; -// throw new DAOException(e.getMessage(), e); -// } finally { -// db.endTransaction(); -//// AppConstants.sqliteDbCloseHelper.dbClose(db); -// } -// return isUpdated; -// } - } diff --git a/app/src/main/java/io/intelehealth/client/database/dao/ObsDAO.java b/app/src/main/java/io/intelehealth/client/database/dao/ObsDAO.java old mode 100644 new mode 100755 index cbffe6448d..5d850cf347 --- a/app/src/main/java/io/intelehealth/client/database/dao/ObsDAO.java +++ b/app/src/main/java/io/intelehealth/client/database/dao/ObsDAO.java @@ -23,8 +23,6 @@ public class ObsDAO { - // int updatecount = 0; -// long createdRecordsCount = 0; private SQLiteDatabase db = null; SessionManager sessionManager = null; String TAG = ObsDAO.class.getSimpleName(); @@ -32,23 +30,14 @@ public class ObsDAO { public boolean insertObsTemp(List obsDTOS) throws DAOException { sessionManager = new SessionManager(IntelehealthApplication.getAppContext()); boolean isInserted = true; - db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); + db = AppConstants.inteleHealthDatabaseHelper.getWriteDb(); try { db.beginTransaction(); Logger.logD("insert", " insert obs"); for (ObsDTO obs : obsDTOS) { if (sessionManager.isFirstTimeSyncExcuted() && obs.getVoided() == 1) - continue;//performance reason - /*Cursor cursor = db.rawQuery("SELECT uuid FROM tbl_obs where uuid= ?", new String[]{obs.getUuid()}); - if (cursor.getCount() != 0) { - while (cursor.moveToNext()) { -// Logger.logD("update", "update has to happen"); - updateObs(obs); - } - } else {*/ + continue; createObs(obs); - //} - //AppConstants.sqliteDbCloseHelper.cursorClose(cursor); } db.setTransactionSuccessful(); Logger.logD("insert obs finished", " insert obs finished"); @@ -57,7 +46,7 @@ public boolean insertObsTemp(List obsDTOS) throws DAOException { throw new DAOException(e.getMessage(), e); } finally { db.endTransaction(); - db.close(); + } return isInserted; @@ -69,72 +58,30 @@ private boolean createObs(ObsDTO obsDTOS) throws DAOException { long createdRecordsCount = 0; ContentValues values = new ContentValues(); try { - -// for (ObsDTO obs : obsDTOS) { -// Logger.logD("insert", "insert has to happen"); - - // db.beginTransaction(); - values.put("uuid", obsDTOS.getUuid()); values.put("encounteruuid", obsDTOS.getEncounteruuid()); values.put("creator", obsDTOS.getCreator()); values.put("conceptuuid", obsDTOS.getConceptuuid()); values.put("value", obsDTOS.getValue()); + values.put("obsservermodifieddate", obsDTOS.getObsServerModifiedDate()); values.put("modified_date", AppConstants.dateAndTimeUtils.currentDateTime()); values.put("voided", obsDTOS.getVoided()); values.put("sync", "TRUE"); -// createdRecordsCount = db.insert("temp_obs", null, values); -// Logger.logD("pulldata", "datadumper" + values); createdRecordsCount = db.insertWithOnConflict("tbl_obs", null, values, SQLiteDatabase.CONFLICT_REPLACE); -// } - //db.setTransactionSuccessful(); -// Logger.logD("created records", "created records count" + createdRecordsCount); } catch (SQLException e) { isCreated = false; throw new DAOException(e.getMessage(), e); } finally { - //db.endTransaction(); } return isCreated; } -// private boolean updateObs(ObsDTO obsDTOS) throws DAOException { -// boolean isUpdated = true; -// db.beginTransaction(); -// ContentValues values = new ContentValues(); -// String selection = "uuid = ?"; -// try { -//// for (ObsDTO obs : obsDTOS) { -//// Logger.logD("update", "update has to happen"); -// values.put("encounteruuid", obsDTOS.getEncounteruuid()); -// values.put("creator", obsDTOS.getCreator()); -// values.put("conceptuuid", obsDTOS.getConceptuuid()); -// values.put("value", obsDTOS.getValue()); -// values.put("modified_date", AppConstants.dateAndTimeUtils.currentDateTime()); -// values.put("voided", obsDTOS.getVoided()); -// values.put("synced", "TRUE"); -//// Logger.logD("pulldata", "datadumper" + values); -// updatecount = db.updateWithOnConflict("tbl_obs", values, selection, new String[]{obsDTOS.getUuid()}, SQLiteDatabase.CONFLICT_REPLACE); -//// } -// db.setTransactionSuccessful(); -//// Logger.logD("updated", "updatedrecords count" + updatecount); -// } catch (SQLException e) { -// isUpdated = false; -// throw new DAOException(e.getMessage(), e); -// } finally { -// db.endTransaction(); -// } -// -// return isUpdated; -// -// } - public boolean insertObs(ObsDTO obsDTO) throws DAOException { boolean isUpdated = true; long insertedCount = 0; - SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); + SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWriteDb(); db.beginTransaction(); ContentValues values = new ContentValues(); @@ -145,9 +92,9 @@ public boolean insertObs(ObsDTO obsDTO) throws DAOException { values.put("conceptuuid", obsDTO.getConceptuuid()); values.put("value", obsDTO.getValue()); values.put("modified_date", AppConstants.dateAndTimeUtils.currentDateTime()); - values.put("voided", ""); + values.put("voided", "0"); values.put("sync", "false"); - insertedCount = db.insert("tbl_obs", null, values); + insertedCount = db.insertWithOnConflict("tbl_obs", null, values, SQLiteDatabase.CONFLICT_REPLACE); db.setTransactionSuccessful(); Logger.logD("updated", "updatedrecords count" + insertedCount); @@ -156,50 +103,16 @@ public boolean insertObs(ObsDTO obsDTO) throws DAOException { throw new DAOException(e); } finally { db.endTransaction(); - db.close(); - } - - return isUpdated; - - } - - public boolean insertEmergencyObs(ObsDTO obsDTO) throws DAOException { - boolean isCreated = true; - long insertedCount = 0; - SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); - db.beginTransaction(); - ContentValues values = new ContentValues(); - try { - values.put("uuid", obsDTO.getUuid()); - values.put("encounteruuid", obsDTO.getEncounteruuid()); - values.put("creator", obsDTO.getCreator()); - values.put("conceptuuid", obsDTO.getConceptuuid()); - values.put("value", obsDTO.getValue()); - values.put("modified_date", AppConstants.dateAndTimeUtils.currentDateTime()); - values.put("voided", ""); - values.put("sync", "FALSE"); - insertedCount = db.insert("tbl_obs", null, values); - if (insertedCount != 0) - isCreated = true; - db.setTransactionSuccessful(); - Logger.logD("inserted Emergency ", "created count" + insertedCount); - } catch (SQLException e) { - isCreated = false; - Crashlytics.getInstance().core.logException(e); - throw new DAOException(e); - } finally { - db.endTransaction(); - db.close(); } - return isCreated; + return isUpdated; } public boolean updateObs(ObsDTO obsDTO) { - SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); + SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWriteDb(); db.beginTransaction(); int updatedCount = 0; ContentValues values = new ContentValues(); @@ -211,7 +124,7 @@ public boolean updateObs(ObsDTO obsDTO) { values.put("conceptuuid", obsDTO.getConceptuuid()); values.put("value", obsDTO.getValue()); values.put("modified_date", AppConstants.dateAndTimeUtils.currentDateTime()); - values.put("voided", ""); + values.put("voided", "0"); values.put("sync", "false"); updatedCount = db.update("tbl_obs", values, selection, new String[]{obsDTO.getUuid()}); @@ -222,9 +135,9 @@ public boolean updateObs(ObsDTO obsDTO) { } finally { db.endTransaction(); - db.close(); + } - //If no value is not found, then update fails so insert instead. +// If no value is not found, then update fails so insert instead. if (updatedCount == 0) { try { insertObs(obsDTO); @@ -240,7 +153,7 @@ public boolean updateObs(ObsDTO obsDTO) { public boolean insertObsToDb(List obsDTO) throws DAOException { boolean isUpdated = true; long insertedCount = 0; - SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); + SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWriteDb(); db.beginTransaction(); ContentValues values = new ContentValues(); @@ -252,7 +165,7 @@ public boolean insertObsToDb(List obsDTO) throws DAOException { values.put("conceptuuid", ob.getConceptuuid()); values.put("value", ob.getValue()); values.put("modified_date", AppConstants.dateAndTimeUtils.currentDateTime()); - values.put("voided", ""); + values.put("voided", "0"); values.put("sync", "FALSE"); insertedCount = db.insert("tbl_obs", null, values); } @@ -264,7 +177,7 @@ public boolean insertObsToDb(List obsDTO) throws DAOException { throw new DAOException(e); } finally { db.endTransaction(); - db.close(); + } return isUpdated; @@ -273,9 +186,9 @@ public boolean insertObsToDb(List obsDTO) throws DAOException { public List obsDTOList(String encounteruuid) { List obsDTOList = new ArrayList<>(); - db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); + db = AppConstants.inteleHealthDatabaseHelper.getWriteDb(); //take All obs except image obs - Cursor idCursor = db.rawQuery("SELECT * FROM tbl_obs where encounteruuid = ? AND (conceptuuid != ? AND conceptuuid != ?)", new String[]{encounteruuid, UuidDictionary.COMPLEX_IMAGE_AD, UuidDictionary.COMPLEX_IMAGE_PE}); + Cursor idCursor = db.rawQuery("SELECT * FROM tbl_obs where encounteruuid = ? AND (conceptuuid != ? AND conceptuuid != ?) AND voided='0' AND sync='false'", new String[]{encounteruuid, UuidDictionary.COMPLEX_IMAGE_AD, UuidDictionary.COMPLEX_IMAGE_PE}); ObsDTO obsDTO = new ObsDTO(); if (idCursor.getCount() != 0) { while (idCursor.moveToNext()) { @@ -288,14 +201,13 @@ public List obsDTOList(String encounteruuid) { } } idCursor.close(); - db.close(); return obsDTOList; } public List getImageStrings(String conceptuuid, String encounterUuidAdultIntials) { List rawStrings = new ArrayList<>(); - db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); + db = AppConstants.inteleHealthDatabaseHelper.getWriteDb(); Cursor idCursor = db.rawQuery("SELECT uuid FROM tbl_obs where conceptuuid = ? AND encounteruuid = ? AND voided='0'", new String[]{conceptuuid, encounterUuidAdultIntials}); if (idCursor.getCount() != 0) { while (idCursor.moveToNext()) { @@ -303,9 +215,32 @@ public List getImageStrings(String conceptuuid, String encounterUuidAdul } } idCursor.close(); - db.close(); + return rawStrings; } + public String getObsuuid(String encounterUuid, String conceptUuid) throws DAOException { + String obsuuid = null; + db = AppConstants.inteleHealthDatabaseHelper.getWriteDb(); + Cursor obsCursoursor = db.rawQuery("Select uuid from tbl_obs where conceptuuid=? and encounteruuid=? and voided='0' order by created_date,obsservermodifieddate desc limit 1 ", new String[]{conceptUuid, encounterUuid}); + try { + if (obsCursoursor.getCount() != 0) { + while (obsCursoursor.moveToNext()) { + obsuuid = obsCursoursor.getString(obsCursoursor.getColumnIndexOrThrow("uuid")); + } + + } + } catch (SQLException sql) { + Crashlytics.getInstance().core.logException(sql); + throw new DAOException(sql); + } finally { + obsCursoursor.close(); + } + + + return obsuuid; + } + + } diff --git a/app/src/main/java/io/intelehealth/client/database/dao/PatientsDAO.java b/app/src/main/java/io/intelehealth/client/database/dao/PatientsDAO.java old mode 100644 new mode 100755 index ec9faf2c98..68ca789de1 --- a/app/src/main/java/io/intelehealth/client/database/dao/PatientsDAO.java +++ b/app/src/main/java/io/intelehealth/client/database/dao/PatientsDAO.java @@ -27,12 +27,11 @@ public class PatientsDAO { private int updatecount = 0; private long createdRecordsCount = 0; -// SQLiteDatabase db = null; public boolean insertPatients(List patientDTO) throws DAOException { boolean isInserted = true; - SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); + SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWriteDb(); ContentValues values = new ContentValues(); db.beginTransaction(); try { @@ -45,7 +44,6 @@ public boolean insertPatients(List patientDTO) throws DAOException { throw new DAOException(e.getMessage(), e); } finally { db.endTransaction(); - AppConstants.sqliteDbCloseHelper.dbClose(db); } return isInserted; @@ -83,7 +81,7 @@ public boolean insertPatientToDB(PatientDTO patientDTO, String uuid) throws DAOE boolean isCreated = true; long createdRecordsCount1 = 0; SQLiteDatabase db = null; - db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); + db = AppConstants.inteleHealthDatabaseHelper.getWriteDb(); ContentValues values = new ContentValues(); db.beginTransaction(); List patientAttributesList = new ArrayList(); @@ -120,7 +118,6 @@ public boolean insertPatientToDB(PatientDTO patientDTO, String uuid) throws DAOE throw new DAOException(e.getMessage(), e); } finally { db.endTransaction(); - AppConstants.sqliteDbCloseHelper.dbClose(db); } return isCreated; @@ -129,7 +126,7 @@ public boolean insertPatientToDB(PatientDTO patientDTO, String uuid) throws DAOE public boolean updatePatientToDB(Patient patientDTO, String uuid, List patientAttributesDTOS) throws DAOException { boolean isCreated = true; long createdRecordsCount1 = 0; - SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); + SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWriteDb(); ContentValues values = new ContentValues(); String whereclause = "Uuid=?"; db.beginTransaction(); @@ -166,7 +163,6 @@ public boolean updatePatientToDB(Patient patientDTO, String uuid, List patientAttributesDTOS) throws DAOException { boolean isInserted = true; - SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); + SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWriteDb(); db.beginTransaction(); try { ContentValues values = new ContentValues(); @@ -185,7 +181,6 @@ public boolean patientAttributes(List patientAttributesDTO values.put("value", patientAttributesDTOS.get(i).getValue()); values.put("modified_date", AppConstants.dateAndTimeUtils.currentDateTime()); values.put("sync", "TRUE"); -// Logger.logD("pulldata", "datadumper" + values); db.insertWithOnConflict("tbl_patient_attribute", null, values, SQLiteDatabase.CONFLICT_REPLACE); } db.setTransactionSuccessful(); @@ -194,14 +189,13 @@ public boolean patientAttributes(List patientAttributesDTO throw new DAOException(e.getMessage(), e); } finally { db.endTransaction(); - AppConstants.sqliteDbCloseHelper.dbClose(db); } return isInserted; } public List getPatientAttributes(String patientuuid) throws DAOException { List patientAttributesList = new ArrayList<>(); - SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); + SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWriteDb(); db.beginTransaction(); try { String query = "SELECT * from tbl_patient_attribute WHERE patientuuid= '" + patientuuid + "'"; @@ -222,13 +216,13 @@ public List getPatientAttributes(String patientuuid) throws DAOExcept throw new DAOException(e.getMessage()); } finally { db.endTransaction(); - db.close(); + } return patientAttributesList; } public String getAttributesName(String attributeuuid) throws DAOException { - SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); + SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWriteDb(); db.beginTransaction(); String name = ""; try { @@ -247,7 +241,7 @@ public String getAttributesName(String attributeuuid) throws DAOException { throw new DAOException(e.getMessage()); } finally { db.endTransaction(); - db.close(); + } return name; } @@ -264,7 +258,6 @@ public boolean insertPatientAttributes(List patientAttribu values.put("value", patientAttributesDTOS.get(i).getValue()); values.put("modified_date", AppConstants.dateAndTimeUtils.currentDateTime()); values.put("sync", false); -// Logger.logD("pulldata", "datadumper" + values); db.insertWithOnConflict("tbl_patient_attribute", null, values, SQLiteDatabase.CONFLICT_REPLACE); } db.setTransactionSuccessful(); @@ -284,7 +277,7 @@ public boolean insertPatientAttributes(List patientAttribu public boolean patinetAttributeMaster(List patientAttributeTypeMasterDTOS) throws DAOException { boolean isInserted = true; - SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); + SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWriteDb(); db.beginTransaction(); try { ContentValues values = new ContentValues(); @@ -293,7 +286,6 @@ public boolean patinetAttributeMaster(List patien values.put("name", patientAttributeTypeMasterDTOS.get(i).getName()); values.put("modified_date", AppConstants.dateAndTimeUtils.currentDateTime()); values.put("sync", "TRUE"); -// Logger.logD("pulldata", "datadumper" + values); db.insertWithOnConflict("tbl_patient_attribute_master", null, values, SQLiteDatabase.CONFLICT_REPLACE); } db.setTransactionSuccessful(); @@ -303,7 +295,6 @@ public boolean patinetAttributeMaster(List patien throw new DAOException(e.getMessage(), e); } finally { db.endTransaction(); - AppConstants.sqliteDbCloseHelper.dbClose(db); } return isInserted; @@ -311,7 +302,7 @@ public boolean patinetAttributeMaster(List patien public String getUuidForAttribute(String attr) { String attributeUuid = ""; - SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); + SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWriteDb(); Cursor cursor = db.rawQuery("SELECT uuid FROM tbl_patient_attribute_master where name = ? COLLATE NOCASE", new String[]{attr}); if (cursor.getCount() != 0) { while (cursor.moveToNext()) { @@ -326,7 +317,7 @@ public String getUuidForAttribute(String attr) { public boolean updateOpemmrsId(String openmrsId, String synced, String uuid) throws DAOException { boolean isUpdated = true; Logger.logD("patinetdao", "updateopenmrs " + uuid + openmrsId + synced); - SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); + SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWriteDb(); db.beginTransaction(); ContentValues values = new ContentValues(); String whereclause = "uuid=?"; @@ -344,7 +335,7 @@ public boolean updateOpemmrsId(String openmrsId, String synced, String uuid) thr throw new DAOException(sql.getMessage()); } finally { db.endTransaction(); - db.close(); + } Intent intent = new Intent(IntelehealthApplication.getAppContext(), MyIntentService.class); @@ -354,7 +345,7 @@ public boolean updateOpemmrsId(String openmrsId, String synced, String uuid) thr public List unsyncedPatients() throws DAOException { List patientDTOList = new ArrayList<>(); - SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); + SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWriteDb(); db.beginTransaction(); try { Cursor idCursor = db.rawQuery("SELECT * FROM tbl_patient where (sync = ? OR sync=?) COLLATE NOCASE", new String[]{"0", "false"}); @@ -386,7 +377,7 @@ public List unsyncedPatients() throws DAOException { throw new DAOException(e); } finally { db.endTransaction(); - db.close(); + } return patientDTOList; @@ -396,7 +387,7 @@ public List unsyncedPatients() throws DAOException { public boolean updatePatientPhoto(String patientuuid, String profilePhotoPath) throws DAOException { boolean isUpdated = true; Logger.logD("patinetdao", "patientphoto " + patientuuid + profilePhotoPath); - SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); + SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWriteDb(); db.beginTransaction(); ContentValues values = new ContentValues(); String whereclause = "uuid=?"; @@ -414,7 +405,7 @@ public boolean updatePatientPhoto(String patientuuid, String profilePhotoPath) t throw new DAOException(sql.getMessage()); } finally { db.endTransaction(); - db.close(); + } return isUpdated; @@ -422,7 +413,7 @@ public boolean updatePatientPhoto(String patientuuid, String profilePhotoPath) t public String getOpenmrsId(String patientuuid) throws DAOException { String id = ""; - SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); + SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWriteDb(); db.beginTransaction(); try { Cursor cursor = db.rawQuery("SELECT openmrs_id FROM tbl_patient where uuid = ? COLLATE NOCASE", new String[]{patientuuid}); @@ -438,34 +429,11 @@ public String getOpenmrsId(String patientuuid) throws DAOException { throw new DAOException(s); } finally { db.endTransaction(); - db.close(); + } return id; } - public String getPatientPhonenumber(String patientUuid) throws DAOException { - String phonenumber = ""; - SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); - db.beginTransaction(); - try { - Cursor cursor = db.rawQuery("SELECT value FROM tbl_patient_attribute where patientuuid = ? AND person_attribute_type_uuid='14d4f066-15f5-102d-96e4-000c29c2a5d7' COLLATE NOCASE", new String[]{patientUuid}); - if (cursor.getCount() != 0) { - while (cursor.moveToNext()) { - phonenumber = cursor.getString(cursor.getColumnIndexOrThrow("value")); - } - } - cursor.close(); - db.setTransactionSuccessful(); - } catch (SQLException s) { - Crashlytics.getInstance().core.logException(s); - throw new DAOException(s); - } finally { - db.endTransaction(); - db.close(); - } - return phonenumber; - - } } diff --git a/app/src/main/java/io/intelehealth/client/database/dao/ProviderDAO.java b/app/src/main/java/io/intelehealth/client/database/dao/ProviderDAO.java old mode 100644 new mode 100755 index 7a4f433509..5f07359f05 --- a/app/src/main/java/io/intelehealth/client/database/dao/ProviderDAO.java +++ b/app/src/main/java/io/intelehealth/client/database/dao/ProviderDAO.java @@ -17,28 +17,15 @@ public class ProviderDAO { long createdRecordsCount = 0; - int updatecount = 0; -// private SQLiteDatabase db = null; public boolean insertProviders(List providerDTOS) throws DAOException { boolean isInserted = true; - SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); -// AppConstants.inteleHealthDatabaseHelper.onCreate(db); - ContentValues values = new ContentValues(); + SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWriteDb(); db.beginTransaction(); try { for (ProviderDTO provider : providerDTOS) { -// Cursor cursor = db.rawQuery("SELECT uuid FROM tbl_provider where uuid = ?", new String[]{provider.getUuid()}); -// if (cursor.getCount() != 0) { -// while (cursor.moveToNext()) { -// updateProviders(provider); -// } -// } else { -// Logger.logD("insert", "insert has to happen"); createProviders(provider, db); -// } -// AppConstants.sqliteDbCloseHelper.cursorClose(cursor); } db.setTransactionSuccessful(); } catch (SQLException e) { @@ -46,7 +33,7 @@ public boolean insertProviders(List providerDTOS) throws DAOExcepti throw new DAOException(e.getMessage(), e); } finally { db.endTransaction(); - AppConstants.sqliteDbCloseHelper.dbClose(db); + } return isInserted; @@ -56,11 +43,7 @@ private boolean createProviders(ProviderDTO provider, SQLiteDatabase db) throws boolean isCreated = true; ContentValues values = new ContentValues(); - -// db.beginTransaction(); try { -// for (ProviderDTO provider : providerDTOS) { -// Logger.logD("insert", "insert has to happen"); values.put("uuid", provider.getUuid()); values.put("identifier", provider.getIdentifier()); values.put("given_name", provider.getGivenName()); @@ -68,51 +51,18 @@ private boolean createProviders(ProviderDTO provider, SQLiteDatabase db) throws values.put("voided", provider.getVoided()); values.put("modified_date", AppConstants.dateAndTimeUtils.currentDateTime()); values.put("sync", "TRUE"); -// Logger.logD("pulldata", "datadumper" + values); createdRecordsCount = db.insertWithOnConflict("tbl_provider", null, values, SQLiteDatabase.CONFLICT_REPLACE); -// } -// db.setTransactionSuccessful(); -// Logger.logD("created records", "created records count" + createdRecordsCount); } catch (SQLException e) { isCreated = false; throw new DAOException(e.getMessage(), e); } finally { -// db.endTransaction(); } return isCreated; } - // private boolean updateProviders(ProviderDTO provider) throws DAOException { -// boolean isUpdated = true; -// -// ContentValues values = new ContentValues(); -// String selection = "uuid = ?"; -// db.beginTransaction(); -// try { -//// for (ProviderDTO provider : providerDTOS) { -//// Logger.logD("insert", "insert has to happen"); -// values.put("identifier", provider.getIdentifier()); -// values.put("given_name", provider.getGivenName()); -// values.put("family_name", provider.getFamilyName()); -// values.put("voided", provider.getVoided()); -// values.put("modified_date", AppConstants.dateAndTimeUtils.currentDateTime()); -// values.put("synced", "TRUE"); -//// Logger.logD("pulldata", "datadumper" + values); -// updatecount = db.updateWithOnConflict("tbl_provider", values, selection, new String[]{provider.getUuid()}, SQLiteDatabase.CONFLICT_REPLACE); -//// } -// db.setTransactionSuccessful(); -//// Logger.logD("updated", "updatedrecords count" + updatecount); -// } catch (SQLException e) { -// isUpdated = false; -// throw new DAOException(e.getMessage(), e); -// } finally { -// db.endTransaction(); -// } -// return isUpdated; -// } public List getProvidersList() throws DAOException { List providersList = new ArrayList<>(); - SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); + SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWriteDb(); db.beginTransaction(); try { String query = "select distinct a.uuid,a.given_name,a.family_name from tbl_provider a, tbl_encounter b , tbl_visit c where a.uuid=b.provider_uuid and b.visituuid=c.uuid and c.enddate is null"; @@ -130,7 +80,7 @@ public List getProvidersList() throws DAOException { throw new DAOException(s); } finally { db.endTransaction(); - db.close(); + } return providersList; @@ -138,7 +88,7 @@ public List getProvidersList() throws DAOException { public List getProvidersUuidList() throws DAOException { List providersList = new ArrayList<>(); - SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); + SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWriteDb(); db.beginTransaction(); try { String query = "select distinct a.uuid,a.given_name,a.family_name from tbl_provider a, tbl_encounter b , tbl_visit c where a.uuid=b.provider_uuid and b.visituuid=c.uuid and c.enddate is null"; @@ -156,7 +106,7 @@ public List getProvidersUuidList() throws DAOException { throw new DAOException(s); } finally { db.endTransaction(); - db.close(); + } return providersList; diff --git a/app/src/main/java/io/intelehealth/client/database/dao/PullDataDAO.java b/app/src/main/java/io/intelehealth/client/database/dao/PullDataDAO.java deleted file mode 100644 index 08a942d0c1..0000000000 --- a/app/src/main/java/io/intelehealth/client/database/dao/PullDataDAO.java +++ /dev/null @@ -1,264 +0,0 @@ -package io.intelehealth.client.database.dao; - -import android.content.Context; -import android.content.Intent; -import android.database.Cursor; -import android.database.sqlite.SQLiteDatabase; -import android.os.Build; -import android.support.v7.widget.DividerItemDecoration; -import android.support.v7.widget.LinearLayoutManager; -import android.util.Log; -import android.widget.Toast; - -import com.crashlytics.android.Crashlytics; -import com.google.gson.Gson; - -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import io.intelehealth.client.R; -import io.intelehealth.client.activities.activePatientsActivity.ActivePatientActivity; -import io.intelehealth.client.activities.activePatientsActivity.ActivePatientAdapter; -import io.intelehealth.client.app.AppConstants; -import io.intelehealth.client.app.IntelehealthApplication; -import io.intelehealth.client.database.InteleHealthDatabaseHelper; -import io.intelehealth.client.models.ActivePatientModel; -import io.intelehealth.client.models.Patient; -import io.intelehealth.client.models.dto.PatientDTO; -import io.intelehealth.client.models.dto.ResponseDTO; -import io.intelehealth.client.models.dto.VisitDTO; -import io.intelehealth.client.models.pushRequestApiCall.PushRequestApiCall; -import io.intelehealth.client.models.pushResponseApiCall.PushResponseApiCall; -import io.intelehealth.client.services.LastSyncIntentService; -import io.intelehealth.client.utilities.Logger; -import io.intelehealth.client.utilities.PatientsFrameJson; -import io.intelehealth.client.utilities.SessionManager; -import io.intelehealth.client.utilities.StringUtils; -import io.intelehealth.client.utilities.exception.DAOException; -import io.reactivex.Single; -import io.reactivex.android.schedulers.AndroidSchedulers; -import io.reactivex.observers.DisposableSingleObserver; -import io.reactivex.schedulers.Schedulers; -import retrofit2.Call; -import retrofit2.Callback; -import retrofit2.Response; - - -public class PullDataDAO { - - private SessionManager sessionManager = null; - - public static String TAG = PullDataDAO.class.getSimpleName(); - InteleHealthDatabaseHelper mDbHelper; - private SQLiteDatabase db; - - public boolean pullData(final Context context) { - - mDbHelper = new InteleHealthDatabaseHelper(context); - db = mDbHelper.getWritableDatabase(); - - sessionManager = new SessionManager(context); - String encoded = sessionManager.getEncoded(); -// 1eaa9a54-0fcb-4d5c-9ec7-501d2e5bcf2a - String url = "http://" + sessionManager.getServerUrl() + "/EMR-Middleware/webapi/pull/pulldata/" + sessionManager.getLocationUuid() + "/" + sessionManager.getPullExcutedTime(); - Call middleWarePullResponseCall = AppConstants.apiInterface.RESPONSE_DTO_CALL(url, "Basic " + encoded); - Logger.logD("Start pull request", "Started"); - middleWarePullResponseCall.enqueue(new Callback() { - @Override - public void onResponse(Call call, Response response) { - AppConstants.notificationUtils.showNotifications("syncBackground", "Syncing", IntelehealthApplication.getAppContext()); - if (response.body() != null && response.body().getData() != null) { - sessionManager.setPulled(response.body().getData().getPullexecutedtime()); -// sessionManager.setPullExcutedTime(response.body().getData().getPullexecutedtime()); - } - if (response.isSuccessful()) { - -// pullDataExecutedTime(response.body(), context); - SyncDAO syncDAO = new SyncDAO(); - boolean sync = false; - try { - sync = syncDAO.SyncData(response.body()); - } catch (DAOException e) { - Crashlytics.getInstance().core.logException(e); - } - if (sync) - AppConstants.notificationUtils.DownloadDone("Sync", "Successfully synced", IntelehealthApplication.getAppContext()); - else - AppConstants.notificationUtils.DownloadDone("Sync", "failed synced,You can try again", IntelehealthApplication.getAppContext()); - - if (response.body().getData() != null) { - triggerVisitNotification(response.body().getData().getVisitDTO()); - } - } - - Logger.logD("End Pull request", "Ended"); - sessionManager.setLastPulledDateTime(AppConstants.dateAndTimeUtils.currentDateTimeInHome()); - - Intent intent = new Intent(IntelehealthApplication.getAppContext(), LastSyncIntentService.class); - IntelehealthApplication.getAppContext().startService(intent); - } - - @Override - public void onFailure(Call call, Throwable t) { - Logger.logD("pull data", "exception" + t.getMessage()); - } - }); - sessionManager.setPullSyncFinished(true); - return true; - } - - private void triggerVisitNotification(List listVisitDTO) { - - List activePatientList = new ArrayList<>(); - getPatients(activePatientList); - - List visitDTO = new ArrayList<>(); - visitDTO.addAll(listVisitDTO); - - if (visitDTO != null) { - for (int i = 0; i < visitDTO.size(); i++) { - for (int j = 0; j < activePatientList.size(); j++) { - if (visitDTO.get(i).getPatientuuid().equalsIgnoreCase(activePatientList.get(j).getPatientuuid())) { - AppConstants.notificationUtils.DownloadDone(IntelehealthApplication.getAppContext().getResources().getString(R.string.patient) + " " + activePatientList.get(j).getFirst_name() + " " + activePatientList.get(j).getLast_name(), IntelehealthApplication.getAppContext().getResources().getString(R.string.has_a_new_prescription), IntelehealthApplication.getAppContext()); - } - } - } - } - } - - private void getPatients(List activePatientList) { - - String query = - "SELECT a.uuid, a.patientuuid, a.startdate, a.enddate, b.first_name, b.middle_name, b.last_name, b.date_of_birth,b.openmrs_id " + - "FROM tbl_visit a, tbl_patient b " + - "WHERE a.patientuuid = b.uuid " + - "AND a.enddate is NULL OR a.enddate='' GROUP BY a.uuid ORDER BY a.startdate ASC"; - final Cursor cursor = db.rawQuery(query, null); - if (cursor != null) { - if (cursor.moveToFirst()) { - do { - activePatientList.add(new ActivePatientModel( - cursor.getString(cursor.getColumnIndexOrThrow("uuid")), - cursor.getString(cursor.getColumnIndexOrThrow("patientuuid")), - cursor.getString(cursor.getColumnIndexOrThrow("startdate")), - cursor.getString(cursor.getColumnIndexOrThrow("enddate")), - cursor.getString(cursor.getColumnIndexOrThrow("openmrs_id")), - cursor.getString(cursor.getColumnIndexOrThrow("first_name")), - cursor.getString(cursor.getColumnIndexOrThrow("middle_name")), - cursor.getString(cursor.getColumnIndexOrThrow("last_name")), - cursor.getString(cursor.getColumnIndexOrThrow("date_of_birth")), - "" - )); - } while (cursor.moveToNext()); - } - } - cursor.close(); - } - - -// public void pullDataExecutedTime(final ResponseDTO responseDTO, final Context context) { -// class dataInserted extends AsyncTask { -//// private ProgressDialog dialog = new ProgressDialog(context); -// -// @Override -// protected Void doInBackground(Void... voids) { -// SyncDAO syncDAO = new SyncDAO(); -// try { -// syncDAO.SyncData(responseDTO); -// } catch (DAOException e) { -// Logger.logE("Dao exception", "exception", e); -// Crashlytics.getInstance().core.logException(e); -// } -// return null; -// } -// -// -// @Override -// protected void onPreExecute() { -//// this.dialog.setMessage("Please wait"); -//// this.dialog.setCancelable(false); -//// this.dialog.show(); -// } -// -// @Override -// protected void onPostExecute(Void aVoid) { -//// if (dialog.isShowing()) { -//// dialog.dismiss(); -//// } -// } -// } -// dataInserted dataInserted = new dataInserted(); -// dataInserted.execute(); -// -// } - - public boolean pushDataApi() { - sessionManager = new SessionManager(IntelehealthApplication.getAppContext()); - PatientsDAO patientsDAO = new PatientsDAO(); - VisitsDAO visitsDAO = new VisitsDAO(); - EncounterDAO encounterDAO = new EncounterDAO(); - - - PushRequestApiCall pushRequestApiCall; - PatientsFrameJson patientsFrameJson = new PatientsFrameJson(); - pushRequestApiCall = patientsFrameJson.frameJson(); - final boolean[] isSucess = {true}; - String encoded = sessionManager.getEncoded(); - Gson gson = new Gson(); - Logger.logD(TAG, "push request model" + gson.toJson(pushRequestApiCall)); - String url = "http://" + sessionManager.getServerUrl() + "/EMR-Middleware/webapi/push/pushdata"; -// push only happen if any one data exists. - if (!pushRequestApiCall.getVisits().isEmpty() || !pushRequestApiCall.getPersons().isEmpty() || !pushRequestApiCall.getPatients().isEmpty() || !pushRequestApiCall.getEncounters().isEmpty()) { - Single pushResponseApiCallObservable = AppConstants.apiInterface.PUSH_RESPONSE_API_CALL_OBSERVABLE(url, "Basic " + encoded, pushRequestApiCall); - pushResponseApiCallObservable.subscribeOn(Schedulers.io()) - .observeOn(AndroidSchedulers.mainThread()) - .subscribe(new DisposableSingleObserver() { - @Override - public void onSuccess(PushResponseApiCall pushResponseApiCall) { - Logger.logD(TAG, "success" + pushResponseApiCall); - for (int i = 0; i < pushResponseApiCall.getData().getPatientlist().size(); i++) { - try { - patientsDAO.updateOpemmrsId(pushResponseApiCall.getData().getPatientlist().get(i).getOpenmrsId(), pushResponseApiCall.getData().getPatientlist().get(i).getSyncd().toString(), pushResponseApiCall.getData().getPatientlist().get(i).getUuid()); - } catch (DAOException e) { - Crashlytics.getInstance().core.logException(e); - } - } - - for (int i = 0; i < pushResponseApiCall.getData().getVisitlist().size(); i++) { - try { - visitsDAO.updateVisitSync(pushResponseApiCall.getData().getVisitlist().get(i).getUuid(), pushResponseApiCall.getData().getVisitlist().get(i).getSyncd().toString()); - } catch (DAOException e) { - Crashlytics.getInstance().core.logException(e); - } - } - - for (int i = 0; i < pushResponseApiCall.getData().getEncounterlist().size(); i++) { - try { - encounterDAO.updateEncounterSync(pushResponseApiCall.getData().getEncounterlist().get(i).getSyncd().toString(), pushResponseApiCall.getData().getEncounterlist().get(i).getUuid()); - } catch (DAOException e) { - Crashlytics.getInstance().core.logException(e); - } - } - isSucess[0] = true; - sessionManager.setSyncFinished(true); - } - - @Override - public void onError(Throwable e) { - Logger.logD(TAG, "Onerror " + e.getMessage()); - isSucess[0] = false; - } - }); - sessionManager.setPullSyncFinished(true); - } - - return isSucess[0]; - } - -} - - - - diff --git a/app/src/main/java/io/intelehealth/client/database/dao/SyncDAO.java b/app/src/main/java/io/intelehealth/client/database/dao/SyncDAO.java old mode 100644 new mode 100755 index b0e1ca22af..2a9301d726 --- a/app/src/main/java/io/intelehealth/client/database/dao/SyncDAO.java +++ b/app/src/main/java/io/intelehealth/client/database/dao/SyncDAO.java @@ -1,17 +1,32 @@ package io.intelehealth.client.database.dao; -import android.database.sqlite.SQLiteDatabase; +import android.content.Context; +import android.content.Intent; +import com.crashlytics.android.Crashlytics; +import com.google.gson.Gson; + +import io.intelehealth.client.app.AppConstants; import io.intelehealth.client.app.IntelehealthApplication; import io.intelehealth.client.models.dto.ResponseDTO; +import io.intelehealth.client.models.pushRequestApiCall.PushRequestApiCall; +import io.intelehealth.client.models.pushResponseApiCall.PushResponseApiCall; +import io.intelehealth.client.services.LastSyncIntentService; import io.intelehealth.client.utilities.Logger; +import io.intelehealth.client.utilities.PatientsFrameJson; import io.intelehealth.client.utilities.SessionManager; import io.intelehealth.client.utilities.exception.DAOException; +import io.reactivex.Single; +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.observers.DisposableSingleObserver; +import io.reactivex.schedulers.Schedulers; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; public class SyncDAO { public static String TAG = "SyncDAO"; SessionManager sessionManager = null; - private SQLiteDatabase db = null; public boolean SyncData(ResponseDTO responseDTO) throws DAOException { boolean isSynced = true; @@ -29,19 +44,17 @@ public boolean SyncData(ResponseDTO responseDTO) throws DAOException { patientsDAO.patientAttributes(responseDTO.getData().getPatientAttributesDTO()); patientsDAO.patinetAttributeMaster(responseDTO.getData().getPatientAttributeTypeMasterDTO()); visitsDAO.insertVisit(responseDTO.getData().getVisitDTO()); -// visitsDAO.insertVisitAttrib(responseDTO.getData().getVisitAttributeList()); -// visitsDAO.insertVisitAttribType(responseDTO.getData().getVisitAttributeTypeList()); encounterDAO.insertEncounter(responseDTO.getData().getEncounterDTO()); obsDAO.insertObsTemp(responseDTO.getData().getObsDTO()); locationDAO.insertLocations(responseDTO.getData().getLocationDTO()); providerDAO.insertProviders(responseDTO.getData().getProviderlist()); - insertAfterPull(); Logger.logD(TAG, "Pull sync ended"); sessionManager.setPullExcutedTime(sessionManager.isPulled()); sessionManager.setFirstTimeSyncExecute(false); } catch (Exception e) { + Crashlytics.getInstance().core.logException(e); Logger.logE(TAG, "Exception", e); throw new DAOException(e.getMessage(), e); } @@ -50,19 +63,114 @@ public boolean SyncData(ResponseDTO responseDTO) throws DAOException { } - private boolean insertAfterPull() throws DAOException { - boolean isInserted = true; + public boolean pullData(final Context context) { + sessionManager = new SessionManager(context); + String encoded = sessionManager.getEncoded(); + String oldDate = sessionManager.getPullExcutedTime(); + String url = "http://" + sessionManager.getServerUrl() + ":8080/EMR-Middleware/webapi/pull/pulldata/" + sessionManager.getLocationUuid() + "/" + sessionManager.getPullExcutedTime(); + Call middleWarePullResponseCall = AppConstants.apiInterface.RESPONSE_DTO_CALL(url, "Basic " + encoded); + Logger.logD("Start pull request", "Started"); + middleWarePullResponseCall.enqueue(new Callback() { + @Override + public void onResponse(Call call, Response response) { + AppConstants.notificationUtils.showNotifications("syncBackground", "Syncing", 1, IntelehealthApplication.getAppContext()); + if (response.body() != null && response.body().getData() != null) { + sessionManager.setPulled(response.body().getData().getPullexecutedtime()); + } + if (response.isSuccessful()) { - BackgroundSyncDAO backgroundSyncDAO = new BackgroundSyncDAO(); - try { - backgroundSyncDAO.insertAfterPull(); + // SyncDAO syncDAO = new SyncDAO(); + boolean sync = false; + try { + sync = SyncData(response.body()); + } catch (DAOException e) { + Crashlytics.getInstance().core.logException(e); + } + if (sync) + AppConstants.notificationUtils.DownloadDone("sync", "Successfully synced", 1, IntelehealthApplication.getAppContext()); + else + AppConstants.notificationUtils.DownloadDone("sync", "failed synced,You can try again", 1, IntelehealthApplication.getAppContext()); - } catch (Exception e) { - Logger.logE(TAG, "Patients Exception", e); - throw new DAOException(e.getMessage(), e); - } + } + + Logger.logD("End Pull request", "Ended"); + sessionManager.setLastPulledDateTime(AppConstants.dateAndTimeUtils.currentDateTimeInHome()); - return isInserted; + Intent intent = new Intent(IntelehealthApplication.getAppContext(), LastSyncIntentService.class); + IntelehealthApplication.getAppContext().startService(intent); + } + @Override + public void onFailure(Call call, Throwable t) { + Logger.logD("pull data", "exception" + t.getMessage()); + } + }); + sessionManager.setPullSyncFinished(true); + return true; } + + public boolean pushDataApi() { + sessionManager = new SessionManager(IntelehealthApplication.getAppContext()); + PatientsDAO patientsDAO = new PatientsDAO(); + VisitsDAO visitsDAO = new VisitsDAO(); + EncounterDAO encounterDAO = new EncounterDAO(); + + + PushRequestApiCall pushRequestApiCall; + PatientsFrameJson patientsFrameJson = new PatientsFrameJson(); + pushRequestApiCall = patientsFrameJson.frameJson(); + final boolean[] isSucess = {true}; + String encoded = sessionManager.getEncoded(); + Gson gson = new Gson(); + Logger.logD(TAG, "push request model" + gson.toJson(pushRequestApiCall)); + String url = "http://" + sessionManager.getServerUrl() + ":8080/EMR-Middleware/webapi/push/pushdata"; +// push only happen if any one data exists. + if (!pushRequestApiCall.getVisits().isEmpty() || !pushRequestApiCall.getPersons().isEmpty() || !pushRequestApiCall.getPatients().isEmpty() || !pushRequestApiCall.getEncounters().isEmpty()) { + Single pushResponseApiCallObservable = AppConstants.apiInterface.PUSH_RESPONSE_API_CALL_OBSERVABLE(url, "Basic " + encoded, pushRequestApiCall); + pushResponseApiCallObservable.subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new DisposableSingleObserver() { + @Override + public void onSuccess(PushResponseApiCall pushResponseApiCall) { + Logger.logD(TAG, "success" + pushResponseApiCall); + for (int i = 0; i < pushResponseApiCall.getData().getPatientlist().size(); i++) { + try { + patientsDAO.updateOpemmrsId(pushResponseApiCall.getData().getPatientlist().get(i).getOpenmrsId(), pushResponseApiCall.getData().getPatientlist().get(i).getSyncd().toString(), pushResponseApiCall.getData().getPatientlist().get(i).getUuid()); + } catch (DAOException e) { + Crashlytics.getInstance().core.logException(e); + } + } + + for (int i = 0; i < pushResponseApiCall.getData().getVisitlist().size(); i++) { + try { + visitsDAO.updateVisitSync(pushResponseApiCall.getData().getVisitlist().get(i).getUuid(), pushResponseApiCall.getData().getVisitlist().get(i).getSyncd().toString()); + } catch (DAOException e) { + Crashlytics.getInstance().core.logException(e); + } + } + + for (int i = 0; i < pushResponseApiCall.getData().getEncounterlist().size(); i++) { + try { + encounterDAO.updateEncounterSync(pushResponseApiCall.getData().getEncounterlist().get(i).getSyncd().toString(), pushResponseApiCall.getData().getEncounterlist().get(i).getUuid()); + } catch (DAOException e) { + Crashlytics.getInstance().core.logException(e); + } + } + isSucess[0] = true; + sessionManager.setSyncFinished(true); + } + + @Override + public void onError(Throwable e) { + Logger.logD(TAG, "Onerror " + e.getMessage()); + isSucess[0] = false; + } + }); + sessionManager.setPullSyncFinished(true); + } + + return isSucess[0]; + } + + } diff --git a/app/src/main/java/io/intelehealth/client/database/dao/VisitSummaryDAO.java b/app/src/main/java/io/intelehealth/client/database/dao/VisitSummaryDAO.java deleted file mode 100644 index 8282e3ca7e..0000000000 --- a/app/src/main/java/io/intelehealth/client/database/dao/VisitSummaryDAO.java +++ /dev/null @@ -1,45 +0,0 @@ -package io.intelehealth.client.database.dao; - -import android.database.Cursor; -import android.database.sqlite.SQLiteDatabase; - -import io.intelehealth.client.utilities.SessionManager; - - -public class VisitSummaryDAO { - private SessionManager sessionManger; - - public String getVisitUUID(String visitID, SQLiteDatabase db) { - String visitUUID = ""; - String[] columnsToReturn = {"openmrs_visit_uuid"}; - String visitIDorderBy = "start_datetime"; - String visitIDSelection = "_id = ?"; - String[] visitIDArgs = {visitID}; - final Cursor visitIDCursor = db.query("visit", columnsToReturn, visitIDSelection, visitIDArgs, null, null, visitIDorderBy); - if (visitIDCursor != null && visitIDCursor.moveToFirst() && visitIDCursor.getCount() > 0) { - visitUUID = visitIDCursor.getString(visitIDCursor.getColumnIndexOrThrow("openmrs_visit_uuid")); - } - if (visitIDCursor != null) - visitIDCursor.close(); - if (visitUUID == null) - visitUUID = ""; - - return visitUUID; - } - - public String getEmergencyUUID(String visitID, SQLiteDatabase db) { - String visitUUID = ""; - String emergencyQuery = "select openmrs_visit_uuid from encounter where visit_id='" + visitID + "' and encounter_type='EMERGENCY'"; - final Cursor visitIDCursor = db.rawQuery(emergencyQuery, null); - if (visitIDCursor != null && visitIDCursor.moveToFirst() && visitIDCursor.getCount() > 0) { - visitUUID = visitIDCursor.getString(visitIDCursor.getColumnIndexOrThrow("openmrs_visit_uuid")); - } - if (visitIDCursor != null) - visitIDCursor.close(); - if (visitUUID == null) - visitUUID = ""; - - return visitUUID; - } - -} diff --git a/app/src/main/java/io/intelehealth/client/database/dao/VisitsDAO.java b/app/src/main/java/io/intelehealth/client/database/dao/VisitsDAO.java old mode 100644 new mode 100755 index e4037c3c75..250f53809c --- a/app/src/main/java/io/intelehealth/client/database/dao/VisitsDAO.java +++ b/app/src/main/java/io/intelehealth/client/database/dao/VisitsDAO.java @@ -13,9 +13,7 @@ import io.intelehealth.client.app.AppConstants; import io.intelehealth.client.models.dto.VisitAttributeDTO; -import io.intelehealth.client.models.dto.VisitAttributeTypeDTO; import io.intelehealth.client.models.dto.VisitDTO; -import io.intelehealth.client.models.pushRequestApiCall.Attribute; import io.intelehealth.client.utilities.DateAndTimeUtils; import io.intelehealth.client.utilities.Logger; import io.intelehealth.client.utilities.exception.DAOException; @@ -24,25 +22,15 @@ public class VisitsDAO { private long createdRecordsCount = 0; - private int updatecount = 0; public boolean insertVisit(List visitDTOS) throws DAOException { boolean isInserted = true; - SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); + SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWriteDb(); db.beginTransaction(); try { for (VisitDTO visit : visitDTOS) { -// Cursor cursor = db.rawQuery("SELECT uuid FROM tbl_visit where uuid = ?", new String[]{visit.getUuid()}); -// if (cursor.getCount() != 0) { -// while (cursor.moveToNext()) { -// updateVisits(visit); -// } -// } else { -// Logger.logD("insert", "insert has to happen"); createVisits(visit, db); -// } -// AppConstants.sqliteDbCloseHelper.cursorClose(cursor); } db.setTransactionSuccessful(); } catch (SQLException e) { @@ -50,7 +38,7 @@ public boolean insertVisit(List visitDTOS) throws DAOException { throw new DAOException(e.getMessage(), e); } finally { db.endTransaction(); - db.close(); + } return isInserted; @@ -58,13 +46,8 @@ public boolean insertVisit(List visitDTOS) throws DAOException { private boolean createVisits(VisitDTO visit, SQLiteDatabase db) throws DAOException { boolean isCreated = true; -// (SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase()) -// AppConstants.inteleHealthDatabaseHelper.onCreate(db); ContentValues values = new ContentValues(); -// db.beginTransaction(); try { -// for (VisitDTO visit : visitDTOS) { -// Logger.logD("insert", "insert has to happen"); values.put("uuid", visit.getUuid()); values.put("patientuuid", visit.getPatientuuid()); values.put("locationuuid", visit.getLocationuuid()); @@ -74,66 +57,11 @@ private boolean createVisits(VisitDTO visit, SQLiteDatabase db) throws DAOExcept values.put("enddate", visit.getEnddate()); values.put("modified_date", AppConstants.dateAndTimeUtils.currentDateTime()); values.put("sync", visit.getSyncd()); -// Logger.logD("pulldata", "datadumper" + values); createdRecordsCount = db.insertWithOnConflict("tbl_visit", null, values, SQLiteDatabase.CONFLICT_REPLACE); -// } -// db.setTransactionSuccessful(); -// Logger.logD("created records", "created records count" + createdRecordsCount); } catch (SQLException e) { isCreated = false; throw new DAOException(e.getMessage(), e); } finally { -// db.endTransaction(); - } - return isCreated; - } - - public boolean insertVisitAttribType(List visit) throws DAOException { - boolean isCreated = true; - SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); - ContentValues values = new ContentValues(); - db.beginTransaction(); - try { - for (VisitAttributeTypeDTO v : visit) { - values.put("uuid", v.getUuid()); - values.put("name", v.getName()); - values.put("retired", v.getRetired()); - values.put("modified_date", AppConstants.dateAndTimeUtils.currentDateTime()); - values.put("sync", "true"); - createdRecordsCount = db.insertWithOnConflict("tbl_visit_attribute_master", null, values, SQLiteDatabase.CONFLICT_REPLACE); - } - db.setTransactionSuccessful(); - } catch (SQLException e) { - isCreated = false; - throw new DAOException(e.getMessage(), e); - } finally { - db.endTransaction(); - } - return isCreated; - } - - public boolean insertVisitAttrib(List visits) throws DAOException { - boolean isCreated = true; - SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); - ContentValues values = new ContentValues(); - db.beginTransaction(); - try { - for (VisitAttributeDTO visit : visits) { - values.put("uuid", visit.getUuid()); - values.put("value", visit.getValue()); - values.put("visit_attribute_type_uuid", visit.getVisit_attribute_type_uuid()); - values.put("visituuid", visit.getVisit_uuid()); - values.put("modified_date", AppConstants.dateAndTimeUtils.currentDateTime()); - values.put("sync", "true"); - createdRecordsCount = db.insertWithOnConflict("tbl_visit_attribute", null, values, SQLiteDatabase.CONFLICT_REPLACE); - } - db.setTransactionSuccessful(); - Logger.logD("created records", "created records count" + createdRecordsCount); - } catch (SQLException e) { - isCreated = false; - throw new DAOException(e.getMessage(), e); - } finally { - db.endTransaction(); } return isCreated; } @@ -141,8 +69,7 @@ public boolean insertVisitAttrib(List visits) throws DAOExcep public boolean insertPatientToDB(VisitDTO visit) throws DAOException { boolean isCreated = true; long createdRecordsCount1 = 0; - SQLiteDatabase db = null; - db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); + SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWriteDb(); ContentValues values = new ContentValues(); db.beginTransaction(); List visitAttributeDTOS = new ArrayList<>(); @@ -171,7 +98,7 @@ public boolean insertPatientToDB(VisitDTO visit) throws DAOException { throw new DAOException(e.getMessage(), e); } finally { db.endTransaction(); - AppConstants.sqliteDbCloseHelper.dbClose(db); + } return isCreated; @@ -204,9 +131,9 @@ private boolean insertVisitAttribToDB(List visitAttributeDTOS public List unsyncedVisits() { List visitDTOList = new ArrayList<>(); - SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); + SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWriteDb(); db.beginTransaction(); - Cursor idCursor = db.rawQuery("SELECT * FROM tbl_visit where sync = ? OR sync=? COLLATE NOCASE", new String[]{"0", "false"}); + Cursor idCursor = db.rawQuery("SELECT * FROM tbl_visit where (sync = ? OR sync=?) COLLATE NOCASE", new String[]{"0", "false"}); VisitDTO visitDTO = new VisitDTO(); if (idCursor.getCount() != 0) { while (idCursor.moveToNext()) { @@ -224,7 +151,7 @@ public List unsyncedVisits() { idCursor.close(); db.setTransactionSuccessful(); db.endTransaction(); - db.close(); + return visitDTOList; } @@ -257,7 +184,7 @@ public List getAllVisits() { public boolean updateVisitSync(String uuid, String synced) throws DAOException { boolean isUpdated = true; Logger.logD("visitdao", "updatesynv visit " + uuid + synced); - SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); + SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWriteDb(); db.beginTransaction(); ContentValues values = new ContentValues(); String whereclause = "uuid=?"; @@ -273,7 +200,7 @@ public boolean updateVisitSync(String uuid, String synced) throws DAOException { throw new DAOException(sql.getMessage()); } finally { db.endTransaction(); - db.close(); + } @@ -284,7 +211,7 @@ public boolean updateVisitSync(String uuid, String synced) throws DAOException { public boolean updateVisitEnddate(String uuid, String enddate) throws DAOException { boolean isUpdated = true; Logger.logD("visitdao", "updatesynv visit " + uuid + enddate); - SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); + SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWriteDb(); db.beginTransaction(); ContentValues values = new ContentValues(); String whereclause = "uuid=?"; @@ -300,7 +227,7 @@ public boolean updateVisitEnddate(String uuid, String enddate) throws DAOExcepti throw new DAOException(sql.getMessage()); } finally { db.endTransaction(); - db.close(); + } @@ -309,7 +236,7 @@ public boolean updateVisitEnddate(String uuid, String enddate) throws DAOExcepti public String patientUuidByViistUuid(String visituuid) { String patientUuidByViistUuid = ""; - SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getReadableDatabase(); + SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWriteDb(); db.beginTransaction(); Cursor cursor = db.rawQuery("SELECT patientuuid FROM tbl_visit where uuid = ? ", new String[]{visituuid}); if (cursor.getCount() != 0) { @@ -320,95 +247,15 @@ public String patientUuidByViistUuid(String visituuid) { cursor.close(); db.setTransactionSuccessful(); db.endTransaction(); - db.close(); - return patientUuidByViistUuid; - } - - public List getVisitAttributes(String visitUuid) throws DAOException { - List visitAttribute = new ArrayList<>(); - SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); - db.beginTransaction(); - try { - String query = "SELECT * from tbl_visit_attribute WHERE visituuid= '" + visitUuid + "'"; - Cursor cursor = db.rawQuery(query, null, null); - Attribute attribute = new Attribute(); - if (cursor.moveToFirst()) { - while (!cursor.isAfterLast()) { - attribute = new Attribute(); - attribute.setAttributeType(cursor.getString(cursor.getColumnIndex("visit_attribute_type_uuid"))); - attribute.setValue(cursor.getString(cursor.getColumnIndex("value"))); - visitAttribute.add(attribute); - cursor.moveToNext(); - } - } - cursor.close(); - db.setTransactionSuccessful(); - } catch (SQLException e) { - throw new DAOException(e.getMessage()); - } finally { - db.endTransaction(); - db.close(); - } - return visitAttribute; - } - - public List getEmergencyVisitUuids() throws DAOException { - List emergencyVisits = new ArrayList<>(); - SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); - db.beginTransaction(); - try { - String query = "SELECT uuid from tbl_visit WHERE emergency= 'false' COLLATE NOCASE"; - Cursor cursor = db.rawQuery(query, null, null); - if (cursor.moveToFirst()) { - while (!cursor.isAfterLast()) { - emergencyVisits.add(cursor.getString(cursor.getColumnIndex("uuid"))); - cursor.moveToNext(); - } - } - cursor.close(); - db.setTransactionSuccessful(); - } catch (SQLException e) { - throw new DAOException(e.getMessage()); - } finally { - db.endTransaction(); - db.close(); - } - - return emergencyVisits; - } - public boolean isUpdatedEmergencyColumn(String visitUuid, boolean isemergency) throws DAOException { - boolean isUpdated = false; - int updatedcount = 0; - SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); - db.beginTransaction(); - ContentValues values = new ContentValues(); - String whereclause = "uuid=?"; - String[] whereargs = {visitUuid}; - try { - values.put("emergency", isemergency); - updatedcount = db.update("tbl_visit", values, whereclause, whereargs); - if (updatedcount != 0) - isUpdated = true; - Logger.logD("visit", "updated emergency" + updatedcount); - db.setTransactionSuccessful(); - } catch (SQLException sql) { - isUpdated = false; - Crashlytics.getInstance().core.logException(sql); - Logger.logD("visit", "updated emergency" + sql.getMessage()); - throw new DAOException(sql.getMessage()); - } finally { - db.endTransaction(); - db.close(); - } - return isUpdated; + return patientUuidByViistUuid; } public boolean isUpdatedDownloadColumn(String visitUuid, boolean isupdated) throws DAOException { boolean isUpdated = false; int updatedcount = 0; - SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); + SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWriteDb(); db.beginTransaction(); ContentValues values = new ContentValues(); String whereclause = "uuid=?"; @@ -427,7 +274,6 @@ public boolean isUpdatedDownloadColumn(String visitUuid, boolean isupdated) thro throw new DAOException(sql.getMessage()); } finally { db.endTransaction(); - db.close(); } return isUpdated; } @@ -435,7 +281,7 @@ public boolean isUpdatedDownloadColumn(String visitUuid, boolean isupdated) thro public String getDownloadedValue(String visituuid) throws DAOException { String isDownloaded = null; - SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); + SQLiteDatabase db = AppConstants.inteleHealthDatabaseHelper.getWriteDb(); db.beginTransaction(); try { @@ -452,7 +298,6 @@ public String getDownloadedValue(String visituuid) throws DAOException { throw new DAOException(e); } finally { db.endTransaction(); - db.close(); } return isDownloaded; } diff --git a/app/src/main/java/io/intelehealth/client/knowledgeEngine/Node.java b/app/src/main/java/io/intelehealth/client/knowledgeEngine/Node.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/knowledgeEngine/PhysicalExam.java b/app/src/main/java/io/intelehealth/client/knowledgeEngine/PhysicalExam.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/models/ActivePatientModel.java b/app/src/main/java/io/intelehealth/client/models/ActivePatientModel.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/models/DocumentObject.java b/app/src/main/java/io/intelehealth/client/models/DocumentObject.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/models/Identifier.java b/app/src/main/java/io/intelehealth/client/models/Identifier.java deleted file mode 100644 index 001516ac96..0000000000 --- a/app/src/main/java/io/intelehealth/client/models/Identifier.java +++ /dev/null @@ -1,41 +0,0 @@ -package io.intelehealth.client.models; - -/** - * Created by Dexter Barretto on 10/5/17. - * Github : @dbarretto - */ - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - -import java.util.List; - -public class Identifier { - - @SerializedName("identifiers") - @Expose - private List identifiers = null; - - /** - * No args constructor for use in serialization - */ - public Identifier() { - } - - /** - * @param identifiers - */ - public Identifier(List identifiers) { - super(); - this.identifiers = identifiers; - } - - public List getIdentifiers() { - return identifiers; - } - - public void setIdentifiers(List identifiers) { - this.identifiers = identifiers; - } - -} diff --git a/app/src/main/java/io/intelehealth/client/models/Link.java b/app/src/main/java/io/intelehealth/client/models/Link.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/models/Location.java b/app/src/main/java/io/intelehealth/client/models/Location.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/models/Patient.java b/app/src/main/java/io/intelehealth/client/models/Patient.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/models/PatientPhoto.java b/app/src/main/java/io/intelehealth/client/models/PatientPhoto.java deleted file mode 100644 index bc12374e90..0000000000 --- a/app/src/main/java/io/intelehealth/client/models/PatientPhoto.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. - */ - -package io.intelehealth.client.models; - - -import android.graphics.Bitmap; -import android.util.Base64; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - -import java.io.ByteArrayOutputStream; -import java.io.Serializable; - -public class PatientPhoto extends Resource implements Serializable { - @SerializedName("person") - @Expose - private String person; - - @SerializedName("base64EncodedImage") - @Expose - private String base64EncodedImage; - - public void setPhoto(Bitmap image) { - byte[] byteArray = bitmapToByteArray(image); - base64EncodedImage = Base64.encodeToString(byteArray, Base64.DEFAULT); - } - - public void setPerson(String person) { - this.person = person; - } - - private byte[] bitmapToByteArray(Bitmap image) { - ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); - image.compress(Bitmap.CompressFormat.PNG, 0, byteArrayOutputStream); - return byteArrayOutputStream.toByteArray(); - } -} diff --git a/app/src/main/java/io/intelehealth/client/models/PersonName.java b/app/src/main/java/io/intelehealth/client/models/PersonName.java deleted file mode 100644 index 0bdfb6e279..0000000000 --- a/app/src/main/java/io/intelehealth/client/models/PersonName.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * This Source Code Form is subject to the terms of the Mozilla Public License, - * v. 2.0. If a copy of the MPL was not distributed with this file, You can - * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under - * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. - * - * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS - * graphic logo is a trademark of OpenMRS Inc. - */ - -package io.intelehealth.client.models; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - -import java.io.Serializable; - -public class PersonName implements Serializable { - - @SerializedName("givenName") - @Expose - private String givenName; - @SerializedName("middleName") - @Expose - private String middleName; - @SerializedName("familyName") - @Expose - private String familyName; - - /** - * @return The givenName - */ - public String getGivenName() { - return givenName; - } - - /** - * @param givenName The givenName - */ - public void setGivenName(String givenName) { - this.givenName = givenName; - } - - /** - * @return The familyName - */ - public String getFamilyName() { - return familyName; - } - - /** - * @param familyName The familyName - */ - public void setFamilyName(String familyName) { - this.familyName = familyName; - } - - /** - * @return The middleName - */ - public String getMiddleName() { - return middleName; - } - - /** - * @param middleName The middleName - */ - public void setMiddleName(String middleName) { - this.middleName = middleName; - } - - - public String getNameString() { - if (middleName == null || middleName.equals("null")) - return givenName + " " + familyName; - else - return givenName + " " + middleName + " " + familyName; - } -} diff --git a/app/src/main/java/io/intelehealth/client/models/Resource.java b/app/src/main/java/io/intelehealth/client/models/Resource.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/models/Results.java b/app/src/main/java/io/intelehealth/client/models/Results.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/models/TodayPatientModel.java b/app/src/main/java/io/intelehealth/client/models/TodayPatientModel.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/models/VisitUuidModel.java b/app/src/main/java/io/intelehealth/client/models/VisitUuidModel.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/models/VitalsObject.java b/app/src/main/java/io/intelehealth/client/models/VitalsObject.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/models/WebResponse.java b/app/src/main/java/io/intelehealth/client/models/WebResponse.java deleted file mode 100644 index 51c5bdcdf1..0000000000 --- a/app/src/main/java/io/intelehealth/client/models/WebResponse.java +++ /dev/null @@ -1,39 +0,0 @@ -package io.intelehealth.client.models; - -/** - * Container for response code and string from server. - *

- * Created by Amal Afroz Alam on 12, August, 2016. - * Contact me: contact@amal.io - */ - -public class WebResponse { - - int responseCode = 1000; - String responseString = ""; - String responseObject = ""; - - public int getResponseCode() { - return responseCode; - } - - public void setResponseCode(int responseCode) { - this.responseCode = responseCode; - } - - public String getResponseString() { - return responseString; - } - - public void setResponseString(String responseString) { - this.responseString = responseString; - } - - public String getResponseObject() { - return responseObject; - } - - public void setResponseObject(String responseObject) { - this.responseObject = responseObject; - } -} diff --git a/app/src/main/java/io/intelehealth/client/models/download/Download.java b/app/src/main/java/io/intelehealth/client/models/download/Download.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/models/dto/Data.java b/app/src/main/java/io/intelehealth/client/models/dto/Data.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/models/dto/EncounterDTO.java b/app/src/main/java/io/intelehealth/client/models/dto/EncounterDTO.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/models/dto/LocationDTO.java b/app/src/main/java/io/intelehealth/client/models/dto/LocationDTO.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/models/dto/ObsDTO.java b/app/src/main/java/io/intelehealth/client/models/dto/ObsDTO.java old mode 100644 new mode 100755 index 7c7fbe4a4c..241137c1e0 --- a/app/src/main/java/io/intelehealth/client/models/dto/ObsDTO.java +++ b/app/src/main/java/io/intelehealth/client/models/dto/ObsDTO.java @@ -18,9 +18,12 @@ public class ObsDTO { @SerializedName("value") @Expose private String value; + @SerializedName("obsServerModifiedDate") + @Expose + private String obsServerModifiedDate; @SerializedName("creator") @Expose - private Integer creator; + private String creator; @SerializedName("voided") @Expose private Integer voided; @@ -57,11 +60,11 @@ public void setValue(String value) { this.value = value; } - public Integer getCreator() { + public String getCreator() { return creator; } - public void setCreator(Integer creator) { + public void setCreator(String creator) { this.creator = creator; } @@ -73,4 +76,11 @@ public void setVoided(Integer voided) { this.voided = voided; } + public String getObsServerModifiedDate() { + return obsServerModifiedDate; + } + + public void setObsServerModifiedDate(String obsServerModifiedDate) { + this.obsServerModifiedDate = obsServerModifiedDate; + } } diff --git a/app/src/main/java/io/intelehealth/client/models/dto/PatientAttributeTypeMasterDTO.java b/app/src/main/java/io/intelehealth/client/models/dto/PatientAttributeTypeMasterDTO.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/models/dto/PatientAttributesDTO.java b/app/src/main/java/io/intelehealth/client/models/dto/PatientAttributesDTO.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/models/dto/PatientDTO.java b/app/src/main/java/io/intelehealth/client/models/dto/PatientDTO.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/models/dto/ProviderDTO.java b/app/src/main/java/io/intelehealth/client/models/dto/ProviderDTO.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/models/dto/ResponseDTO.java b/app/src/main/java/io/intelehealth/client/models/dto/ResponseDTO.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/models/dto/VisitAttributeDTO.java b/app/src/main/java/io/intelehealth/client/models/dto/VisitAttributeDTO.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/models/dto/VisitAttributeTypeDTO.java b/app/src/main/java/io/intelehealth/client/models/dto/VisitAttributeTypeDTO.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/models/dto/VisitDTO.java b/app/src/main/java/io/intelehealth/client/models/dto/VisitDTO.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/models/loginModel/Link.java b/app/src/main/java/io/intelehealth/client/models/loginModel/Link.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/models/loginModel/Link_.java b/app/src/main/java/io/intelehealth/client/models/loginModel/Link_.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/models/loginModel/Link__.java b/app/src/main/java/io/intelehealth/client/models/loginModel/Link__.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/models/loginModel/Link___.java b/app/src/main/java/io/intelehealth/client/models/loginModel/Link___.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/models/loginModel/LoginModel.java b/app/src/main/java/io/intelehealth/client/models/loginModel/LoginModel.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/models/loginModel/Person.java b/app/src/main/java/io/intelehealth/client/models/loginModel/Person.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/models/loginModel/Privilege.java b/app/src/main/java/io/intelehealth/client/models/loginModel/Privilege.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/models/loginModel/Role.java b/app/src/main/java/io/intelehealth/client/models/loginModel/Role.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/models/loginModel/User.java b/app/src/main/java/io/intelehealth/client/models/loginModel/User.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/models/loginModel/UserProperties.java b/app/src/main/java/io/intelehealth/client/models/loginModel/UserProperties.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/models/loginProviderModel/Link.java b/app/src/main/java/io/intelehealth/client/models/loginProviderModel/Link.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/models/loginProviderModel/LoginProviderModel.java b/app/src/main/java/io/intelehealth/client/models/loginProviderModel/LoginProviderModel.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/models/loginProviderModel/Result.java b/app/src/main/java/io/intelehealth/client/models/loginProviderModel/Result.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/models/pushRequestApiCall/Address.java b/app/src/main/java/io/intelehealth/client/models/pushRequestApiCall/Address.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/models/pushRequestApiCall/Attribute.java b/app/src/main/java/io/intelehealth/client/models/pushRequestApiCall/Attribute.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/models/pushRequestApiCall/Encounter.java b/app/src/main/java/io/intelehealth/client/models/pushRequestApiCall/Encounter.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/models/pushRequestApiCall/EncounterProvider.java b/app/src/main/java/io/intelehealth/client/models/pushRequestApiCall/EncounterProvider.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/models/pushRequestApiCall/Identifier.java b/app/src/main/java/io/intelehealth/client/models/pushRequestApiCall/Identifier.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/models/pushRequestApiCall/Name.java b/app/src/main/java/io/intelehealth/client/models/pushRequestApiCall/Name.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/models/pushRequestApiCall/Ob.java b/app/src/main/java/io/intelehealth/client/models/pushRequestApiCall/Ob.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/models/pushRequestApiCall/Patient.java b/app/src/main/java/io/intelehealth/client/models/pushRequestApiCall/Patient.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/models/pushRequestApiCall/Person.java b/app/src/main/java/io/intelehealth/client/models/pushRequestApiCall/Person.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/models/pushRequestApiCall/PushRequestApiCall.java b/app/src/main/java/io/intelehealth/client/models/pushRequestApiCall/PushRequestApiCall.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/models/pushRequestApiCall/Visit.java b/app/src/main/java/io/intelehealth/client/models/pushRequestApiCall/Visit.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/models/pushResponseApiCall/Data.java b/app/src/main/java/io/intelehealth/client/models/pushResponseApiCall/Data.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/models/pushResponseApiCall/Encounterlist.java b/app/src/main/java/io/intelehealth/client/models/pushResponseApiCall/Encounterlist.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/models/pushResponseApiCall/Patientlist.java b/app/src/main/java/io/intelehealth/client/models/pushResponseApiCall/Patientlist.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/models/pushResponseApiCall/PersonList.java b/app/src/main/java/io/intelehealth/client/models/pushResponseApiCall/PersonList.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/models/pushResponseApiCall/PushResponseApiCall.java b/app/src/main/java/io/intelehealth/client/models/pushResponseApiCall/PushResponseApiCall.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/models/pushResponseApiCall/Visitlist.java b/app/src/main/java/io/intelehealth/client/models/pushResponseApiCall/Visitlist.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/networkApiCalls/ApiClient.java b/app/src/main/java/io/intelehealth/client/networkApiCalls/ApiClient.java old mode 100644 new mode 100755 index c649fea482..4f9a50d658 --- a/app/src/main/java/io/intelehealth/client/networkApiCalls/ApiClient.java +++ b/app/src/main/java/io/intelehealth/client/networkApiCalls/ApiClient.java @@ -3,8 +3,6 @@ import java.util.concurrent.TimeUnit; -import io.intelehealth.client.app.IntelehealthApplication; -import io.intelehealth.client.utilities.SessionManager; import okhttp3.OkHttpClient; import okhttp3.logging.HttpLoggingInterceptor; import retrofit2.Retrofit; @@ -17,26 +15,12 @@ public class ApiClient { private static OkHttpClient.Builder client = new OkHttpClient.Builder(); private static String apiBaseUrl = "http://openmrs.intelehealth.io"; private static Retrofit retrofit; - SessionManager sessionManager = new SessionManager(IntelehealthApplication.getAppContext()); private static Retrofit.Builder builder = new Retrofit.Builder() .addConverterFactory(GsonConverterFactory.create()) .baseUrl(apiBaseUrl) .addCallAdapterFactory(RxJava2CallAdapterFactory.create()); -// public static Retrofit getApiClient() { -// -// if (retrofit == null) { -// -// retrofit = new Retrofit.Builder() -// .baseUrl(apiBaseUrl) -// .client(client.build()) -// .addConverterFactory(GsonConverterFactory.create()) -// .addCallAdapterFactory(RxJava2CallAdapterFactory.create()) -// .build(); -// } -// return retrofit; -// } public static void changeApiBaseUrl(String newApiBaseUrl) { apiBaseUrl = newApiBaseUrl; @@ -50,7 +34,7 @@ public static void changeApiBaseUrl(String newApiBaseUrl) { public static S createService(Class serviceClass) { HttpLoggingInterceptor loggingInterceptor = new HttpLoggingInterceptor(); - loggingInterceptor.setLevel(HttpLoggingInterceptor.Level.BODY); + loggingInterceptor.setLevel(HttpLoggingInterceptor.Level.NONE); client.addInterceptor(loggingInterceptor); client.connectTimeout(70, TimeUnit.SECONDS); client.readTimeout(70, TimeUnit.SECONDS); diff --git a/app/src/main/java/io/intelehealth/client/networkApiCalls/ApiInterface.java b/app/src/main/java/io/intelehealth/client/networkApiCalls/ApiInterface.java index 11efa1079b..d3559bcb69 100644 --- a/app/src/main/java/io/intelehealth/client/networkApiCalls/ApiInterface.java +++ b/app/src/main/java/io/intelehealth/client/networkApiCalls/ApiInterface.java @@ -1,7 +1,6 @@ package io.intelehealth.client.networkApiCalls; -import io.intelehealth.client.models.DownloadMindMapRes; import io.intelehealth.client.models.Location; import io.intelehealth.client.models.ObsImageModel.ObsJsonResponse; import io.intelehealth.client.models.ObsImageModel.ObsPushDTO; @@ -34,15 +33,6 @@ public interface ApiInterface { @GET("location?tag=Login%20Location") Observable> LOCATION_OBSERVABLE(@Query("v") String representation); - @GET("/api/mindmap/download") - Observable DOWNLOAD_MIND_MAP_RES_OBSERVABLE(@Query("key") String licenseKey); - -// @GET("visit") -// Call GETPATIENT(@Query("patient") String patientUUID, @Header("Authorization") String authHeader); -// -// -// @GET -// Call VISIT_RESPONSEMODEL_CALL(@Url String url, @Header("Authorization") String authHeader); @DELETE Call DELETE_ENCOUNTER(@Url String url, diff --git a/app/src/main/java/io/intelehealth/client/services/DownloadProtocolsTask.java b/app/src/main/java/io/intelehealth/client/services/DownloadProtocolsTask.java index 546e1add0f..d983aa8fb1 100644 --- a/app/src/main/java/io/intelehealth/client/services/DownloadProtocolsTask.java +++ b/app/src/main/java/io/intelehealth/client/services/DownloadProtocolsTask.java @@ -224,9 +224,10 @@ protected void onPostExecute(String response) { } else { File engines_dir = new File(activity.getFilesDir().getAbsolutePath(), AppConstants.JSON_FOLDER); if (engines_dir.exists()) deleteFolder(engines_dir); - if (sessionManager.getLicenseKey().contains("licensekey")) + if (sessionManager.getLicenseKey() != null) sessionManager.deleteLicensekey(); Toast.makeText(IntelehealthApplication.getAppContext(), "Error downloading protocols", Toast.LENGTH_LONG).show(); + } if (mProgress != null && mProgress.isShowing()) { try { @@ -246,7 +247,7 @@ private List downloadMindMapList(String licensekey) { try { publishProgress("progress", "Downloading Mindmap List"); //Download List of Protocols Available - String servStr = "http://" + sessionManager.getMindMapServerUrl() + ":1337/parse/functions/downloadMindMapList"; + String servStr = "http://" + sessionManager.getMindMapServerUrl() + "/parse/functions/downloadMindMapList"; URL url = new URL(servStr); Log.i("GetMMList", servStr); byte[] mmListRequestBytes = mmListRequest.getBytes(StandardCharsets.UTF_8); @@ -294,7 +295,8 @@ private List downloadMindMapList(String licensekey) { publishProgress("toast", jsonObject.get("error").toString()); } } else { - Toast.makeText(IntelehealthApplication.getAppContext(), "Error Downloading Mindmap List", Toast.LENGTH_LONG).show(); + + Toast.makeText(IntelehealthApplication.getAppContext(), "Error Downloadind Mindmap List", Toast.LENGTH_LONG).show(); } @@ -322,7 +324,7 @@ private String downloadMindMap(String licensekey, Mindmap mindmap) { try { publishProgress("progress", "Downloading Mindmap " + mindmap.name); //Download List of Protocols Available - String servStr = "http://" + sessionManager.getMindMapServerUrl() + ":1337/parse/functions/downloadMindMap"; + String servStr = "http://" + sessionManager.getMindMapServerUrl() + "/parse/functions/downloadMindMap"; URL url = new URL(servStr); Log.i("GetMM", servStr); byte[] mmListRequestBytes = mmListRequest.getBytes(StandardCharsets.UTF_8); diff --git a/app/src/main/java/io/intelehealth/client/services/DownloadService.java b/app/src/main/java/io/intelehealth/client/services/DownloadService.java old mode 100644 new mode 100755 index cc85312313..4f9ca72b51 --- a/app/src/main/java/io/intelehealth/client/services/DownloadService.java +++ b/app/src/main/java/io/intelehealth/client/services/DownloadService.java @@ -35,14 +35,8 @@ public class DownloadService extends IntentService { UrlModifiers urlModifiers = new UrlModifiers(); ObsDAO obsDAO = new ObsDAO(); SessionManager sessionManager = null; - // private String patientUuid; -// private String visitUuid; -// private String encounterVitals; private String encounterAdultIntials; private int totalFileSize; - private String imgPrefix = "AD"; - final private String imageAD = "Additional Documents"; - final private String imagePE = "Physical Exam"; public String baseDir = ""; public String ImageType = ""; public DownloadService() { @@ -53,17 +47,10 @@ public DownloadService() { @Override protected void onHandleIntent(Intent intent) { if (intent != null) { -// patientUuid = intent.getStringExtra("patientUuid"); -// visitUuid = intent.getStringExtra("visitUuid"); -// encounterVitals = intent.getStringExtra("encounterUuidVitals"); encounterAdultIntials = intent.getStringExtra("encounterUuidAdultIntial"); ImageType = intent.getStringExtra("ImageType"); } - AppConstants.notificationUtils.showNotificationProgress("Download", "Downloading File", IntelehealthApplication.getAppContext(), 0); -// if (ImageType.equalsIgnoreCase(UuidDictionary.COMPLEX_IMAGE_AD)) -// baseDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES).getAbsolutePath() + File.separator + "Patient Images" + File.separator + patientUuid + File.separator + visitUuid + File.separator + imageAD + File.separator; -// else -// baseDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES).getAbsolutePath() + File.separator + "Patient Images" + File.separator + patientUuid + File.separator + visitUuid + File.separator + imagePE + File.separator; + AppConstants.notificationUtils.showNotificationProgress("Download", "Downloading File", 4, IntelehealthApplication.getAppContext(), 0); baseDir = AppConstants.IMAGE_PATH; initDownload(ImageType); @@ -75,19 +62,11 @@ private void initDownload(String ImageType) { String url = ""; List imageObsList = new ArrayList<>(); imageObsList = obsDAO.getImageStrings(ImageType, encounterAdultIntials); -// String imageType = ""; -// if (ImageType.equalsIgnoreCase(UuidDictionary.COMPLEX_IMAGE_AD)) -// imageType = "AD"; -// else -// imageType = "PE"; if (imageObsList.size() == 0) - AppConstants.notificationUtils.DownloadDone("Download", "No Images to Download", IntelehealthApplication.getAppContext()); + AppConstants.notificationUtils.DownloadDone("Download", "No Images to Download", 4, IntelehealthApplication.getAppContext()); for (int i = 0; i < imageObsList.size(); i++) { url = urlModifiers.obsImageUrl(imageObsList.get(i)); Observable downloadobs = AppConstants.apiInterface.OBS_IMAGE_DOWNLOAD(url, "Basic " + sessionManager.getEncoded()); - int finalI = i; -// String finalImageType = imageType; - List finalImageObsList = imageObsList; int finalI1 = i; List finalImageObsList1 = imageObsList; downloadobs.subscribeOn(Schedulers.io()) @@ -169,9 +148,6 @@ private void downloadFile(ResponseBody body, String imageuuid) throws IOExceptio private void sendNotification(Download download) { sendIntent(download); -// notificationBuilder.setProgress(100,download.getProgress(),false); -// notificationBuilder.setContentText("Downloading file "+ download.getCurrentFileSize() +"/"+totalFileSize +" MB"); -// notificationManager.notify(0, notificationBuilder.build()); } private void sendIntent(Download download) { @@ -195,18 +171,10 @@ private void onDownloadComplete() { download.setProgress(100); sendIntent(download); - AppConstants.notificationUtils.showNotificationProgress("Download", "File Downloaded", IntelehealthApplication.getAppContext(), 100); + AppConstants.notificationUtils.showNotificationProgress("Download", "File Downloaded", 4, IntelehealthApplication.getAppContext(), 100); -// notificationManager.cancel(0); -// notificationBuilder.setProgress(0,0,false); -// notificationBuilder.setContentText("File Downloaded"); -// notificationManager.notify(0, notificationBuilder.build()); } - @Override - public void onTaskRemoved(Intent rootIntent) { -// notificationManager.cancel(0); - } } diff --git a/app/src/main/java/io/intelehealth/client/services/DownloadUtils.java b/app/src/main/java/io/intelehealth/client/services/DownloadUtils.java deleted file mode 100644 index a7e2475ee7..0000000000 --- a/app/src/main/java/io/intelehealth/client/services/DownloadUtils.java +++ /dev/null @@ -1,16 +0,0 @@ -package io.intelehealth.client.services; - -public class DownloadUtils { - - protected String getStringByteSize(int size) { - if (size > 1024 * 1024) //mega - { - return String.format("%.1f MB", size / (float) (1024 * 1024)); - } else if (size > 1024) //kilo - { - return String.format("%.1f KB", size / 1024.0f); - } else { - return String.format("%d B"); - } - } -} diff --git a/app/src/main/java/io/intelehealth/client/services/LastSyncIntentService.java b/app/src/main/java/io/intelehealth/client/services/LastSyncIntentService.java old mode 100644 new mode 100755 index 10ee98dcb9..9986c168a1 --- a/app/src/main/java/io/intelehealth/client/services/LastSyncIntentService.java +++ b/app/src/main/java/io/intelehealth/client/services/LastSyncIntentService.java @@ -15,9 +15,6 @@ public LastSyncIntentService() { /** * Creates an IntentService. Invoked by your subclass's constructor. */ -// public LastSyncIntentService(String name) { -// super(name); -// } @Override protected void onHandleIntent(Intent intent) { try { diff --git a/app/src/main/java/io/intelehealth/client/services/MyIntentService.java b/app/src/main/java/io/intelehealth/client/services/MyIntentService.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/services/RunAfterBootService.java b/app/src/main/java/io/intelehealth/client/services/RunAfterBootService.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/services/UpdateDownloadPrescriptionService.java b/app/src/main/java/io/intelehealth/client/services/UpdateDownloadPrescriptionService.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/services/firebase_services/MyFirebaseInstanceIdService.java b/app/src/main/java/io/intelehealth/client/services/firebase_services/MyFirebaseInstanceIdService.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/services/firebase_services/MyFirebaseMessagingService.java b/app/src/main/java/io/intelehealth/client/services/firebase_services/MyFirebaseMessagingService.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/syncModule/BootCompleteReceiver.java b/app/src/main/java/io/intelehealth/client/syncModule/BootCompleteReceiver.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/syncModule/SyncUtils.java b/app/src/main/java/io/intelehealth/client/syncModule/SyncUtils.java old mode 100644 new mode 100755 index ee44e41b99..5585a7e9e0 --- a/app/src/main/java/io/intelehealth/client/syncModule/SyncUtils.java +++ b/app/src/main/java/io/intelehealth/client/syncModule/SyncUtils.java @@ -1,22 +1,26 @@ package io.intelehealth.client.syncModule; import android.content.Intent; +import android.os.Handler; import io.intelehealth.client.app.IntelehealthApplication; import io.intelehealth.client.database.dao.ImagesPushDAO; -import io.intelehealth.client.database.dao.PullDataDAO; +import io.intelehealth.client.database.dao.SyncDAO; import io.intelehealth.client.services.UpdateDownloadPrescriptionService; +import io.intelehealth.client.utilities.Logger; import io.intelehealth.client.utilities.NotificationUtils; public class SyncUtils { + private static final String TAG = SyncUtils.class.getSimpleName(); + public void syncBackground() { - PullDataDAO pullDataDAO = new PullDataDAO(); + SyncDAO syncDAO = new SyncDAO(); ImagesPushDAO imagesPushDAO = new ImagesPushDAO(); - pullDataDAO.pushDataApi(); - pullDataDAO.pullData(IntelehealthApplication.getAppContext()); + syncDAO.pushDataApi(); + syncDAO.pullData(IntelehealthApplication.getAppContext()); imagesPushDAO.patientProfileImagesPush(); imagesPushDAO.obsImagesPush(); @@ -32,14 +36,28 @@ public void syncBackground() { public boolean syncForeground() { boolean isSynced = false; - PullDataDAO pullDataDAO = new PullDataDAO(); + SyncDAO syncDAO = new SyncDAO(); ImagesPushDAO imagesPushDAO = new ImagesPushDAO(); + Logger.logD(TAG, "Push Started"); + isSynced = syncDAO.pushDataApi(); + Logger.logD(TAG, "Push ended"); + - isSynced = pullDataDAO.pushDataApi(); - isSynced = pullDataDAO.pullData(IntelehealthApplication.getAppContext()); +// need to add delay for pulling the obs correctly + final Handler handler = new Handler(); + handler.postDelayed(new Runnable() { + @Override + public void run() { + Logger.logD(TAG, "Pull Started"); + syncDAO.pullData(IntelehealthApplication.getAppContext()); + Logger.logD(TAG, "Pull ended"); + } + }, 3000); imagesPushDAO.patientProfileImagesPush(); + imagesPushDAO.obsImagesPush(); + imagesPushDAO.deleteObsImage(); Intent intent = new Intent(IntelehealthApplication.getAppContext(), UpdateDownloadPrescriptionService.class); diff --git a/app/src/main/java/io/intelehealth/client/syncModule/SyncWorkManager.java b/app/src/main/java/io/intelehealth/client/syncModule/SyncWorkManager.java old mode 100644 new mode 100755 index bb2445efa3..890c04ea93 --- a/app/src/main/java/io/intelehealth/client/syncModule/SyncWorkManager.java +++ b/app/src/main/java/io/intelehealth/client/syncModule/SyncWorkManager.java @@ -11,8 +11,8 @@ public class SyncWorkManager extends Worker { - SessionManager sessionManager = null; - String TAG = SyncWorkManager.class.getSimpleName(); + private SessionManager sessionManager = null; + private String TAG = SyncWorkManager.class.getSimpleName(); public SyncWorkManager(@NonNull Context context, @NonNull WorkerParameters workerParams) { super(context, workerParams); @@ -22,29 +22,8 @@ public SyncWorkManager(@NonNull Context context, @NonNull WorkerParameters worke @NonNull @Override public Result doWork() { - Context applicationContext = getApplicationContext(); Logger.logD(TAG, "result job"); -// PullDataDAO pullDataDAO = new PullDataDAO(); -// ImagesPushDAO imagesPushDAO = new ImagesPushDAO(); -// -//// if (pull) -//// sendNotification("syncBackground", "Synced Data"); -//// else -//// sendNotification("syncBackground", "failed to syncBackground"); -// -// pullDataDAO.pushDataApi(); -// -//// if (push) -//// sendNotification("syncBackground", "Synced Data"); -//// else -//// sendNotification("syncBackground", "failed to syncBackground"); -//// -// -// imagesPushDAO.patientProfileImagesPush(); -// imagesPushDAO.obsImagesPush(); -// -// pullDataDAO.pullData(applicationContext); SyncUtils syncUtils = new SyncUtils(); syncUtils.syncBackground(); diff --git a/app/src/main/java/io/intelehealth/client/utilities/AdminPassword.java b/app/src/main/java/io/intelehealth/client/utilities/AdminPassword.java old mode 100644 new mode 100755 index 9cf33c26c8..e522e5419b --- a/app/src/main/java/io/intelehealth/client/utilities/AdminPassword.java +++ b/app/src/main/java/io/intelehealth/client/utilities/AdminPassword.java @@ -42,9 +42,7 @@ public void setUp(String password) { String hash = null; try { hash = StringEncryption.convertToSHA256(random_salt + password); - } catch (NoSuchAlgorithmException e) { - Crashlytics.getInstance().core.logException(e); - } catch (UnsupportedEncodingException e) { + } catch (NoSuchAlgorithmException | UnsupportedEncodingException e) { Crashlytics.getInstance().core.logException(e); } SharedPreferences.Editor editor = mSharedPreference.edit(); @@ -71,9 +69,7 @@ public boolean login(String password) { String hash = null; try { hash = StringEncryption.convertToSHA256(stored_salt + password); - } catch (NoSuchAlgorithmException e) { - Crashlytics.getInstance().core.logException(e); - } catch (UnsupportedEncodingException e) { + } catch (NoSuchAlgorithmException | UnsupportedEncodingException e) { Crashlytics.getInstance().core.logException(e); } diff --git a/app/src/main/java/io/intelehealth/client/utilities/ApplicationUtility.java b/app/src/main/java/io/intelehealth/client/utilities/ApplicationUtility.java deleted file mode 100644 index d6cd085fff..0000000000 --- a/app/src/main/java/io/intelehealth/client/utilities/ApplicationUtility.java +++ /dev/null @@ -1,29 +0,0 @@ -package io.intelehealth.client.utilities; - -import android.content.Context; -import android.net.ConnectivityManager; -import android.net.NetworkInfo; - -public class ApplicationUtility { - - public boolean checkConnection(Context context) { - boolean flag = false; - try { - ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); - NetworkInfo info = connectivityManager.getActiveNetworkInfo(); - - if (info.getType() == ConnectivityManager.TYPE_WIFI) { - System.out.println(info.getTypeName()); - flag = true; - } - if (info.getType() == ConnectivityManager.TYPE_MOBILE) { - System.out.println(info.getTypeName()); - flag = true; - } - } catch (Exception exception) { - System.out.println("Exception at network connection....." - + exception); - } - return flag; - } -} diff --git a/app/src/main/java/io/intelehealth/client/utilities/Base64Utils.java b/app/src/main/java/io/intelehealth/client/utilities/Base64Utils.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/utilities/ConceptId.java b/app/src/main/java/io/intelehealth/client/utilities/ConceptId.java deleted file mode 100644 index fdc926fb5a..0000000000 --- a/app/src/main/java/io/intelehealth/client/utilities/ConceptId.java +++ /dev/null @@ -1,35 +0,0 @@ -package io.intelehealth.client.utilities; - -/** - * Created by vishal on 6/29/2017. - */ - -public class ConceptId { - public static final int CURRENT_COMPLAINT = 163212; - public static final int PHYSICAL_EXAMINATION = 163213; - public static final int HEIGHT = 5090; - public static final int WEIGHT = 5089; - public static final int PULSE = 5087; - public static final int SYSTOLIC_BP = 5085; - public static final int DIASTOLIC_BP = 5086; - public static final int TEMPERATURE = 5088; - // Respiratory added as per a concept id - public static final int RESPIRATORY = 5242; - public static final int SPO2 = 5092; - public static final int RHK_MEDICAL_HISTORY_BLURB = 163210; - public static final int RHK_FAMILY_HISTORY_BLURB = 163211; - public static final int FOLLOW_UP_VISIT = 163345; - - public static final int TELEMEDICINE_DIAGNOSIS = 163219; - public static final int JSV_MEDICATIONS = 163202; - public static final int MEDICAL_ADVICE = 163216; - public static final int REQUESTED_TESTS = 163206; - public static final int ADDITIONAL_COMMENTS = 162169; - - public static final int SON_WIFE_DAUGHTER = 163207; - public static final int OCCUPATION = 163208; - - public static final int PATIENT_SATISFACTION = 163343; - public static final int COMMENTS = 163344; - -} diff --git a/app/src/main/java/io/intelehealth/client/utilities/ConfigUtils.java b/app/src/main/java/io/intelehealth/client/utilities/ConfigUtils.java old mode 100644 new mode 100755 index a04b2d16d3..0edb408437 --- a/app/src/main/java/io/intelehealth/client/utilities/ConfigUtils.java +++ b/app/src/main/java/io/intelehealth/client/utilities/ConfigUtils.java @@ -21,7 +21,7 @@ public ConfigUtils(Context context) { this.context = context; } - public JSONObject jsonreader() { + private JSONObject jsonreader() { sessionManager = new SessionManager(IntelehealthApplication.getAppContext()); JSONObject obj = null; try { @@ -40,221 +40,6 @@ public JSONObject jsonreader() { return obj; } - public boolean mFirstName() { - boolean view = false; - - JSONObject object = jsonreader(); - try { - view = object.getBoolean("mFirstName"); - } catch (JSONException e) { - Crashlytics.getInstance().core.logException(e); - } - return view; - } - - public boolean mMiddleName() { - boolean view = false; - - JSONObject object = jsonreader(); - try { - view = object.getBoolean("mMiddleName"); - } catch (JSONException e) { - Crashlytics.getInstance().core.logException(e); - } - return view; - } - - public boolean mLastName() { - boolean view = false; - - JSONObject object = jsonreader(); - try { - view = object.getBoolean("mLastName"); - } catch (JSONException e) { - Crashlytics.getInstance().core.logException(e); - } - return view; - } - - public boolean mDOB() { - boolean view = false; - - JSONObject object = jsonreader(); - try { - view = object.getBoolean("mDOB"); - } catch (JSONException e) { - Crashlytics.getInstance().core.logException(e); - } - return view; - } - - public boolean mPhoneNum() { - boolean view = false; - - JSONObject object = jsonreader(); - try { - view = object.getBoolean("mPhoneNum"); - } catch (JSONException e) { - Crashlytics.getInstance().core.logException(e); - } - return view; - } - - public boolean mAge() { - boolean view = false; - - JSONObject object = jsonreader(); - try { - view = object.getBoolean("mAge"); - } catch (JSONException e) { - Crashlytics.getInstance().core.logException(e); - } - return view; - } - - public boolean mAddress1() { - boolean view = false; - - JSONObject object = jsonreader(); - try { - view = object.getBoolean("mAddress1"); - } catch (JSONException e) { - Crashlytics.getInstance().core.logException(e); - } - return view; - } - - public boolean mAddress2() { - boolean view = false; - - JSONObject object = jsonreader(); - try { - view = object.getBoolean("mAddress2"); - } catch (JSONException e) { - Crashlytics.getInstance().core.logException(e); - } - return view; - } - - public boolean mCity() { - boolean view = false; - - JSONObject object = jsonreader(); - try { - view = object.getBoolean("mCity"); - } catch (JSONException e) { - Crashlytics.getInstance().core.logException(e); - } - return view; - } - - public boolean countryStateLayout() { - boolean view = false; - - JSONObject object = jsonreader(); - try { - view = object.getBoolean("countryStateLayout"); - } catch (JSONException e) { - Crashlytics.getInstance().core.logException(e); - } - return view; - } - - public boolean mPostal() { - boolean view = false; - - JSONObject object = jsonreader(); - try { - view = object.getBoolean("mPostal"); - } catch (JSONException e) { - Crashlytics.getInstance().core.logException(e); - } - return view; - } - - public boolean mGenderM() { - boolean view = false; - - JSONObject object = jsonreader(); - try { - view = object.getBoolean("mGenderM"); - } catch (JSONException e) { - Crashlytics.getInstance().core.logException(e); - } - return view; - } - - public boolean mGenderF() { - boolean view = false; - - JSONObject object = jsonreader(); - try { - view = object.getBoolean("mGenderF"); - } catch (JSONException e) { - Crashlytics.getInstance().core.logException(e); - } - return view; - } - - public boolean mRelationship() { - boolean view = false; - - JSONObject object = jsonreader(); - try { - view = object.getBoolean("mRelationship"); - } catch (JSONException e) { - Crashlytics.getInstance().core.logException(e); - } - return view; - } - - public boolean mOccupation() { - boolean view = false; - - JSONObject object = jsonreader(); - try { - view = object.getBoolean("mOccupation"); - } catch (JSONException e) { - Crashlytics.getInstance().core.logException(e); - } - return view; - } - - public boolean casteLayout() { - boolean view = false; - - JSONObject object = jsonreader(); - try { - view = object.getBoolean("casteLayout"); - } catch (JSONException e) { - Crashlytics.getInstance().core.logException(e); - } - return view; - } - - public boolean educationLayout() { - boolean view = false; - - JSONObject object = jsonreader(); - try { - view = object.getBoolean("educationLayout"); - } catch (JSONException e) { - Crashlytics.getInstance().core.logException(e); - } - return view; - } - - public boolean economicLayout() { - boolean view = false; - - JSONObject object = jsonreader(); - try { - view = object.getBoolean("economicLayout"); - } catch (JSONException e) { - Crashlytics.getInstance().core.logException(e); - } - return view; - } public boolean height() { boolean view = false; @@ -280,77 +65,6 @@ public boolean weight() { return view; } - public boolean pulse() { - boolean view = false; - - JSONObject object = jsonreader(); - try { - view = object.getBoolean("mPulse"); - } catch (JSONException e) { - Crashlytics.getInstance().core.logException(e); - } - return view; - } - - public boolean bpSys() { - boolean view = false; - - JSONObject object = jsonreader(); - try { - view = object.getBoolean("mBpSys"); - } catch (JSONException e) { - Crashlytics.getInstance().core.logException(e); - } - return view; - } - - public boolean bpDia() { - boolean view = false; - - JSONObject object = jsonreader(); - try { - view = object.getBoolean("mBpDia"); - } catch (JSONException e) { - Crashlytics.getInstance().core.logException(e); - } - return view; - } - - public boolean spo2() { - boolean view = false; - - JSONObject object = jsonreader(); - try { - view = object.getBoolean("mSpo2"); - } catch (JSONException e) { - Crashlytics.getInstance().core.logException(e); - } - return view; - } - - public boolean bmi() { - boolean view = false; - - JSONObject object = jsonreader(); - try { - view = object.getBoolean("mBMI"); - } catch (JSONException e) { - Crashlytics.getInstance().core.logException(e); - } - return view; - } - - public boolean resp() { - boolean view = false; - - JSONObject object = jsonreader(); - try { - view = object.getBoolean("mResp"); - } catch (JSONException e) { - Crashlytics.getInstance().core.logException(e); - } - return view; - } public boolean temperature() { boolean view = false; diff --git a/app/src/main/java/io/intelehealth/client/utilities/DateAndTimeUtils.java b/app/src/main/java/io/intelehealth/client/utilities/DateAndTimeUtils.java old mode 100644 new mode 100755 index e1f558e58f..683187d7ed --- a/app/src/main/java/io/intelehealth/client/utilities/DateAndTimeUtils.java +++ b/app/src/main/java/io/intelehealth/client/utilities/DateAndTimeUtils.java @@ -9,6 +9,7 @@ import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; +import java.util.Calendar; import java.util.Date; import java.util.Locale; @@ -48,6 +49,13 @@ public static int getAge(String s) { return period.getYears(); } + public static String getSubtractedPulledExcutedTime(String lastPulledTime) { + Calendar now = Calendar.getInstance(); + + + return ""; + } + public static String getFormatedDateOfBirth(String oldformatteddate){ DateFormat originalFormat = new SimpleDateFormat("dd MMMM yyyy", Locale.ENGLISH); @@ -80,7 +88,7 @@ public static String getFormatedDateOfBirthAsView(String oldformatteddate) { } public String currentDateTimeInHome() { - DateFormat date = new SimpleDateFormat("dd MMMM yyyy HH:mm:ss", Locale.getDefault()); + DateFormat date = new SimpleDateFormat("dd MMM yyyy HH:mm:ss", Locale.getDefault()); // you can get seconds by adding "...:ss" to it Date todayDate = new Date(); return date.format(todayDate); @@ -94,7 +102,7 @@ public static String SimpleDatetoLongFollowupDate(String dateString) { Date date = originalFormat.parse(dateString); formattedDate = targetFormat.format(date); } catch (Exception ex) { - System.out.println(ex); + Crashlytics.getInstance().core.logException(ex); } return formattedDate; } @@ -107,7 +115,7 @@ public static String SimpleDatetoLongDate(String dateString) { Date date = originalFormat.parse(dateString); formattedDate = targetFormat.format(date); } catch (Exception ex) { - System.out.println(ex); + Crashlytics.getInstance().core.logException(ex); } return formattedDate; } diff --git a/app/src/main/java/io/intelehealth/client/utilities/DialogUtils.java b/app/src/main/java/io/intelehealth/client/utilities/DialogUtils.java old mode 100644 new mode 100755 index e360883b4e..a2520d8a3a --- a/app/src/main/java/io/intelehealth/client/utilities/DialogUtils.java +++ b/app/src/main/java/io/intelehealth/client/utilities/DialogUtils.java @@ -1,6 +1,5 @@ package io.intelehealth.client.utilities; -import android.app.Activity; import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; @@ -41,24 +40,6 @@ public void onClick(DialogInterface dialog, int which) { alertDialog.getButton(AlertDialog.BUTTON_POSITIVE).setTextColor(context.getResources().getColor(R.color.colorPrimaryDark)); } - public void showSyncDialog(Activity context, String title, String message, String ok) { - AlertDialog alertDialog = new AlertDialog.Builder(context).create(); - alertDialog.setTitle(title); - alertDialog.setMessage(message); - alertDialog.setButton(AlertDialog.BUTTON_NEUTRAL, ok, - new DialogInterface.OnClickListener() { - public void onClick(DialogInterface dialog, int which) { - dialog.dismiss(); - context.finish(); - } - }); - alertDialog.show(); - - } - - public void showLicenseDownloadProtocals() { - - } } diff --git a/app/src/main/java/io/intelehealth/client/utilities/DownloadFilesUtils.java b/app/src/main/java/io/intelehealth/client/utilities/DownloadFilesUtils.java old mode 100644 new mode 100755 index 4929a6642b..84166091c2 --- a/app/src/main/java/io/intelehealth/client/utilities/DownloadFilesUtils.java +++ b/app/src/main/java/io/intelehealth/client/utilities/DownloadFilesUtils.java @@ -64,47 +64,5 @@ public void saveToDisk(ResponseBody body, String filename) { } } - public void saveObsToDisk(ResponseBody body, String filename) { - try { - - File destinationFile = new File(IMAGE_PATH, filename + ".jpg"); - - InputStream inputStream = null; - OutputStream outputStream = null; - - try { - inputStream = body.byteStream(); - outputStream = new FileOutputStream(destinationFile); - byte[] data = new byte[4096]; - int count; - int progress = 0; - long fileSize = body.contentLength(); - Log.d(TAG, "File Size=" + fileSize); - while ((count = inputStream.read(data)) != -1) { - outputStream.write(data, 0, count); - progress += count; - Pair pairs = new Pair<>(progress, fileSize); - Log.d(TAG, "Progress: " + progress + "/" + fileSize + " >>>> " + (float) progress / fileSize); - } - outputStream.flush(); - Log.d(TAG, destinationFile.getParent()); - Pair pairs = new Pair<>(100, 100L); - return; - } catch (IOException e) { - Crashlytics.getInstance().core.logException(e); - Pair pairs = new Pair<>(-1, Long.valueOf(-1)); - Log.d(TAG, "Failed to save the file!"); - return; - } finally { - if (inputStream != null) inputStream.close(); - if (outputStream != null) outputStream.close(); - } - } catch (IOException e) { - Crashlytics.getInstance().core.logException(e); - Log.d(TAG, "Failed to save the file!"); - return; - } - } - } diff --git a/app/src/main/java/io/intelehealth/client/utilities/EditTextUtils.java b/app/src/main/java/io/intelehealth/client/utilities/EditTextUtils.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/utilities/FileUtils.java b/app/src/main/java/io/intelehealth/client/utilities/FileUtils.java old mode 100644 new mode 100755 index 6ef3f4c8cc..ffb311520d --- a/app/src/main/java/io/intelehealth/client/utilities/FileUtils.java +++ b/app/src/main/java/io/intelehealth/client/utilities/FileUtils.java @@ -88,7 +88,6 @@ public static JSONObject encodeJSON(Context context, String fileName) { } catch (IOException e) { Crashlytics.getInstance().core.logException(e); } -// #628 try { encoded = new JSONObject(raw_json); } catch (JSONException e) { diff --git a/app/src/main/java/io/intelehealth/client/utilities/IntelehealthAuthenticator.java b/app/src/main/java/io/intelehealth/client/utilities/IntelehealthAuthenticator.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/utilities/Logger.java b/app/src/main/java/io/intelehealth/client/utilities/Logger.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/utilities/NetworkConnection.java b/app/src/main/java/io/intelehealth/client/utilities/NetworkConnection.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/utilities/NotificationUtils.java b/app/src/main/java/io/intelehealth/client/utilities/NotificationUtils.java old mode 100644 new mode 100755 index 78a4efcc7a..bbcb17826b --- a/app/src/main/java/io/intelehealth/client/utilities/NotificationUtils.java +++ b/app/src/main/java/io/intelehealth/client/utilities/NotificationUtils.java @@ -11,57 +11,57 @@ public class NotificationUtils { - private String channelId = "intelehealth"; + private String channelId = "1"; private String channelName = "intelehealth"; private int mId = 1; Context context; +// notifcation id for the inteleHealth app +// #1 for sync module +// #2 for patient Details upload and download +// #3 for visit uploadand download and end visit +// #4 for images upload and download either obs and patient profile +// - public void showNotifications(String title, String text, Context context) { + public void showNotifications(String title, String text, int notificationId, Context context) { this.context = context; NotificationManager mNotifyManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); - //mahiti added if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) { + String channelid = String.valueOf(notificationId); int importance = NotificationManager.IMPORTANCE_HIGH; - NotificationChannel mChannel = new NotificationChannel(channelId, channelName, importance); + NotificationChannel mChannel = new NotificationChannel(channelid, channelName, importance); mNotifyManager.createNotificationChannel(mChannel); } NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context, channelId); -// PendingIntent contentIntent = PendingIntent.getActivity(context, 0, new Intent(context, HomeActivity.class), PendingIntent.FLAG_UPDATE_CURRENT); - -// mBuilder.setContentIntent(contentIntent); mBuilder.setContentTitle(title) .setContentText(text) .setSmallIcon(R.drawable.ic_cloud_upload); mBuilder.setProgress(100, 0, true); - mNotifyManager.notify(mId, mBuilder.build()); + mNotifyManager.notify(notificationId, mBuilder.build()); } - public void showNotificationProgress(String title, String text, Context context, Integer progress) { + public void showNotificationProgress(String title, String text, int notifcationId, Context context, Integer progress) { this.context = context; NotificationManager mNotifyManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); - //mahiti added if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) { int importance = NotificationManager.IMPORTANCE_HIGH; - NotificationChannel mChannel = new NotificationChannel(channelId, channelName, importance); + String channelid = String.valueOf(notifcationId); + NotificationChannel mChannel = new NotificationChannel(channelid, channelName, importance); mNotifyManager.createNotificationChannel(mChannel); } NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context, channelId); -// PendingIntent contentIntent = PendingIntent.getActivity(context, 0, new Intent(context, HomeActivity.class), PendingIntent.FLAG_UPDATE_CURRENT); - -// mBuilder.setContentIntent(contentIntent); mBuilder.setContentTitle(title) .setContentText(text) .setSmallIcon(R.drawable.ic_cloud_upload); mBuilder.setProgress(100, progress, false); - mNotifyManager.notify(mId, mBuilder.build()); + mNotifyManager.notify(notifcationId, mBuilder.build()); } - public void DownloadDone(String title, String text, Context context) { + public void DownloadDone(String title, String text, int notificationId, Context context) { this.context = context; NotificationManager mNotifyManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); @@ -69,18 +69,16 @@ public void DownloadDone(String title, String text, Context context) { if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) { int importance = NotificationManager.IMPORTANCE_HIGH; - NotificationChannel mChannel = new NotificationChannel(channelId, channelName, importance); + String channelid = String.valueOf(notificationId); + NotificationChannel mChannel = new NotificationChannel(channelid, channelName, importance); mNotifyManager.createNotificationChannel(mChannel); } NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context, channelId); -// PendingIntent contentIntent = PendingIntent.getActivity(context, 0, new Intent(context, HomeActivity.class), PendingIntent.FLAG_UPDATE_CURRENT); - -// mBuilder.setContentIntent(contentIntent); mBuilder.setContentTitle(title) .setContentText(text) .setSmallIcon(R.drawable.ic_cloud_upload); - mNotifyManager.notify(mId, mBuilder.build()); + mNotifyManager.notify(notificationId, mBuilder.build()); } @@ -89,7 +87,7 @@ public void clearAllNotifications(Context context) { this.context = context; NotificationManager mNotifyManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); - mNotifyManager.cancel(mId); + mNotifyManager.cancelAll(); if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) { int importance = NotificationManager.IMPORTANCE_HIGH; diff --git a/app/src/main/java/io/intelehealth/client/utilities/OfflineLogin.java b/app/src/main/java/io/intelehealth/client/utilities/OfflineLogin.java old mode 100644 new mode 100755 index f89df670f2..4de4cbd2bc --- a/app/src/main/java/io/intelehealth/client/utilities/OfflineLogin.java +++ b/app/src/main/java/io/intelehealth/client/utilities/OfflineLogin.java @@ -60,9 +60,7 @@ public void setUpOfflineLogin(String username, String password) { String hash = null; try { hash = StringEncryption.convertToSHA256(random_salt + password); - } catch (NoSuchAlgorithmException e) { - Crashlytics.getInstance().core.logException(e); - } catch (UnsupportedEncodingException e) { + } catch (NoSuchAlgorithmException | UnsupportedEncodingException e) { Crashlytics.getInstance().core.logException(e); } SharedPreferences.Editor editor = mSharedPreference.edit(); @@ -108,9 +106,7 @@ public void login(String username, String password) { String hash = null; try { hash = StringEncryption.convertToSHA256(stored_salt + password); - } catch (NoSuchAlgorithmException e) { - Crashlytics.getInstance().core.logException(e); - } catch (UnsupportedEncodingException e) { + } catch (NoSuchAlgorithmException | UnsupportedEncodingException e) { Crashlytics.getInstance().core.logException(e); } Log.i(TAG, "Hashed Password : " + hash); @@ -137,7 +133,7 @@ public void login(String username, String password) { } public void invalidateLoginCredentials() { - mSharedPreference.edit().clear().commit(); + mSharedPreference.edit().clear().apply(); Log.i(TAG, mContext.getString(R.string.invalidate_offline_login)); } @@ -152,6 +148,6 @@ public void setOfflineLoginStatus(Boolean status) { SharedPreferences.Editor editor = mSharedPreference.edit(); editor.putBoolean( mContext.getString(R.string.offline_login_status), status); - editor.commit(); + editor.apply(); } } diff --git a/app/src/main/java/io/intelehealth/client/utilities/OpenMRSAccountAuthenticatorService.java b/app/src/main/java/io/intelehealth/client/utilities/OpenMRSAccountAuthenticatorService.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/utilities/PatientsFrameJson.java b/app/src/main/java/io/intelehealth/client/utilities/PatientsFrameJson.java old mode 100644 new mode 100755 index 319fa00e66..4ef36b4a69 --- a/app/src/main/java/io/intelehealth/client/utilities/PatientsFrameJson.java +++ b/app/src/main/java/io/intelehealth/client/utilities/PatientsFrameJson.java @@ -6,7 +6,6 @@ import java.util.List; import io.intelehealth.client.app.IntelehealthApplication; -import io.intelehealth.client.database.dao.EmergencyEncounterDAO; import io.intelehealth.client.database.dao.EncounterDAO; import io.intelehealth.client.database.dao.ObsDAO; import io.intelehealth.client.database.dao.PatientsDAO; @@ -29,16 +28,13 @@ import io.intelehealth.client.utilities.exception.DAOException; public class PatientsFrameJson { - PatientsDAO patientsDAO = new PatientsDAO(); + private PatientsDAO patientsDAO = new PatientsDAO(); private SessionManager session; - VisitsDAO visitsDAO = new VisitsDAO(); - EncounterDAO encounterDAO = new EncounterDAO(); - ObsDAO obsDAO = new ObsDAO(); - EmergencyEncounterDAO emergencyEncounterDAO = new EmergencyEncounterDAO(); -// SQLiteDatabase db = null; + private VisitsDAO visitsDAO = new VisitsDAO(); + private EncounterDAO encounterDAO = new EncounterDAO(); + private ObsDAO obsDAO = new ObsDAO(); public PushRequestApiCall frameJson() { -// db = AppConstants.inteleHealthDatabaseHelper.getWritableDatabase(); session = new SessionManager(IntelehealthApplication.getAppContext()); PushRequestApiCall pushRequestApiCall = new PushRequestApiCall(); @@ -56,59 +52,61 @@ public PushRequestApiCall frameJson() { List visitList = new ArrayList<>(); List encounterList = new ArrayList<>(); - for (int i = 0; i < patientDTOList.size(); i++) { - - Person person = new Person(); - person.setBirthdate(patientDTOList.get(i).getDateofbirth()); - person.setGender(patientDTOList.get(i).getGender()); - person.setUuid(patientDTOList.get(i).getUuid()); - personList.add(person); - - List nameList = new ArrayList<>(); - Name name = new Name(); - name.setFamilyName(patientDTOList.get(i).getLastname()); - name.setGivenName(patientDTOList.get(i).getFirstname()); - name.setMiddleName(patientDTOList.get(i).getMiddlename()); - nameList.add(name); - - List

addressList = new ArrayList<>(); - Address address = new Address(); - address.setAddress1(patientDTOList.get(i).getAddress1()); - address.setAddress2(patientDTOList.get(i).getAddress2()); - address.setCityVillage(patientDTOList.get(i).getCityvillage()); - address.setCountry(patientDTOList.get(i).getCountry()); - address.setPostalCode(patientDTOList.get(i).getPostalcode()); - address.setStateProvince(patientDTOList.get(i).getStateprovince()); - addressList.add(address); - - - List attributeList = new ArrayList<>(); - attributeList.clear(); - try { - attributeList = patientsDAO.getPatientAttributes(patientDTOList.get(i).getUuid()); - } catch (DAOException e) { - Crashlytics.getInstance().core.logException(e); - } + if (patientDTOList != null) { + for (int i = 0; i < patientDTOList.size(); i++) { + + Person person = new Person(); + person.setBirthdate(patientDTOList.get(i).getDateofbirth()); + person.setGender(patientDTOList.get(i).getGender()); + person.setUuid(patientDTOList.get(i).getUuid()); + personList.add(person); + + List nameList = new ArrayList<>(); + Name name = new Name(); + name.setFamilyName(patientDTOList.get(i).getLastname()); + name.setGivenName(patientDTOList.get(i).getFirstname()); + name.setMiddleName(patientDTOList.get(i).getMiddlename()); + nameList.add(name); + + List
addressList = new ArrayList<>(); + Address address = new Address(); + address.setAddress1(patientDTOList.get(i).getAddress1()); + address.setAddress2(patientDTOList.get(i).getAddress2()); + address.setCityVillage(patientDTOList.get(i).getCityvillage()); + address.setCountry(patientDTOList.get(i).getCountry()); + address.setPostalCode(patientDTOList.get(i).getPostalcode()); + address.setStateProvince(patientDTOList.get(i).getStateprovince()); + addressList.add(address); + + + List attributeList = new ArrayList<>(); + attributeList.clear(); + try { + attributeList = patientsDAO.getPatientAttributes(patientDTOList.get(i).getUuid()); + } catch (DAOException e) { + Crashlytics.getInstance().core.logException(e); + } - person.setNames(nameList); - person.setAddresses(addressList); - person.setAttributes(attributeList); - Patient patient = new Patient(); + person.setNames(nameList); + person.setAddresses(addressList); + person.setAttributes(attributeList); + Patient patient = new Patient(); - patient.setPerson(patientDTOList.get(i).getUuid()); + patient.setPerson(patientDTOList.get(i).getUuid()); - List identifierList = new ArrayList<>(); - Identifier identifier = new Identifier(); - identifier.setIdentifierType("05a29f94-c0ed-11e2-94be-8c13b969e334"); - identifier.setLocation(session.getLocationUuid()); - identifier.setPreferred(true); - identifierList.add(identifier); + List identifierList = new ArrayList<>(); + Identifier identifier = new Identifier(); + identifier.setIdentifierType("05a29f94-c0ed-11e2-94be-8c13b969e334"); + identifier.setLocation(session.getLocationUuid()); + identifier.setPreferred(true); + identifierList.add(identifier); - patient.setIdentifiers(identifierList); - patientList.add(patient); + patient.setIdentifiers(identifierList); + patientList.add(patient); + } } for (VisitDTO visitDTO : visitDTOList) { Visit visit = new Visit(); @@ -170,8 +168,6 @@ public PushRequestApiCall frameJson() { pushRequestApiCall.setVisits(visitList); pushRequestApiCall.setEncounters(encounterList); -// EmergencyEncounterDAO emergencyEncounterDAO=new EmergencyEncounterDAO(); -// emergencyEncounterDAO.checkEmergency(); return pushRequestApiCall; } diff --git a/app/src/main/java/io/intelehealth/client/utilities/PrintUtils.java b/app/src/main/java/io/intelehealth/client/utilities/PrintUtils.java deleted file mode 100644 index 8f7b3ccdc8..0000000000 --- a/app/src/main/java/io/intelehealth/client/utilities/PrintUtils.java +++ /dev/null @@ -1,7 +0,0 @@ -package io.intelehealth.client.utilities; - - -public class PrintUtils { - - -} diff --git a/app/src/main/java/io/intelehealth/client/utilities/SessionManager.java b/app/src/main/java/io/intelehealth/client/utilities/SessionManager.java old mode 100644 new mode 100755 index ff77fa0195..df61144aa8 --- a/app/src/main/java/io/intelehealth/client/utilities/SessionManager.java +++ b/app/src/main/java/io/intelehealth/client/utilities/SessionManager.java @@ -4,6 +4,8 @@ import android.content.SharedPreferences; import android.preference.PreferenceManager; +import java.util.Set; + public class SessionManager { // Shared preferences file name private static final String PREF_NAME = "Intelehealth"; @@ -38,6 +40,9 @@ public class SessionManager { private static final String PUSH_SYNC_FINISHED = "pushsyncfinished"; private static final String MIND_MAP_SERVER_URL = "mindmapurl"; private static final String RETURNING_USER = "returninguser"; + private static final String VISIT_SUMMARY = "visit_summary"; + private static final String EXAM = "exam_"; + private static final String MIGRATION_KEY = "migrationkey"; // LogCat tag private static String TAG = SessionManager.class.getSimpleName(); // Shared Preferences @@ -199,7 +204,7 @@ public void setServerUrlBase(String serverUrlBase) { } public String getLicenseKey() { - return pref.getString(LICENSE_KEY, ""); + return pref.getString(LICENSE_KEY, null); } public void setLicenseKey(String licenseKey) { @@ -299,7 +304,7 @@ public void setSyncFinished(Boolean syncFinished) { } public String getLastPulledDateTime() { - return pref.getString(LAST_PULLED_EXECUTED_DATE_TIME, "01 January 2019"); + return pref.getString(LAST_PULLED_EXECUTED_DATE_TIME, "01 January 2019 12:15:26"); } //getting the sync value and time and saving in the sharedpref public void setLastPulledDateTime(String lastPulledDateTime) { @@ -342,4 +347,32 @@ public void setReturningUser(Boolean returningUser) { editor.putBoolean(RETURNING_USER, returningUser); editor.commit(); } + + public Set getVisitSummary(String patientUUid) { + + return pref.getStringSet(EXAM + patientUUid, null); + } + + public void setVisitSummary(String patientUuid, Set selectedExams) { + editor.putStringSet(EXAM + patientUuid, selectedExams); + editor.commit(); + + } + + public void removeVisitSummary(String patientUuid, String visitUuid) { + editor.remove(EXAM + patientUuid + "_" + visitUuid); + editor.commit(); + + } + + public boolean isMigration() { + return pref.getBoolean(MIGRATION_KEY, false); + } + + public void setMigration(Boolean migration) { + editor.putBoolean(MIGRATION_KEY, migration); + editor.commit(); + } + + } diff --git a/app/src/main/java/io/intelehealth/client/utilities/SmsUtils.java b/app/src/main/java/io/intelehealth/client/utilities/SmsUtils.java deleted file mode 100644 index aa31e56df2..0000000000 --- a/app/src/main/java/io/intelehealth/client/utilities/SmsUtils.java +++ /dev/null @@ -1,8 +0,0 @@ -package io.intelehealth.client.utilities; - - - -public class SmsUtils { - - -} diff --git a/app/src/main/java/io/intelehealth/client/utilities/SqliteDbCloseHelper.java b/app/src/main/java/io/intelehealth/client/utilities/SqliteDbCloseHelper.java deleted file mode 100644 index b35c4d8c8d..0000000000 --- a/app/src/main/java/io/intelehealth/client/utilities/SqliteDbCloseHelper.java +++ /dev/null @@ -1,19 +0,0 @@ -package io.intelehealth.client.utilities; - -import android.database.Cursor; -import android.database.sqlite.SQLiteDatabase; - -public class SqliteDbCloseHelper { - - public void dbClose(SQLiteDatabase db) { - if (db != null && db.isOpen()) { - db.close(); - } - } - - public void cursorClose(Cursor cursor) { - if (cursor != null) { - cursor.close(); - } - } -} diff --git a/app/src/main/java/io/intelehealth/client/utilities/StringEncryption.java b/app/src/main/java/io/intelehealth/client/utilities/StringEncryption.java old mode 100644 new mode 100755 index d2362297ae..2f5eec004c --- a/app/src/main/java/io/intelehealth/client/utilities/StringEncryption.java +++ b/app/src/main/java/io/intelehealth/client/utilities/StringEncryption.java @@ -15,16 +15,16 @@ public class StringEncryption { - SecureRandom secureRandom = null; + private SecureRandom secureRandom = null; - public static String convertToSHA256(String text) throws NoSuchAlgorithmException, UnsupportedEncodingException { + static String convertToSHA256(String text) throws NoSuchAlgorithmException, UnsupportedEncodingException { MessageDigest md = MessageDigest.getInstance("SHA-256"); md.update(text.getBytes(StandardCharsets.ISO_8859_1), 0, text.length()); byte[] digest = md.digest(); return String.format("%064x", new BigInteger(1, digest)); } - public String getRandomSaltString() { + String getRandomSaltString() { if (secureRandom == null) secureRandom = new SecureRandom(); return new BigInteger(130, secureRandom).toString(32); } diff --git a/app/src/main/java/io/intelehealth/client/utilities/StringUtils.java b/app/src/main/java/io/intelehealth/client/utilities/StringUtils.java old mode 100644 new mode 100755 index 302cee41ea..e79ad0b0f6 --- a/app/src/main/java/io/intelehealth/client/utilities/StringUtils.java +++ b/app/src/main/java/io/intelehealth/client/utilities/StringUtils.java @@ -120,6 +120,14 @@ public static String getValue(String value) { } + public static String getValue1(String value) { + String val = " "; + if (value != null) + val = value; + return val; + + } + public static String getProvided(Spinner spinner) { String val = ""; if (spinner.getSelectedItemPosition() == 0) diff --git a/app/src/main/java/io/intelehealth/client/utilities/UrlModifiers.java b/app/src/main/java/io/intelehealth/client/utilities/UrlModifiers.java old mode 100644 new mode 100755 index 44e3937e3a..eb03a6bdd6 --- a/app/src/main/java/io/intelehealth/client/utilities/UrlModifiers.java +++ b/app/src/main/java/io/intelehealth/client/utilities/UrlModifiers.java @@ -3,7 +3,7 @@ import io.intelehealth.client.app.IntelehealthApplication; public class UrlModifiers { - SessionManager sessionManager = null; + private SessionManager sessionManager = null; public String loginUrl(String CLEAN_URL) { diff --git a/app/src/main/java/io/intelehealth/client/utilities/UuidDictionary.java b/app/src/main/java/io/intelehealth/client/utilities/UuidDictionary.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/utilities/UuidGenerator.java b/app/src/main/java/io/intelehealth/client/utilities/UuidGenerator.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/utilities/backup/Backup.java b/app/src/main/java/io/intelehealth/client/utilities/backup/Backup.java deleted file mode 100644 index 040dcc069f..0000000000 --- a/app/src/main/java/io/intelehealth/client/utilities/backup/Backup.java +++ /dev/null @@ -1,191 +0,0 @@ -package io.intelehealth.client.utilities.backup; - -import android.content.Context; -import android.database.Cursor; -import android.database.sqlite.SQLiteDatabase; -import android.database.sqlite.SQLiteException; -import android.os.Environment; -import android.util.Log; - -import java.io.BufferedReader; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStreamReader; -import java.nio.channels.FileChannel; -import java.text.SimpleDateFormat; -import java.util.Calendar; - -import io.intelehealth.client.app.AppConstants; -import io.intelehealth.client.database.InteleHealthDatabaseHelper; -import io.intelehealth.client.utilities.SessionManager; - -/** - * Created by twinkle dhanak on 7/4/2017. - */ - - -// consists of all methods that deal with backup -public class Backup { - String dbpath = "", newfilepath = ""; - File dbfile, myfile; - FileInputStream fis; - FileOutputStream fos; - String value = ""; - SessionManager sessionManager; - - - public boolean checkDatabaseForData(Context context) { - SQLiteDatabase checkDB = null; - boolean exists = false; - try { - - dbpath = String.valueOf(context.getDatabasePath(AppConstants.DATABASE_NAME).getPath()); - - Log.d("dbpath", dbpath); - // checkDB = SQLiteDatabase.openDatabase(dbpath, null, SQLiteDatabase.OPEN_READONLY); - // check user_provider table, if empty, db empty - InteleHealthDatabaseHelper mDatabaseHelper = new InteleHealthDatabaseHelper(context); - SQLiteDatabase sqLiteDatabase = mDatabaseHelper.getReadableDatabase(); - String query = "SELECT * FROM tbl_patient"; // patient is the first table to get populated - Cursor cursor = sqLiteDatabase.rawQuery(query, null); - // data already exists on db -// restore of db is required - exists = cursor.moveToFirst(); - - - } catch (SQLiteException e) { - Log.d("DB error:", String.valueOf(e)); - exists = false; // restore of db is required - } - - return exists; - } - - public boolean createFileInMemory(Context context, boolean isBackup) throws IOException { - - sessionManager = new SessionManager(context); - - try { - File myDir = new File(Environment.getExternalStorageDirectory() + File.separator + "InteleHealth_DB"); - if (myDir.exists()) { - } else { - myDir.mkdir(); - } - //file created inside internal memory, outside app package, doesnt delete if app is uninstalled -// newfilepath = Environment.getExternalStorageDirectory() + File.separator + "InteleHealth_DB" + -// File.separator + "Intelehealth.db"; // directory: Intelehealth_DB , filename: Intelehealth.db - Log.d("newfilepath", AppConstants.dbfilepath); - myfile = new File(AppConstants.dbfilepath); - Log.d("myfile path", myfile.getPath()); - if (myfile.exists()) { - } else { - } - dbfile = new File(context.getDatabasePath(AppConstants.DATABASE_NAME).getPath()); - if (dbfile.exists()) { - dbfile.createNewFile(); - } else { - dbfile.createNewFile(); - // Toast.makeText(context, "dbfile doesnot exist", Toast.LENGTH_SHORT).show(); //meera - } - - if (isBackup) { - - Log.d("Copying into your file", value); - fis = new FileInputStream(dbfile); - fos = new FileOutputStream(myfile); - readContents(context); - copyFile(context, fis, fos); - readContents(context); - // Toast.makeText(context, context.getString(R.string.db_backup_complete), Toast.LENGTH_SHORT).show(); //meera - return true; - } else if (!isBackup) { - Log.d("Copying into database", value); - fis = new FileInputStream(myfile); - fos = new FileOutputStream(dbfile); - readContents(context); - copyFile(context, fis, fos); - readContents(context); - // Toast.makeText(context, context.getString(R.string.db_restore_complete), Toast.LENGTH_SHORT).show(); //meera - return true; - } else { - return false; - } - - - } catch (Exception ie) { - Log.d("Error: ", ie.toString()); - return false; - } - - - } - - - public void copyFile(Context context, FileInputStream fromFile, FileOutputStream toFile) throws Exception { - FileChannel fromChannel = null; - FileChannel toChannel = null; - - try { - fromChannel = fromFile.getChannel(); - toChannel = toFile.getChannel(); - try { - fromChannel.transferTo(0, fromChannel.size(), toChannel); - - } catch (IOException e) { - Log.d("transfer failed:", String.valueOf(e)); - } - } finally { - try { - if (fromChannel != null) { - fromChannel.close(); - } - } finally { - if (toChannel != null) { - toChannel.close(); - } - } - } - - } - - - public void readContents(Context context) throws IOException { - sessionManager = new SessionManager(context); - StringBuilder sb = new StringBuilder(); - try { - - FileInputStream fis = new FileInputStream(myfile); - InputStreamReader isr = new InputStreamReader(fis); - BufferedReader br = new BufferedReader(isr); - String line = ""; - - while ((line = br.readLine()) != null) { - line = br.readLine(); - sb.append(line); - } - - } catch (Exception e) { - Log.d("readerror", e.toString()); - // Toast.makeText(context,"Not able to read the file!!",Toast.LENGTH_SHORT).show(); //meera - } - Calendar c = Calendar.getInstance(); - String time = String.valueOf(c.getTime()); - - SimpleDateFormat df2 = new SimpleDateFormat("dd-MM-yyyy"); - String date = df2.format(c.getTime()); - Log.d("Last backup time: ", time); - Log.d("Last backup date: ", date); - sessionManager.setDate(date); - sessionManager.setTime(time); - - Log.d("file contents: ", String.valueOf(sb)); -// Toast.makeText(context,"File contents:: "+String.valueOf(sb),Toast.LENGTH_SHORT).show(); - } - - -} - - - diff --git a/app/src/main/java/io/intelehealth/client/utilities/backup/BackupCloud.java b/app/src/main/java/io/intelehealth/client/utilities/backup/BackupCloud.java deleted file mode 100644 index 1c2eabf60a..0000000000 --- a/app/src/main/java/io/intelehealth/client/utilities/backup/BackupCloud.java +++ /dev/null @@ -1,395 +0,0 @@ -package io.intelehealth.client.utilities.backup; - -import android.app.Dialog; -import android.app.NotificationManager; -import android.app.ProgressDialog; -import android.content.Context; -import android.content.SharedPreferences; -import android.net.ConnectivityManager; -import android.net.NetworkInfo; -import android.os.Environment; -import android.preference.PreferenceManager; -import android.support.annotation.Nullable; -import android.support.v4.app.NotificationCompat; -import android.util.Log; -import android.widget.Toast; - -import com.parse.GetCallback; -import com.parse.GetDataCallback; -import com.parse.ParseException; -import com.parse.ParseFile; -import com.parse.ParseObject; -import com.parse.ParseQuery; -import com.parse.ProgressCallback; -import com.parse.SaveCallback; - -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; - -import io.intelehealth.client.R; -import io.intelehealth.client.app.AppConstants; -import io.intelehealth.client.app.IntelehealthApplication; -import io.intelehealth.client.utilities.Logger; -import io.intelehealth.client.utilities.SessionManager; - -/** - * Created by Dexter Barretto on 3/6/18. - * Github : @dbarretto - */ -public class BackupCloud { - - private static final String TAG = BackupCloud.class.getSimpleName(); - NotificationCompat.Builder mBuilder; - SharedPreferences.Editor e; - SharedPreferences sharedPreferences; - NotificationManager mNotifyManager; - String location; - String user_id; - private Context context; - private Backup backup; - private Dialog dialog; - SessionManager sessionManager = null; - - public BackupCloud(Context context) { - sessionManager = new SessionManager(context); - this.context = context; -// backup = getBackupInstance(); - sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context); - e = sharedPreferences.edit(); -// mNotifyManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); -// //mahiti added -// if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) { -// int importance = NotificationManager.IMPORTANCE_HIGH; -// NotificationChannel mChannel = new NotificationChannel( -// channelId, channelName, importance); -// mNotifyManager.createNotificationChannel(mChannel); -// } -// mBuilder = new NotificationCompat.Builder(context, channelId); - } - - /** - * @param queue_id Should be provided only if it task is fired by job queue service. If called by user interaction,it must be null - */ - - public void startCloudBackup(@Nullable Integer queue_id, Boolean is_auto) { - - if (queue_id == null) { - dialog = new ProgressDialog(context); - dialog.setTitle(context.getString(R.string.cloud_upload_header)); - dialog.setCancelable(false); - dialog.show(); - } - - location = sessionManager.getLocationName(); - user_id = sessionManager.getCreatorID(); - -// if (queue_id == null) { -// queue_id = getQueueId(); -// } - - //get Local Backup first - boolean check = getBackupInstance().checkDatabaseForData(context); - - if (!check) { - Toast.makeText(context, context.getString(R.string.no_data), Toast.LENGTH_SHORT).show(); - if (dialog != null) { - dialog.dismiss(); - } - return; - } - - boolean backup_checker = false; - if (!is_auto) { - try { - backup_checker = backup.createFileInMemory(context, true); - if (dialog != null) { - dialog.dismiss(); - } - } catch (IOException e1) { - dialog.dismiss(); - e1.printStackTrace(); - } - - - if (!backup_checker) { - Toast.makeText(context, context.getString(R.string.local_backup_failed), Toast.LENGTH_SHORT).show(); - if (dialog != null) { - dialog.dismiss(); - } -// //Failed Task -// if (queue_id == null || queue_id.equals(-1)) { -// addJobToQueue(); -// } - return; - } - } - //Contains logic to upload to cloud - if (!isNetworkAvailable()) { - //Toast.makeText(context, context.getString(R.string.no_network), Toast.LENGTH_SHORT).show(); //meera - if (dialog != null) { - dialog.dismiss(); - } - //Failed Task -// if (queue_id == null || queue_id.equals(-1)) { -// addJobToQueue(); -// } - return; - } - - //Upload to parse - - Logger.logD("newfilepath", AppConstants.dbfilepath); - File myfile = new File(AppConstants.dbfilepath); - if (myfile.exists()) { - uploadToParse(myfile, user_id, location, queue_id); - } - -// //Failed Task -// if (queue_id == null || queue_id.equals(-1)) { -// addJobToQueue(); -// } - - } - - public void startCloudRestore() { - dialog = new ProgressDialog(context); - dialog.setTitle(context.getString(R.string.restore_data)); - dialog.setCancelable(false); - dialog.show(); - boolean check = getBackupInstance().checkDatabaseForData(context); - if (check) { - if (dialog != null) { - dialog.dismiss(); - } - // Toast.makeText(context, context.getString(R.string.error_existing_data), Toast.LENGTH_SHORT).show(); //meera - return; - } - //Check if backup exists locally - location = sessionManager.getLocationName(); - user_id = sessionManager.getCreatorID(); - File local_backup = new File(AppConstants.dbfilepath); - - //Download Backup from cloud if not available locally - if (!local_backup.exists()) { - Toast.makeText(context, context.getString(R.string.cloud_download_data), Toast.LENGTH_SHORT).show(); - if (isNetworkAvailable()) downloadFromParse(user_id, location); - else { - if (dialog != null) { - dialog.dismiss(); - } - Toast.makeText(context, context.getString(R.string.no_network), Toast.LENGTH_SHORT).show(); - } - } else { - //Toast.makeText(context, R.string.local_backup_restore, Toast.LENGTH_SHORT).show(); //meera - try { - boolean isSuccess = backup.createFileInMemory(context, false); - if (isSuccess) { - // Intent serviceIntent = new Intent(context, ImageDownloadService.class); - //context.startService(serviceIntent); removed on 2018.07.18 due to issues finding the right images - } - } catch (IOException e1) { - e1.printStackTrace(); - } - if (dialog != null) { - dialog.dismiss(); - } - } - - } - - public void cloudRestoreForced() { - //Download Backup from cloud - dialog = new ProgressDialog(context); - dialog.setTitle(context.getString(R.string.force_restore_header)); - dialog.setCancelable(false); - dialog.show(); - location = sessionManager.getLocationName(); - user_id = sessionManager.getCreatorID(); - if (isNetworkAvailable()) downloadFromParse(user_id, location); - else { - if (dialog != null) { - dialog.dismiss(); - } - // Toast.makeText(context, context.getString(R.string.no_network), Toast.LENGTH_SHORT).show(); //meera - } - } - - private Backup getBackupInstance() { - if (backup == null) backup = new Backup(); - return backup; - } - - private boolean isNetworkAvailable() { - ConnectivityManager connectivityManager - = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); - NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo(); - return activeNetworkInfo != null && activeNetworkInfo.isConnected(); - } - -// private int getQueueId() { -// String SELECTION = DelayedJobQueueProvider.JOB_TYPE + "=?"; -// String[] ARGS = new String[]{"syncDB"}; -// Cursor cursor = context.getContentResolver().query(DelayedJobQueueProvider.CONTENT_URI, null, SELECTION, ARGS, null); -// if (cursor != null && cursor.moveToFirst() && cursor.getCount() > 0) { -// return cursor.getColumnIndex(DelayedJobQueueProvider._ID); -// } else return -1; -// } -// -// private int addJobToQueue() { -// Log.d(TAG, "Adding to Queue"); -// String serviceCall = "syncDB"; -// // Add a new Delayed Job record -// ContentValues values = new ContentValues(); -// values.put(DelayedJobQueueProvider.JOB_TYPE, serviceCall); -// values.put(DelayedJobQueueProvider.JOB_PRIORITY, 1); -// values.put(DelayedJobQueueProvider.JOB_REQUEST_CODE, 0); -// values.put(DelayedJobQueueProvider.PATIENT_NAME, "Intelehealth"); -// values.put(DelayedJobQueueProvider.PATIENT_ID, 0); -// values.put(DelayedJobQueueProvider.SYNC_STATUS, 0); -// -// Uri uri = context.getContentResolver().insert( -// DelayedJobQueueProvider.CONTENT_URI, values); -// -// return Integer.valueOf(uri.getLastPathSegment()); -// -// } -// -// private void removeJobFromQueue(Integer queueId) { -// Log.d(TAG, "Removing from Queue"); -// if (queueId != null && queueId > -1) { -// String url = DelayedJobQueueProvider.URL + "/" + queueId; -// Uri uri = Uri.parse(url); -// int result = context.getContentResolver().delete(uri, null, null); -// if (result > 0) { -// Log.i(TAG, result + " row deleted"); -// } else { -// Log.e(TAG, "Database error while deleting row!"); -// -// } -// } -// } - - private void uploadToParse(File database, String user_id, String location, - final Integer queue_id) { - if (user_id != null && location != null) { - final ParseFile db_file = new ParseFile(database); - final ParseObject db_upload = new ParseObject("BackupDatabase"); - db_upload.put("db", db_file); - db_upload.put("user_id", user_id); - db_upload.put("location", location); - db_upload.put("deviceId", IntelehealthApplication.getAndroidId()); - - db_file.saveInBackground(new SaveCallback() { - @Override - public void done(ParseException e) { - if (e != null) { - //Failed Task -// if (queue_id == null || queue_id.equals(-1)) { -// addJobToQueue(); -// } - } - } - }, new ProgressCallback() { - @Override - public void done(Integer percentDone) { -// String newText = context.getString(R.string.database_uploading) + " - " + percentDone + "%"; -// mBuilder.setSmallIcon(R.mipmap.ic_launcher) -// .setContentTitle(newText) -// .setContentText(newText); -// mBuilder.setProgress(100, percentDone, false); -// mNotifyManager.notify(mId, mBuilder.build()); - Log.i(TAG, "done: " + percentDone); - AppConstants.notificationUtils.showNotificationProgress("DB Upload", "Database uploading", context, percentDone); - } - }); - - db_upload.saveInBackground(new SaveCallback() { - @Override - public void done(com.parse.ParseException e) { - if (e == null) { -// mBuilder.setSmallIcon(R.mipmap.ic_launcher) -// .setContentTitle(context.getString(R.string.database_upload)) -// .setContentText(context.getString(R.string.database_upload_complete)); -// mNotifyManager.notify(mId, mBuilder.build()); -// removeJobFromQueue(queue_id); -// if(dialog!=null) dialog.dismiss(); -// //Success -// if (queue_id != null && !queue_id.equals(-1)) { -// removeJobFromQueue(queue_id); -// } - AppConstants.notificationUtils.DownloadDone("DB Upload", "Database uplod completed", context); - } else { -// mBuilder.setSmallIcon(R.mipmap.ic_launcher) -// .setContentTitle(context.getString(R.string.database_upload)) -// .setContentText(context.getString(R.string.database_upload_failed)); -// mNotifyManager.notify(mId, mBuilder.build()); -// if(dialog!=null) dialog.dismiss(); -// //Failed Task -// if (queue_id == null || queue_id.equals(-1)) { -// addJobToQueue(); -// } - AppConstants.notificationUtils.DownloadDone("DB Upload", "Database uplod failed", context); - - } - } - }); - } - } - - private void downloadFromParse(String user_id, String location) { - if (user_id != null && location != null) { - ParseQuery query = ParseQuery.getQuery("BackupDatabase"); - query.whereEqualTo("deviceId", IntelehealthApplication.getAndroidId()); - query.orderByDescending("updatedAt"); - query.setLimit(1); - query.getFirstInBackground(new GetCallback() { - @Override - public void done(ParseObject object, ParseException e) { - if (object == null) { - dialog.dismiss(); - Toast.makeText(context, context.getString(R.string.db_backup_unavailable), Toast.LENGTH_SHORT).show(); - } else { - final ParseFile file = (ParseFile) object.get("db"); - file.getDataInBackground(new GetDataCallback() { - @Override - public void done(byte[] data, ParseException e) { - File myDir = new File(Environment.getExternalStorageDirectory() + File.separator + "InteleHealth_DB"); - if (myDir.exists()) { - } else { - myDir.mkdir(); - } - //file created inside internal memory, outside app package, doesnt delete if app is uninstalled -// String newfilepath = Environment.getExternalStorageDirectory() + File.separator + "InteleHealth_DB" + -// File.separator + "Intelehealth.db"; // directory: Intelehealth_DB , filename: Intelehealth.db - Log.d("newfilepath", AppConstants.dbfilepath); - File myfile = new File(AppConstants.dbfilepath); - if (myfile.exists()) myfile.delete(); - try { - myfile.createNewFile(); - FileOutputStream fileOutputStream = new FileOutputStream(myfile); - fileOutputStream.write(data); - fileOutputStream.close(); - boolean isSuccess = backup.createFileInMemory(context, false); - if (isSuccess) { - // Intent serviceIntent = new Intent(context, ImageDownloadService.class); - //context.getApplicationContext().startService(serviceIntent); //removed on 2018.07.18 - } - - } catch (FileNotFoundException exfnf) { - } catch (IOException exio) { - Toast.makeText(context, context.getString(R.string.db_file_write_error), Toast.LENGTH_SHORT).show(); - } finally { - dialog.dismiss(); - } - } - }); - } - } - }); - } - - } -} - diff --git a/app/src/main/java/io/intelehealth/client/utilities/exception/ActionException.java b/app/src/main/java/io/intelehealth/client/utilities/exception/ActionException.java old mode 100644 new mode 100755 diff --git a/app/src/main/java/io/intelehealth/client/utilities/exception/DAOException.java b/app/src/main/java/io/intelehealth/client/utilities/exception/DAOException.java old mode 100644 new mode 100755 index 2aa5f6a1c5..5aef8faefe --- a/app/src/main/java/io/intelehealth/client/utilities/exception/DAOException.java +++ b/app/src/main/java/io/intelehealth/client/utilities/exception/DAOException.java @@ -1,5 +1,7 @@ package io.intelehealth.client.utilities.exception; +import com.crashlytics.android.Crashlytics; + public class DAOException extends Exception { private static final long serialVersionUID = 1L; private Throwable thwStack; @@ -13,7 +15,7 @@ public DAOException(Exception excp) { public DAOException(String msg, Throwable e) { super(msg, e); setThwStack(e); - + Crashlytics.getInstance().core.logException(e); } public DAOException() { diff --git a/app/src/main/res/drawable-hdpi/ic_action_delete.png b/app/src/main/res/drawable-hdpi/ic_action_delete.png old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable-hdpi/ic_action_folder_open.png b/app/src/main/res/drawable-hdpi/ic_action_folder_open.png old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable-hdpi/ic_cloud_download.png b/app/src/main/res/drawable-hdpi/ic_cloud_download.png old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable-hdpi/ic_cloud_upload.png b/app/src/main/res/drawable-hdpi/ic_cloud_upload.png old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable-hdpi/ic_info_black_24dp.png b/app/src/main/res/drawable-hdpi/ic_info_black_24dp.png old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable-hdpi/ic_notifications_black_24dp.png b/app/src/main/res/drawable-hdpi/ic_notifications_black_24dp.png old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable-hdpi/ic_sync_black_24dp.png b/app/src/main/res/drawable-hdpi/ic_sync_black_24dp.png old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable-hdpi/intelehealth_i_icon_only.png b/app/src/main/res/drawable-hdpi/intelehealth_i_icon_only.png old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable-mdpi/ic_action_delete.png b/app/src/main/res/drawable-mdpi/ic_action_delete.png old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable-mdpi/ic_action_folder_open.png b/app/src/main/res/drawable-mdpi/ic_action_folder_open.png old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable-mdpi/ic_cloud_download.png b/app/src/main/res/drawable-mdpi/ic_cloud_download.png old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable-mdpi/ic_cloud_upload.png b/app/src/main/res/drawable-mdpi/ic_cloud_upload.png old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable-mdpi/ic_info_black_24dp.png b/app/src/main/res/drawable-mdpi/ic_info_black_24dp.png old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable-mdpi/ic_notifications_black_24dp.png b/app/src/main/res/drawable-mdpi/ic_notifications_black_24dp.png old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable-mdpi/ic_sync_black_24dp.png b/app/src/main/res/drawable-mdpi/ic_sync_black_24dp.png old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable-mdpi/intelehealth_i_icon_only.png b/app/src/main/res/drawable-mdpi/intelehealth_i_icon_only.png old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable-v21/ic_info_black_24dp.xml b/app/src/main/res/drawable-v21/ic_info_black_24dp.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable-v21/ic_notifications_black_24dp.xml b/app/src/main/res/drawable-v21/ic_notifications_black_24dp.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable-v21/ic_sync_black_24dp.xml b/app/src/main/res/drawable-v21/ic_sync_black_24dp.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable-xhdpi/ic_action_circle_green.png b/app/src/main/res/drawable-xhdpi/ic_action_circle_green.png old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable-xhdpi/ic_action_circle_red.png b/app/src/main/res/drawable-xhdpi/ic_action_circle_red.png old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable-xhdpi/ic_action_delete.png b/app/src/main/res/drawable-xhdpi/ic_action_delete.png old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable-xhdpi/ic_action_folder_open.png b/app/src/main/res/drawable-xhdpi/ic_action_folder_open.png old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable-xhdpi/ic_action_overflow_menu.png b/app/src/main/res/drawable-xhdpi/ic_action_overflow_menu.png old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable-xhdpi/ic_cloud_download.png b/app/src/main/res/drawable-xhdpi/ic_cloud_download.png old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable-xhdpi/ic_cloud_upload.png b/app/src/main/res/drawable-xhdpi/ic_cloud_upload.png old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable-xhdpi/ic_info_black_24dp.png b/app/src/main/res/drawable-xhdpi/ic_info_black_24dp.png old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable-xhdpi/ic_notifications_black_24dp.png b/app/src/main/res/drawable-xhdpi/ic_notifications_black_24dp.png old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable-xhdpi/ic_sync_black_24dp.png b/app/src/main/res/drawable-xhdpi/ic_sync_black_24dp.png old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable-xhdpi/intelehealth_i_icon_only.png b/app/src/main/res/drawable-xhdpi/intelehealth_i_icon_only.png old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_delete.png b/app/src/main/res/drawable-xxhdpi/ic_action_delete.png old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_folder_open.png b/app/src/main/res/drawable-xxhdpi/ic_action_folder_open.png old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable-xxhdpi/ic_cloud_download.png b/app/src/main/res/drawable-xxhdpi/ic_cloud_download.png old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable-xxhdpi/ic_cloud_upload.png b/app/src/main/res/drawable-xxhdpi/ic_cloud_upload.png old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable-xxhdpi/ic_info_black_24dp.png b/app/src/main/res/drawable-xxhdpi/ic_info_black_24dp.png old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable-xxhdpi/ic_notifications_black_24dp.png b/app/src/main/res/drawable-xxhdpi/ic_notifications_black_24dp.png old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable-xxhdpi/ic_sync_black_24dp.png b/app/src/main/res/drawable-xxhdpi/ic_sync_black_24dp.png old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable-xxxhdpi/ic_action_delete.png b/app/src/main/res/drawable-xxxhdpi/ic_action_delete.png old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable-xxxhdpi/ic_action_folder_open.png b/app/src/main/res/drawable-xxxhdpi/ic_action_folder_open.png old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable-xxxhdpi/ic_cloud_download.png b/app/src/main/res/drawable-xxxhdpi/ic_cloud_download.png old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable-xxxhdpi/ic_cloud_upload.png b/app/src/main/res/drawable-xxxhdpi/ic_cloud_upload.png old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable-xxxhdpi/ic_info_black_24dp.png b/app/src/main/res/drawable-xxxhdpi/ic_info_black_24dp.png old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable-xxxhdpi/ic_notifications_black_24dp.png b/app/src/main/res/drawable-xxxhdpi/ic_notifications_black_24dp.png old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable-xxxhdpi/ic_sync_black_24dp.png b/app/src/main/res/drawable-xxxhdpi/ic_sync_black_24dp.png old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/avatar.png b/app/src/main/res/drawable/avatar.png new file mode 100755 index 0000000000..99bf4d84ad Binary files /dev/null and b/app/src/main/res/drawable/avatar.png differ diff --git a/app/src/main/res/drawable/background_splash.xml b/app/src/main/res/drawable/background_splash.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/blank_checkbox.xml b/app/src/main/res/drawable/blank_checkbox.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/block.png b/app/src/main/res/drawable/block.png new file mode 100755 index 0000000000..2fe2343eee Binary files /dev/null and b/app/src/main/res/drawable/block.png differ diff --git a/app/src/main/res/drawable/button_bg_rounded_corners.xml b/app/src/main/res/drawable/button_bg_rounded_corners.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/buttonshape.xml b/app/src/main/res/drawable/buttonshape.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/checkbox.xml b/app/src/main/res/drawable/checkbox.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/circle.xml b/app/src/main/res/drawable/circle.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/complaint_selector.xml b/app/src/main/res/drawable/complaint_selector.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/country_flag_icon.xml b/app/src/main/res/drawable/country_flag_icon.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/diagnostic_tests_button.png b/app/src/main/res/drawable/diagnostic_tests_button.png old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/download.xml b/app/src/main/res/drawable/download.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/econiomic_status_icon.xml b/app/src/main/res/drawable/econiomic_status_icon.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/edit_button_icon.xml b/app/src/main/res/drawable/edit_button_icon.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/edit_icon.xml b/app/src/main/res/drawable/edit_icon.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/education_icon.xml b/app/src/main/res/drawable/education_icon.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/event_icon.xml b/app/src/main/res/drawable/event_icon.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/female_icon.xml b/app/src/main/res/drawable/female_icon.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/find_patients_button.png b/app/src/main/res/drawable/find_patients_button.png old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/green_button.xml b/app/src/main/res/drawable/green_button.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/green_check.png b/app/src/main/res/drawable/green_check.png old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/grey_check.png b/app/src/main/res/drawable/grey_check.png old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/handwash_in_red.png b/app/src/main/res/drawable/handwash_in_red.png old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/home_icon.xml b/app/src/main/res/drawable/home_icon.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/i_logo.gif b/app/src/main/res/drawable/i_logo.gif old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/ic_account_box_black_24dp.xml b/app/src/main/res/drawable/ic_account_box_black_24dp.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/ic_add_24dp.xml b/app/src/main/res/drawable/ic_add_24dp.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/ic_android_black_24dp.xml b/app/src/main/res/drawable/ic_android_black_24dp.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/ic_aspect_ratio.xml b/app/src/main/res/drawable/ic_aspect_ratio.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/ic_calendar_intele_24dp.xml b/app/src/main/res/drawable/ic_calendar_intele_24dp.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/ic_camera.xml b/app/src/main/res/drawable/ic_camera.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/ic_cloud_done.xml b/app/src/main/res/drawable/ic_cloud_done.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/ic_cloud_done_black.xml b/app/src/main/res/drawable/ic_cloud_done_black.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/ic_cloud_upload_v.xml b/app/src/main/res/drawable/ic_cloud_upload_v.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/ic_create_24dp.xml b/app/src/main/res/drawable/ic_create_24dp.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/ic_done_24dp.xml b/app/src/main/res/drawable/ic_done_24dp.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/ic_education_status_intele.xml b/app/src/main/res/drawable/ic_education_status_intele.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/ic_event_black_24dp.xml b/app/src/main/res/drawable/ic_event_black_24dp.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/ic_female_intele_18dp.xml b/app/src/main/res/drawable/ic_female_intele_18dp.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/ic_file_download_black_48px.xml b/app/src/main/res/drawable/ic_file_download_black_48px.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/ic_file_download_white_48px.xml b/app/src/main/res/drawable/ic_file_download_white_48px.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/ic_file_upload_white_48px.xml b/app/src/main/res/drawable/ic_file_upload_white_48px.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/ic_flag_black_24dp.xml b/app/src/main/res/drawable/ic_flag_black_24dp.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/ic_flash_auto.xml b/app/src/main/res/drawable/ic_flash_auto.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/ic_flash_off.xml b/app/src/main/res/drawable/ic_flash_off.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/ic_flash_on.xml b/app/src/main/res/drawable/ic_flash_on.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/ic_group_24dp.xml b/app/src/main/res/drawable/ic_group_24dp.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/ic_home_black_18dp.xml b/app/src/main/res/drawable/ic_home_black_18dp.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/ic_home_white_48px.xml b/app/src/main/res/drawable/ic_home_white_48px.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/ic_info_black_24dp.xml b/app/src/main/res/drawable/ic_info_black_24dp.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/ic_launcher.png b/app/src/main/res/drawable/ic_launcher.png old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/ic_launcher_background.xml b/app/src/main/res/drawable/ic_launcher_background.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/ic_lock_black_24dp.xml b/app/src/main/res/drawable/ic_lock_black_24dp.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/ic_male_gender_intele_18dp.xml b/app/src/main/res/drawable/ic_male_gender_intele_18dp.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/ic_mode_edit.xml b/app/src/main/res/drawable/ic_mode_edit.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/ic_mode_edit_white_48px.xml b/app/src/main/res/drawable/ic_mode_edit_white_48px.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/ic_notifications_black_24dp.xml b/app/src/main/res/drawable/ic_notifications_black_24dp.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/ic_password_visibility.xml b/app/src/main/res/drawable/ic_password_visibility.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/ic_password_visibility_off.xml b/app/src/main/res/drawable/ic_password_visibility_off.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/ic_password_visibility_selector.xml b/app/src/main/res/drawable/ic_password_visibility_selector.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/ic_person_add_24dp.xml b/app/src/main/res/drawable/ic_person_add_24dp.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/ic_person_black_18dp.xml b/app/src/main/res/drawable/ic_person_black_18dp.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/ic_person_black_24dp.xml b/app/src/main/res/drawable/ic_person_black_24dp.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/ic_person_camera_intele.xml b/app/src/main/res/drawable/ic_person_camera_intele.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/ic_phone_black_18dp.xml b/app/src/main/res/drawable/ic_phone_black_18dp.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/ic_play_circle_filled_black_24dp.xml b/app/src/main/res/drawable/ic_play_circle_filled_black_24dp.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/ic_print_24dp.xml b/app/src/main/res/drawable/ic_print_24dp.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/ic_refresh_white_24px.xml b/app/src/main/res/drawable/ic_refresh_white_24px.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/ic_rupee_1_18dp.xml b/app/src/main/res/drawable/ic_rupee_1_18dp.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/ic_scale_1.xml b/app/src/main/res/drawable/ic_scale_1.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/ic_scale_2.xml b/app/src/main/res/drawable/ic_scale_2.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/ic_scale_3.xml b/app/src/main/res/drawable/ic_scale_3.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/ic_scale_4.xml b/app/src/main/res/drawable/ic_scale_4.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/ic_scale_5.xml b/app/src/main/res/drawable/ic_scale_5.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/ic_search_24dp.xml b/app/src/main/res/drawable/ic_search_24dp.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/ic_sort_white_24dp.xml b/app/src/main/res/drawable/ic_sort_white_24dp.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/ic_state_intele_new_18dp.xml b/app/src/main/res/drawable/ic_state_intele_new_18dp.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/ic_switch_camera.xml b/app/src/main/res/drawable/ic_switch_camera.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/ic_sync_black_24dp.xml b/app/src/main/res/drawable/ic_sync_black_24dp.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/ic_translate_black_24dp.xml b/app/src/main/res/drawable/ic_translate_black_24dp.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/ic_work_black_18dp.xml b/app/src/main/res/drawable/ic_work_black_18dp.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/male_icon.xml b/app/src/main/res/drawable/male_icon.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/new_patient_button.png b/app/src/main/res/drawable/new_patient_button.png old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/occupation_icon.xml b/app/src/main/res/drawable/occupation_icon.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/person300px.png b/app/src/main/res/drawable/person300px.png old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/person_icon.xml b/app/src/main/res/drawable/person_icon.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/phone_icon.xml b/app/src/main/res/drawable/phone_icon.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/purple_background_splashscreen.png b/app/src/main/res/drawable/purple_background_splashscreen.png old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/purpler_solid_background.png b/app/src/main/res/drawable/purpler_solid_background.png old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/state_list_icon.xml b/app/src/main/res/drawable/state_list_icon.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/drawable/tab_bg.xml b/app/src/main/res/drawable/tab_bg.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/layout-land/activity_camera.xml b/app/src/main/res/layout-land/activity_camera.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/layout-land/fragment_video_library.xml b/app/src/main/res/layout-land/fragment_video_library.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/layout/activity_active_patient.xml b/app/src/main/res/layout/activity_active_patient.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/layout/activity_additional_documents.xml b/app/src/main/res/layout/activity_additional_documents.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/layout/activity_camera.xml b/app/src/main/res/layout/activity_camera.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/layout/activity_complaint_node.xml b/app/src/main/res/layout/activity_complaint_node.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/layout/activity_family_history.xml b/app/src/main/res/layout/activity_family_history.xml old mode 100644 new mode 100755 diff --git a/app/src/main/res/layout/activity_home.xml b/app/src/main/res/layout/activity_home.xml index cb6a206d97..819c87ad1b 100644 --- a/app/src/main/res/layout/activity_home.xml +++ b/app/src/main/res/layout/activity_home.xml @@ -8,21 +8,6 @@ android:layout_height="match_parent" tools:context=".activities.homeActivity.HomeActivity"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + android:layout_height="wrap_content" + android:orientation="vertical" + android:padding="16dp"> - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -83,44 +249,49 @@ android:layout_height="wrap_content" android:padding="16dp"> - - - - - - - - - -