liufuhua007

2 version add patient view

1 +package com.sw.laryngoscope.FHIR.fragment;
2 +
3 +
4 +import android.content.Context;
5 +import android.provider.Settings;
6 +import android.text.Editable;
7 +import android.text.TextWatcher;
8 +import android.view.KeyEvent;
9 +import android.view.LayoutInflater;
10 +import android.view.View;
11 +import android.view.ViewGroup;
12 +import android.view.inputmethod.EditorInfo;
13 +import android.view.inputmethod.InputMethodManager;
14 +import android.widget.RadioGroup;
15 +import android.widget.TextView;
16 +
17 +import com.sw.laryngoscope.R;
18 +import com.sw.laryngoscope.activity.BaseFragment;
19 +import com.sw.laryngoscope.activity.CustomTimer;
20 +import com.sw.laryngoscope.activity.HomeActivity;
21 +import com.sw.laryngoscope.databinding.FgSettingFhirBinding;
22 +import com.sw.laryngoscope.manager.SpManager;
23 +import com.sw.laryngoscope.utils.Logger;
24 +
25 +
26 +public class FhirSettingFragment extends BaseFragment<FgSettingFhirBinding> implements CustomTimer.TimerCallBack,
27 + RadioGroup.OnCheckedChangeListener,View.OnClickListener {
28 +
29 + private static final String TAG = "FhirFragment";
30 + private InputMethodManager imm;
31 +
32 + @Override
33 + public void onAttach(Context context) {
34 + super.onAttach(context);
35 + homeActivity = (HomeActivity) context;
36 + imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
37 + }
38 +
39 + @Override
40 + public void onResume() {
41 + super.onResume();
42 + Logger.d(TAG, "======showFragment======2");
43 + }
44 +
45 + @Override
46 + public void onHiddenChanged(boolean hidden) {
47 + super.onHiddenChanged(hidden);
48 + if (!hidden) {
49 + /*homeActivity.changeViewPage();
50 + homeActivity.headIconStateChange(0);*/
51 + initValue();
52 + } else {
53 + }
54 + hideIm();
55 + Logger.d(TAG, "======showFragment======2 " + hidden);
56 + }
57 +
58 + @Override
59 + protected FgSettingFhirBinding getViewBinding(LayoutInflater inflater, ViewGroup container) {
60 + return FgSettingFhirBinding.inflate(inflater,container,false);
61 + }
62 +
63 + @Override
64 + protected void init() {
65 + //layout_home_home_guest = (ConstraintLayout) rootView.findViewById(R.id.layout_home_home_guest);
66 + initValue();
67 + }
68 +
69 + public void initValue() {
70 + if ( !SpManager.get_fhir_hostname().isEmpty() ) {
71 + binding.edAeName.setText(SpManager.get_fhir_hostname());
72 + }
73 + }
74 +
75 + @Override
76 + protected void setListener() {
77 + binding.edAeName.setOnEditorActionListener(new TextView.OnEditorActionListener() {
78 + @Override
79 + public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
80 + if (actionId == EditorInfo.IME_ACTION_DONE) {
81 + if (imm != null) {
82 + imm.hideSoftInputFromWindow(binding.edAeName.getWindowToken(), 0);
83 + }
84 + String str = binding.edAeName.getText().toString().trim();
85 + if (str.trim().length() <= 0) {
86 + return false;
87 + }
88 + SpManager.set_fhir_hostname(str);
89 + }
90 + return false;
91 + }
92 + });
93 + binding.edAeName.addTextChangedListener(new TextWatcher() {
94 + @Override
95 + public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
96 + @Override
97 + public void onTextChanged(CharSequence s, int start, int before, int count) {}
98 + @Override
99 + public void afterTextChanged(Editable s) {}
100 + });
101 + }
102 +
103 + @Override
104 + public void onClick(View v) {
105 + switch (v.getId()) {
106 + default:
107 + break;
108 + }
109 + }
110 +
111 + @Override
112 + public void onCheckedChanged(RadioGroup radioGroup, int i) {
113 + switch (radioGroup.getCheckedRadioButtonId()) {
114 + }
115 + }
116 +
117 + public void hideIm() {
118 + InputMethodManager imm = (InputMethodManager) homeActivity.getSystemService(Context.INPUT_METHOD_SERVICE);
119 + imm.hideSoftInputFromWindow(homeActivity.getWindow().getDecorView().getWindowToken(), 0);
120 + }
121 +
122 + @Override
123 + public void onDestroy() {
124 + super.onDestroy();
125 + }
126 +
127 + @Override
128 + public void timerComply(long lastTime, String tag) {
129 + }
130 +
131 + @Override
132 + public void backMainAct() {}
133 +
134 + @Override
135 + public boolean startEnable() {
136 + return false;
137 + }
138 +
139 +}
...\ No newline at end of file ...\ No newline at end of file
...@@ -9,6 +9,7 @@ import android.widget.FrameLayout; ...@@ -9,6 +9,7 @@ import android.widget.FrameLayout;
9 import android.widget.RadioButton; 9 import android.widget.RadioButton;
10 import android.widget.RadioGroup; 10 import android.widget.RadioGroup;
11 11
12 +import com.sw.laryngoscope.FHIR.fragment.FhirSettingFragment;
12 import com.sw.laryngoscope.R; 13 import com.sw.laryngoscope.R;
13 import com.sw.laryngoscope.activity.BaseFragment; 14 import com.sw.laryngoscope.activity.BaseFragment;
14 import com.sw.laryngoscope.activity.CustomTimer; 15 import com.sw.laryngoscope.activity.CustomTimer;
...@@ -37,6 +38,7 @@ public class SettingFragment extends BaseFragment<FgSettingBinding> implements C ...@@ -37,6 +38,7 @@ public class SettingFragment extends BaseFragment<FgSettingBinding> implements C
37 public TimeDateFragment timeDateFragment; 38 public TimeDateFragment timeDateFragment;
38 public NetWorkFragment netWorkFragment; 39 public NetWorkFragment netWorkFragment;
39 public DicomFragment dicomFragment; 40 public DicomFragment dicomFragment;
41 + public FhirSettingFragment fhirSettingFragment;
40 public GeneralFragment generalFragment; 42 public GeneralFragment generalFragment;
41 public DevInfoFragment devInfoFragment; 43 public DevInfoFragment devInfoFragment;
42 public LogExportFragment logExportFragment; 44 public LogExportFragment logExportFragment;
...@@ -176,6 +178,18 @@ public class SettingFragment extends BaseFragment<FgSettingBinding> implements C ...@@ -176,6 +178,18 @@ public class SettingFragment extends BaseFragment<FgSettingBinding> implements C
176 } 178 }
177 showFragment(dicomFragment); 179 showFragment(dicomFragment);
178 break; 180 break;
181 + case R.id.rb_fhir:
182 + Logger.d(TAG, "======showFragment======rb_fhir");
183 + if (fhirSettingFragment == null) {
184 + fhirSettingFragment = new FhirSettingFragment();
185 + fhirSettingFragment.setHomeActivity(homeActivity);
186 + fhirSettingFragment.setHomeFragment(this);
187 + getChildFragmentManager().beginTransaction()
188 + .add(R.id.setting_fragment, fhirSettingFragment)
189 + .commit();
190 + }
191 + showFragment(fhirSettingFragment);
192 + break;
179 case R.id.rb_general_settings: 193 case R.id.rb_general_settings:
180 Logger.d(TAG, "======showFragment======rb_general_settings"); 194 Logger.d(TAG, "======showFragment======rb_general_settings");
181 if (generalFragment == null) { 195 if (generalFragment == null) {
......
...@@ -86,6 +86,8 @@ public class SpManager { ...@@ -86,6 +86,8 @@ public class SpManager {
86 public static final String DICOM_HOST_NAME = "dicom_host_name"; 86 public static final String DICOM_HOST_NAME = "dicom_host_name";
87 public static final String DICOM_PORT = "dicom_port"; 87 public static final String DICOM_PORT = "dicom_port";
88 88
89 + public static final String FHIR_HOSTNAME = "fhir_host_name";
90 +
89 public static final String FILE_SHOW_TIME = "file_show_time"; 91 public static final String FILE_SHOW_TIME = "file_show_time";
90 92
91 public static final String COPY_FILE_TYPE = "copy_file_type"; 93 public static final String COPY_FILE_TYPE = "copy_file_type";
...@@ -314,9 +316,18 @@ public class SpManager { ...@@ -314,9 +316,18 @@ public class SpManager {
314 public static String get_dev_ae_name() { 316 public static String get_dev_ae_name() {
315 return StorageParam.getParam(DICOM_DEV_AE_NAME, ""); 317 return StorageParam.getParam(DICOM_DEV_AE_NAME, "");
316 } 318 }
319 +
320 + public static String get_fhir_hostname() {
321 + return StorageParam.getParam(FHIR_HOSTNAME, "https://hapi.fhir.org/");
322 + }
317 public static void set_dev_ae_name(String val) { 323 public static void set_dev_ae_name(String val) {
318 StorageParam.setParam(DICOM_DEV_AE_NAME, val); 324 StorageParam.setParam(DICOM_DEV_AE_NAME, val);
319 } 325 }
326 +
327 + public static void set_fhir_hostname(String val){
328 + StorageParam.setParam(FHIR_HOSTNAME,val);
329 + }
330 +
320 public static String get_station_name() { 331 public static String get_station_name() {
321 return StorageParam.getParam(DICOM_STATION_NAME, ""); 332 return StorageParam.getParam(DICOM_STATION_NAME, "");
322 } 333 }
......
1 +<?xml version="1.0" encoding="utf-8"?>
2 +<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
3 + xmlns:app="http://schemas.android.com/apk/res-auto"
4 + xmlns:tools="http://schemas.android.com/tools"
5 + android:layout_width="1565dp"
6 + android:layout_height="match_parent" >
7 +
8 + <TextView
9 + android:id="@+id/view_1"
10 + android:layout_width="wrap_content"
11 + android:layout_height="wrap_content"
12 + android:layout_marginLeft="20dp"
13 + android:layout_marginTop="96dp"
14 + android:text="@string/string_sel_fhir"
15 + android:textSize="@dimen/text_size_40"
16 + android:textColor="@color/color_white"
17 + app:layout_constraintBottom_toBottomOf="parent"
18 + app:layout_constraintEnd_toEndOf="parent"
19 + app:layout_constraintStart_toStartOf="parent"
20 + app:layout_constraintTop_toTopOf="parent"
21 + app:layout_constraintVertical_bias="0.00"
22 + app:layout_constraintHorizontal_bias="0.0" />
23 +
24 + <RelativeLayout
25 + android:id="@+id/lay_show_fhir"
26 + android:layout_width="1399dp"
27 + android:layout_height="wrap_content"
28 + android:layout_marginLeft="68dp"
29 + android:layout_marginTop="30dp"
30 + android:visibility="visible"
31 + app:layout_constraintBottom_toBottomOf="parent"
32 + app:layout_constraintEnd_toEndOf="parent"
33 + app:layout_constraintStart_toStartOf="parent"
34 + app:layout_constraintTop_toBottomOf="@+id/view_1"
35 + app:layout_constraintVertical_bias="0.00"
36 + app:layout_constraintHorizontal_bias="0.0" >
37 +
38 + <RelativeLayout
39 + android:id="@+id/lay_1"
40 + android:layout_width="match_parent"
41 + android:layout_height="68dp"
42 + android:background="@drawable/bg_line_1"
43 + android:gravity="center_vertical"
44 + android:orientation="horizontal">
45 +
46 + <TextView
47 + android:layout_width="288dp"
48 + android:layout_height="match_parent"
49 + android:layout_marginLeft="30dp"
50 + android:gravity="left|center"
51 + android:text="@string/string_sel_fhir_host"
52 + android:textColor="@drawable/txt_click_color_3"
53 + android:textSize="@dimen/text_size_25" />
54 +
55 + <EditText
56 + android:id="@+id/ed_ae_name"
57 + android:layout_width="400dp"
58 + android:layout_height="36dp"
59 + android:layout_alignParentRight="true"
60 + android:layout_centerVertical="true"
61 + android:layout_marginLeft="150dp"
62 + android:layout_marginTop="1dp"
63 + android:layout_marginRight="30dp"
64 + android:background="@drawable/bg_edit_input"
65 + android:digits="@string/inputtype_digits_low"
66 + android:focusable="true"
67 + android:gravity="center|left"
68 + android:hint="Please enter the hostname for HL7"
69 + android:imeOptions="actionDone"
70 + android:inputType="textNoSuggestions"
71 + android:lines="1"
72 + android:maxLength="40"
73 + android:maxLines="1"
74 + android:paddingLeft="10dp"
75 + android:paddingRight="10dp"
76 + android:singleLine="true"
77 + android:textColor="@color/color_d8d8d8"
78 + android:textColorHint="@color/color_d8d8d8"
79 + android:textSize="@dimen/text_size_24" />
80 + </RelativeLayout>
81 + </RelativeLayout>
82 +
83 +</androidx.constraintlayout.widget.ConstraintLayout>
...\ No newline at end of file ...\ No newline at end of file
...@@ -77,6 +77,22 @@ ...@@ -77,6 +77,22 @@
77 android:checked="false" /> 77 android:checked="false" />
78 78
79 <com.sw.laryngoscope.widget.RightRadioButton 79 <com.sw.laryngoscope.widget.RightRadioButton
80 + android:id="@+id/rb_fhir"
81 + android:layout_width="206dp"
82 + android:layout_height="98dp"
83 + android:layout_marginTop="32dp"
84 + android:button="@null"
85 + android:drawableRight="@mipmap/img_enter"
86 + android:paddingRight="10dp"
87 + android:paddingLeft="15dp"
88 + android:gravity="center_vertical"
89 + android:text="@string/string_sel_fhir"
90 + android:textSize="@dimen/text_size_24"
91 + android:textColor="@color/text_color"
92 + android:background="@drawable/shape_txt_set_style_11_1"
93 + android:checked="false" />
94 +
95 + <com.sw.laryngoscope.widget.RightRadioButton
80 android:id="@+id/rb_general_settings" 96 android:id="@+id/rb_general_settings"
81 android:layout_width="206dp" 97 android:layout_width="206dp"
82 android:layout_height="98dp" 98 android:layout_height="98dp"
......
...@@ -395,5 +395,7 @@ ...@@ -395,5 +395,7 @@
395 <string name="zero_patients_message">You have 0 patients</string> 395 <string name="zero_patients_message">You have 0 patients</string>
396 <string name="title_patient_selection">Select Patients</string> 396 <string name="title_patient_selection">Select Patients</string>
397 <string name="start_monitoring">Start</string> 397 <string name="start_monitoring">Start</string>
398 + <string name="string_sel_fhir">FHIR</string>
399 + <string name="string_sel_fhir_host">FHIR host address</string>
398 400
399 </resources> 401 </resources>
...\ No newline at end of file ...\ No newline at end of file
......