use of com.hci.carebase.domain.Patient in project Carebase by robertsimoes.
the class DebugFragment method onPatientUpdate.
@OnClick(R.id.debug_but_patient_update)
public void onPatientUpdate(View v) {
final String newLName = patientLName.getText().toString();
final String newFName = patientFName.getText().toString();
final String newHNum = patientHnum.getText().toString();
final String id = patientGet.getText().toString();
provider.getPatient(id, new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
Patient p = dataSnapshot.getValue(Patient.class);
p.setFirstName(newFName);
p.setLastName(newLName);
p.setHealthCardNumber(newHNum);
provider.updatePatient(id, p, new OnCompleteListener<Void>() {
@Override
public void onComplete(@NonNull Task<Void> task) {
results.setText("Updated! ");
Toast.makeText(getContext(), "Updated", Toast.LENGTH_LONG).show();
}
});
}
@Override
public void onCancelled(DatabaseError databaseError) {
}
});
}
use of com.hci.carebase.domain.Patient in project Carebase by robertsimoes.
the class RxFragment method onCreateView.
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_rx, container, false);
ButterKnife.bind(this, view);
final LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity());
layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
recyclerView.setLayoutManager(layoutManager);
if (getArguments() == null) {
tvNoContents.setVisibility(View.VISIBLE);
} else {
Patient p = (Patient) getArguments().getSerializable(Const.BUNDLE_KEY_PATIENT);
if (p.getScripts() == null || p.getScripts().isEmpty()) {
tvNoContents.setVisibility(View.VISIBLE);
} else {
ArrayList data = p.getScripts();
listAdapter = new ListAdapter(data);
recyclerView.setAdapter(listAdapter);
}
}
return view;
}
Aggregations