From 556dc43d21c19d0869becd46bc6884c62a4108f6 Mon Sep 17 00:00:00 2001 From: Thanachai Thongkum X1 Carbon2017 Date: Tue, 21 Jul 2020 13:53:06 +0700 Subject: [PATCH 1/9] update Entity.kt allow user --- src/main/kotlin/ffc/entity/Entity.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/kotlin/ffc/entity/Entity.kt b/src/main/kotlin/ffc/entity/Entity.kt index e36bc03..c777bd6 100644 --- a/src/main/kotlin/ffc/entity/Entity.kt +++ b/src/main/kotlin/ffc/entity/Entity.kt @@ -30,6 +30,8 @@ open class Entity(id: String = generateTempId()) : Cloneable { val type = javaClass.simpleName var timestamp: DateTime = DateTime.now() internal set + var allowUserId = mutableListOf() + @JsonExclude val bundle: ConcurrentHashMap = ConcurrentHashMap() From 61f375507982976d33e3cca7b812ab0947fa74fa Mon Sep 17 00:00:00 2001 From: Thanachai Thongkum X1 Carbon2017 Date: Tue, 21 Jul 2020 13:56:43 +0700 Subject: [PATCH 2/9] update test --- src/test/kotlin/ffc/entity/PersonTest.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/kotlin/ffc/entity/PersonTest.kt b/src/test/kotlin/ffc/entity/PersonTest.kt index 57cfa8e..e328afe 100644 --- a/src/test/kotlin/ffc/entity/PersonTest.kt +++ b/src/test/kotlin/ffc/entity/PersonTest.kt @@ -118,7 +118,7 @@ class PersonTest { with(copyPerson) { id `should be` "piruin" name `should equal` "นายพิรุณ พานิชผล" - age `should be` 25 + age `should be` 27 } } From faf98083d81f2a394f71a61e80fb9d7cbb42e2eb Mon Sep 17 00:00:00 2001 From: Thanachai Thongkum X1 Carbon2017 Date: Mon, 27 Jul 2020 20:49:43 +0700 Subject: [PATCH 3/9] add tags --- src/main/kotlin/ffc/entity/Entity.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/ffc/entity/Entity.kt b/src/main/kotlin/ffc/entity/Entity.kt index c777bd6..0d598fe 100644 --- a/src/main/kotlin/ffc/entity/Entity.kt +++ b/src/main/kotlin/ffc/entity/Entity.kt @@ -30,7 +30,8 @@ open class Entity(id: String = generateTempId()) : Cloneable { val type = javaClass.simpleName var timestamp: DateTime = DateTime.now() internal set - var allowUserId = mutableListOf() + var allowUserId = mutableSetOf() + var tags = mutableSetOf() @JsonExclude val bundle: ConcurrentHashMap = ConcurrentHashMap() From c5a1562615013b928407dfaa005ee2f47b6b8b62 Mon Sep 17 00:00:00 2001 From: Thanachai Thongkum X1 Carbon2017 Date: Wed, 5 Aug 2020 22:29:59 +0700 Subject: [PATCH 4/9] add sugar lab --- src/main/kotlin/ffc/entity/healthcare/HealthCareService.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/kotlin/ffc/entity/healthcare/HealthCareService.kt b/src/main/kotlin/ffc/entity/healthcare/HealthCareService.kt index 2d637b7..883f781 100644 --- a/src/main/kotlin/ffc/entity/healthcare/HealthCareService.kt +++ b/src/main/kotlin/ffc/entity/healthcare/HealthCareService.kt @@ -44,6 +44,7 @@ open class HealthCareService( var pulseRate: Double? = null var respiratoryRate: Double? = null var bodyTemperature: Double? = null + var sugarLab: Double? = null var diagnosises: MutableList = mutableListOf() var note: String? = null var photosUrl: URLs = URLs() From 36752146c7eaf36bdcef4cd9a583ea1416ab27ba Mon Sep 17 00:00:00 2001 From: Thanachai Thongkum X1 Carbon2017 Date: Thu, 6 Aug 2020 11:33:15 +0700 Subject: [PATCH 5/9] add Behavior.kt --- build.gradle.kts | 1 + src/main/kotlin/ffc/entity/Person.kt | 2 ++ .../kotlin/ffc/entity/healthcare/Behavior.kt | 29 +++++++++++++++++++ 3 files changed, 32 insertions(+) create mode 100644 src/main/kotlin/ffc/entity/healthcare/Behavior.kt diff --git a/build.gradle.kts b/build.gradle.kts index 295424a..d7a8d9d 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -31,6 +31,7 @@ repositories { dependencies { implementation(kotlin("stdlib-jdk7")) + // implementation("ca.uhn.hapi.fhir:org.hl7.fhir.r4:5.0.19") implementation("joda-time:joda-time:2.9.9") implementation("com.github.piruin.geok:geok:1.0.0") implementation("com.github.piruin.geok:geok-gson:1.0.0") diff --git a/src/main/kotlin/ffc/entity/Person.kt b/src/main/kotlin/ffc/entity/Person.kt index efc0f99..d787e83 100644 --- a/src/main/kotlin/ffc/entity/Person.kt +++ b/src/main/kotlin/ffc/entity/Person.kt @@ -17,6 +17,7 @@ package ffc.entity +import ffc.entity.healthcare.Behavior import ffc.entity.healthcare.Chronic import ffc.entity.healthcare.Disability import ffc.entity.healthcare.Disease @@ -44,6 +45,7 @@ class Person( var chronics = mutableListOf() var disabilities = mutableListOf() val haveChronic: Boolean get() = chronics.firstOrNull { it.isActive } != null + var behavior: Behavior? = null var avatarUrl: String? = null set(url) { if (url != null) checkValidUrl(url) diff --git a/src/main/kotlin/ffc/entity/healthcare/Behavior.kt b/src/main/kotlin/ffc/entity/healthcare/Behavior.kt new file mode 100644 index 0000000..e6004d1 --- /dev/null +++ b/src/main/kotlin/ffc/entity/healthcare/Behavior.kt @@ -0,0 +1,29 @@ +package ffc.entity.healthcare + +import org.joda.time.DateTime + +data class Behavior( + var ciga: Frequency? = null, + var wisky: Frequency? = null, + var exercise: Frequency? = null, + var bigaccidentever: Frequency? = null, + var tonic: Frequency? = null, + var habitfoming: Frequency? = null, + var drugbyyourseft: Frequency? = null, + var sugar: Frequency? = null, + var salt: Frequency? = null +) { + var timestamp: DateTime = DateTime.now() + internal set +} + +fun Behavior.update( + timestamp: DateTime = DateTime.now(), + block: Behavior.() -> Unit +): Behavior { + with(this) { + this.timestamp = timestamp + apply(block) + } + return this +} From f3728b387c45a740e820af97ea99fd09adce44ef Mon Sep 17 00:00:00 2001 From: Thanachai Thongkum X1 Carbon2017 Date: Sat, 8 Aug 2020 11:50:44 +0700 Subject: [PATCH 6/9] add Behavior.kt --- .../kotlin/ffc/entity/healthcare/Behavior.kt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/kotlin/ffc/entity/healthcare/Behavior.kt b/src/main/kotlin/ffc/entity/healthcare/Behavior.kt index e6004d1..9a3532f 100644 --- a/src/main/kotlin/ffc/entity/healthcare/Behavior.kt +++ b/src/main/kotlin/ffc/entity/healthcare/Behavior.kt @@ -3,15 +3,15 @@ package ffc.entity.healthcare import org.joda.time.DateTime data class Behavior( - var ciga: Frequency? = null, - var wisky: Frequency? = null, + var smoke: Frequency? = null, + var alcohol: Frequency? = null, var exercise: Frequency? = null, - var bigaccidentever: Frequency? = null, - var tonic: Frequency? = null, - var habitfoming: Frequency? = null, - var drugbyyourseft: Frequency? = null, - var sugar: Frequency? = null, - var salt: Frequency? = null + var bigaccidentever: Boolean? = null, + var tonic: Boolean? = null, + var habitfoming: Boolean? = null, + var drugbyyourseft: Boolean? = null, + var sugar: Boolean? = null, + var salt: Boolean? = null ) { var timestamp: DateTime = DateTime.now() internal set From e6a319473e73f5167766bd72b77e8c8e95adfa55 Mon Sep 17 00:00:00 2001 From: Thanachai Thongkum X1 Carbon2017 Date: Fri, 21 Aug 2020 15:19:11 +0700 Subject: [PATCH 7/9] =?UTF-8?q?=E0=B8=9E=E0=B8=B5=E0=B9=88=E0=B9=82?= =?UTF-8?q?=E0=B8=A5=E0=B9=88=E0=B9=83=E0=B8=AB=E0=B9=89=E0=B9=80=E0=B8=AD?= =?UTF-8?q?=E0=B8=B2=20age=20=E0=B8=AD=E0=B8=AD=E0=B8=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/kotlin/ffc/entity/Person.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/ffc/entity/Person.kt b/src/main/kotlin/ffc/entity/Person.kt index d787e83..c704e0b 100644 --- a/src/main/kotlin/ffc/entity/Person.kt +++ b/src/main/kotlin/ffc/entity/Person.kt @@ -82,11 +82,11 @@ class Person( val relate: Relate, val id: String, val name: String, - val age: Int? = null, + val birthDate: LocalDate? = null, val avatarUrl: String? = null ) : Cloneable { - constructor(type: Relate, with: Person) : this(type, with.id, with.name, with.age, with.avatarUrl) + constructor(type: Relate, with: Person) : this(type, with.id, with.name, with.birthDate, with.avatarUrl) fun copy(): Relationship = clone() as Relationship } From 3a5a968ac8bf9b9e9675a534a28e6bd57ad52b94 Mon Sep 17 00:00:00 2001 From: Thanachai Thongkum X1 Carbon2017 Date: Fri, 21 Aug 2020 15:22:27 +0700 Subject: [PATCH 8/9] update oraclejdk to openjdk --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 189f952..55e03d2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ language: java -jdk: oraclejdk8 +jdk: openjdk8 before_cache: - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock From 4714477e6fc9e60fa79254dc29be6b274b2134c0 Mon Sep 17 00:00:00 2001 From: Max-PC Date: Mon, 24 Aug 2020 06:57:44 +0700 Subject: [PATCH 9/9] Deprecated age in relation --- src/main/kotlin/ffc/entity/Person.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/ffc/entity/Person.kt b/src/main/kotlin/ffc/entity/Person.kt index c704e0b..2f15e49 100644 --- a/src/main/kotlin/ffc/entity/Person.kt +++ b/src/main/kotlin/ffc/entity/Person.kt @@ -82,11 +82,12 @@ class Person( val relate: Relate, val id: String, val name: String, - val birthDate: LocalDate? = null, + @Deprecated("ยกเลิกใช้งาน") + val age: Int? = null, val avatarUrl: String? = null ) : Cloneable { - constructor(type: Relate, with: Person) : this(type, with.id, with.name, with.birthDate, with.avatarUrl) + constructor(type: Relate, with: Person) : this(type, with.id, with.name, with.age, with.avatarUrl) fun copy(): Relationship = clone() as Relationship }