Skip to content

Commit

Permalink
Add positive conditions and negative conditions are for Associated sy…
Browse files Browse the repository at this point in the history
…mptoms
  • Loading branch information
dipaliintelehealth committed Oct 10, 2022
1 parent ac62183 commit 903f293
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 9 deletions.
11 changes: 11 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"@ng-bootstrap/ng-bootstrap": "^12.1.2",
"@popperjs/core": "^2.10.2",
"@sniptt/monads": "^0.5.10",
"angular-bootstrap-autocomplete": "^1.0.1",
"angular-material": "^1.2.5",
"angular-mindmap": "^0.1.0",
"bootstrap": "^5.1.3",
Expand Down
5 changes: 4 additions & 1 deletion src/app/addhealthdata/addhealthdata.component.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@

.text-danger{
color: red;
}
font-weight: bold;
}

13 changes: 9 additions & 4 deletions src/app/addhealthdata/addhealthdata.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@
name="txtText"
formControlName="txtText"
[(ngModel)]="addData.text"
list="symptomList"
(change)="onTextSelection($event)"
/>
<datalist id="symptomList">
<option value="Associated symptoms"></option>
</datalist>
<label for="txtText">Text</label>
</div>

Expand Down Expand Up @@ -102,7 +107,7 @@
[(ngModel)]="addData.age_min"
#txtAgeMin
>
<option *ngFor="let age of ages">{{ age }}</option>
<option *ngFor="let age of ages" [ngValue]="age">{{ age }}</option>
</select>
<label for="txtAgeMin">Age Min</label>
<!-- <p class="text-danger">Min age must be less than Max age</p>-->
Expand All @@ -116,15 +121,15 @@
[(ngModel)]="addData.age_max"
#txtAgeMax
>
<option *ngFor="let age of ages">{{ age }}</option>
<option *ngFor="let age of ages" [ngValue]="age">{{ age }}</option>
</select>

<label for="txtAgeMax">Age Max</label>
<p class="text-danger" *ngIf="myForm.hasError('invalidDateRange')">
Max age must be greater than Min age
</p>
</div>
<div class="form-floating mb-3">
<div class="form-floating mb-3" *ngIf="positiveCondition">
<input
type="text"
class="form-control"
Expand All @@ -136,7 +141,7 @@
/>
<label for="txtPosCon">Positive Condition</label>
</div>
<div class="form-floating mb-3">
<div class="form-floating mb-3" *ngIf="negativeCondition">
<input
type="text"
class="form-control"
Expand Down
12 changes: 11 additions & 1 deletion src/app/addhealthdata/addhealthdata.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,24 @@ export class AddhealthdataComponent implements OnInit {

{ validators: AgeCompareValidator }
);

positiveCondition: boolean = false;
negativeCondition: boolean = false;
constructor() {
for (var i = 1; i <= 120; i++) {
this.ages.push(i);
}
}

ngOnInit() {}
onTextSelection(e: any) {
if (e.target.value.toLowerCase() == 'Associated symptoms'.toLowerCase()) {
this.positiveCondition = true;
this.negativeCondition = true;
} else {
this.positiveCondition = false;
this.negativeCondition = false;
}
}
onSubmit() {
this.addData.id = Math.random().toString();
this.onSave.emit(this.addData);
Expand Down
1 change: 1 addition & 0 deletions src/app/edithealthdata/edithealthdata.component.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.text-danger{
color: red;
font-weight: bold;
}
10 changes: 7 additions & 3 deletions src/app/edithealthdata/edithealthdata.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@
name="txtText"
[(ngModel)]="healthdata.text"
formControlName="txtText"
list="symptomList"
(change)="onTextSelection($event)"
/>
<datalist id="symptomList">
<option value="Associated symptoms"></option>
</datalist>
<label for="txtText">Text</label>
</div>

Expand Down Expand Up @@ -101,10 +106,9 @@
[(ngModel)]="healthdata.age_min"
#txtAgeMin
>
<option *ngFor="let age of ages">{{ age }}</option>
<option *ngFor="let age of ages" [ngValue]="age">{{ age }}</option>
</select>
<label for="txtAgeMin">Age Min</label>
<!--<p class="text-danger">Min age must be less than Max age</p>-->
</div>
<div class="form-floating mb-3">
<select
Expand All @@ -115,7 +119,7 @@
#txtAgeMax
formControlName="txtAgeMax"
>
<option *ngFor="let age of ages">{{ age }}</option>
<option *ngFor="let age of ages" [ngValue]="age">{{ age }}</option>
</select>
<label for="txtAgeMax">Age Max</label>
<p class="text-danger" *ngIf="myForm.hasError('invalidDateRange')">
Expand Down
11 changes: 11 additions & 0 deletions src/app/edithealthdata/edithealthdata.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,17 @@ export class EdithealthdataComponent implements OnInit {
this.negativeCondition = false;
}
}

onTextSelection(e: any) {
if (e.target.value.toLowerCase() == 'Associated symptoms'.toLowerCase()) {
this.positiveCondition = true;
this.negativeCondition = true;
} else {
this.positiveCondition = false;
this.negativeCondition = false;
}
}

onSubmit() {
this.onEdit.emit(this.healthdata);
}
Expand Down

0 comments on commit 903f293

Please sign in to comment.