You need to sign in or sign up before continuing.
liufuhua007

2 version add patient view

package com.sw.laryngoscope.FHIR.fragment;
import android.content.Context;
import android.provider.Settings;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputMethodManager;
import android.widget.RadioGroup;
import android.widget.TextView;
import com.sw.laryngoscope.R;
import com.sw.laryngoscope.activity.BaseFragment;
import com.sw.laryngoscope.activity.CustomTimer;
import com.sw.laryngoscope.activity.HomeActivity;
import com.sw.laryngoscope.databinding.FgSettingFhirBinding;
import com.sw.laryngoscope.manager.SpManager;
import com.sw.laryngoscope.utils.Logger;
public class FhirSettingFragment extends BaseFragment<FgSettingFhirBinding> implements CustomTimer.TimerCallBack,
RadioGroup.OnCheckedChangeListener,View.OnClickListener {
private static final String TAG = "FhirFragment";
private InputMethodManager imm;
@Override
public void onAttach(Context context) {
super.onAttach(context);
homeActivity = (HomeActivity) context;
imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
}
@Override
public void onResume() {
super.onResume();
Logger.d(TAG, "======showFragment======2");
}
@Override
public void onHiddenChanged(boolean hidden) {
super.onHiddenChanged(hidden);
if (!hidden) {
/*homeActivity.changeViewPage();
homeActivity.headIconStateChange(0);*/
initValue();
} else {
}
hideIm();
Logger.d(TAG, "======showFragment======2 " + hidden);
}
@Override
protected FgSettingFhirBinding getViewBinding(LayoutInflater inflater, ViewGroup container) {
return FgSettingFhirBinding.inflate(inflater,container,false);
}
@Override
protected void init() {
//layout_home_home_guest = (ConstraintLayout) rootView.findViewById(R.id.layout_home_home_guest);
initValue();
}
public void initValue() {
if ( !SpManager.get_fhir_hostname().isEmpty() ) {
binding.edAeName.setText(SpManager.get_fhir_hostname());
}
}
@Override
protected void setListener() {
binding.edAeName.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if (actionId == EditorInfo.IME_ACTION_DONE) {
if (imm != null) {
imm.hideSoftInputFromWindow(binding.edAeName.getWindowToken(), 0);
}
String str = binding.edAeName.getText().toString().trim();
if (str.trim().length() <= 0) {
return false;
}
SpManager.set_fhir_hostname(str);
}
return false;
}
});
binding.edAeName.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {}
@Override
public void afterTextChanged(Editable s) {}
});
}
@Override
public void onClick(View v) {
switch (v.getId()) {
default:
break;
}
}
@Override
public void onCheckedChanged(RadioGroup radioGroup, int i) {
switch (radioGroup.getCheckedRadioButtonId()) {
}
}
public void hideIm() {
InputMethodManager imm = (InputMethodManager) homeActivity.getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(homeActivity.getWindow().getDecorView().getWindowToken(), 0);
}
@Override
public void onDestroy() {
super.onDestroy();
}
@Override
public void timerComply(long lastTime, String tag) {
}
@Override
public void backMainAct() {}
@Override
public boolean startEnable() {
return false;
}
}
\ No newline at end of file
......@@ -9,6 +9,7 @@ import android.widget.FrameLayout;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import com.sw.laryngoscope.FHIR.fragment.FhirSettingFragment;
import com.sw.laryngoscope.R;
import com.sw.laryngoscope.activity.BaseFragment;
import com.sw.laryngoscope.activity.CustomTimer;
......@@ -37,6 +38,7 @@ public class SettingFragment extends BaseFragment<FgSettingBinding> implements C
public TimeDateFragment timeDateFragment;
public NetWorkFragment netWorkFragment;
public DicomFragment dicomFragment;
public FhirSettingFragment fhirSettingFragment;
public GeneralFragment generalFragment;
public DevInfoFragment devInfoFragment;
public LogExportFragment logExportFragment;
......@@ -176,6 +178,18 @@ public class SettingFragment extends BaseFragment<FgSettingBinding> implements C
}
showFragment(dicomFragment);
break;
case R.id.rb_fhir:
Logger.d(TAG, "======showFragment======rb_fhir");
if (fhirSettingFragment == null) {
fhirSettingFragment = new FhirSettingFragment();
fhirSettingFragment.setHomeActivity(homeActivity);
fhirSettingFragment.setHomeFragment(this);
getChildFragmentManager().beginTransaction()
.add(R.id.setting_fragment, fhirSettingFragment)
.commit();
}
showFragment(fhirSettingFragment);
break;
case R.id.rb_general_settings:
Logger.d(TAG, "======showFragment======rb_general_settings");
if (generalFragment == null) {
......
......@@ -86,6 +86,8 @@ public class SpManager {
public static final String DICOM_HOST_NAME = "dicom_host_name";
public static final String DICOM_PORT = "dicom_port";
public static final String FHIR_HOSTNAME = "fhir_host_name";
public static final String FILE_SHOW_TIME = "file_show_time";
public static final String COPY_FILE_TYPE = "copy_file_type";
......@@ -314,9 +316,18 @@ public class SpManager {
public static String get_dev_ae_name() {
return StorageParam.getParam(DICOM_DEV_AE_NAME, "");
}
public static String get_fhir_hostname() {
return StorageParam.getParam(FHIR_HOSTNAME, "https://hapi.fhir.org/");
}
public static void set_dev_ae_name(String val) {
StorageParam.setParam(DICOM_DEV_AE_NAME, val);
}
public static void set_fhir_hostname(String val){
StorageParam.setParam(FHIR_HOSTNAME,val);
}
public static String get_station_name() {
return StorageParam.getParam(DICOM_STATION_NAME, "");
}
......
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="1565dp"
android:layout_height="match_parent" >
<TextView
android:id="@+id/view_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginTop="96dp"
android:text="@string/string_sel_fhir"
android:textSize="@dimen/text_size_40"
android:textColor="@color/color_white"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.00"
app:layout_constraintHorizontal_bias="0.0" />
<RelativeLayout
android:id="@+id/lay_show_fhir"
android:layout_width="1399dp"
android:layout_height="wrap_content"
android:layout_marginLeft="68dp"
android:layout_marginTop="30dp"
android:visibility="visible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/view_1"
app:layout_constraintVertical_bias="0.00"
app:layout_constraintHorizontal_bias="0.0" >
<RelativeLayout
android:id="@+id/lay_1"
android:layout_width="match_parent"
android:layout_height="68dp"
android:background="@drawable/bg_line_1"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_width="288dp"
android:layout_height="match_parent"
android:layout_marginLeft="30dp"
android:gravity="left|center"
android:text="@string/string_sel_fhir_host"
android:textColor="@drawable/txt_click_color_3"
android:textSize="@dimen/text_size_25" />
<EditText
android:id="@+id/ed_ae_name"
android:layout_width="400dp"
android:layout_height="36dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginLeft="150dp"
android:layout_marginTop="1dp"
android:layout_marginRight="30dp"
android:background="@drawable/bg_edit_input"
android:digits="@string/inputtype_digits_low"
android:focusable="true"
android:gravity="center|left"
android:hint="Please enter the hostname for HL7"
android:imeOptions="actionDone"
android:inputType="textNoSuggestions"
android:lines="1"
android:maxLength="40"
android:maxLines="1"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:singleLine="true"
android:textColor="@color/color_d8d8d8"
android:textColorHint="@color/color_d8d8d8"
android:textSize="@dimen/text_size_24" />
</RelativeLayout>
</RelativeLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
......@@ -77,6 +77,22 @@
android:checked="false" />
<com.sw.laryngoscope.widget.RightRadioButton
android:id="@+id/rb_fhir"
android:layout_width="206dp"
android:layout_height="98dp"
android:layout_marginTop="32dp"
android:button="@null"
android:drawableRight="@mipmap/img_enter"
android:paddingRight="10dp"
android:paddingLeft="15dp"
android:gravity="center_vertical"
android:text="@string/string_sel_fhir"
android:textSize="@dimen/text_size_24"
android:textColor="@color/text_color"
android:background="@drawable/shape_txt_set_style_11_1"
android:checked="false" />
<com.sw.laryngoscope.widget.RightRadioButton
android:id="@+id/rb_general_settings"
android:layout_width="206dp"
android:layout_height="98dp"
......
......@@ -395,5 +395,7 @@
<string name="zero_patients_message">You have 0 patients</string>
<string name="title_patient_selection">Select Patients</string>
<string name="start_monitoring">Start</string>
<string name="string_sel_fhir">FHIR</string>
<string name="string_sel_fhir_host">FHIR host address</string>
</resources>
\ No newline at end of file
......