-
Notifications
You must be signed in to change notification settings - Fork 4
Hmis105cReport #280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Vinald
wants to merge
25
commits into
vrvu
Choose a base branch
from
hmis105report
base: vrvu
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Hmis105cReport #280
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
7c8c15c
feat: Add HMIS 105 Vaccine & Malaria Report feature
Vinald c303c6e
crush fix
Vinald e4b35cf
fix the button bug
Vinald b7c687f
loading the vaccines count
Vinald eb66aa7
second year
Vinald 27f0a68
Merge branch 'vrvu' into hmis105report
Vinald 8b45b15
mapping dose names to match those in the hmis105 report
Vinald 84f6790
Merge branch 'hmis105report' of github.com:ConnectForLife/vxnaid into…
Vinald 0e72fb4
strings fix
Vinald 744f4e2
strings fix
Vinald 6ca8f5e
improvement in the tablet portrait view
Vinald a05a41e
mobile view of the hmis105 report
Vinald e32af08
tablet screens for the hmis105 report
Vinald cd66e32
data persistence during screen orientation
Vinald dac2af5
making the download button appear on tablet screens
Vinald 9a8b907
download button logic to save an excel file
Vinald bdac6cc
hmis105 report button in landscape mode
Vinald 00203ef
improving the visibilty of the content
Vinald 088c7be
string resources
Vinald 64735d9
report query
Vinald c7b34e6
report query
Vinald c568bf6
report query
Vinald 3222d8c
fix making the counts tally with the web reports
Vinald 056c2e7
code cleanup
Vinald ead7388
fix: Address code review comments for HMIS 105 Report (#280)
Vinald File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
.../main/java/com/jnj/vaccinetracker/reportsoverview/hmis105/activity/Hmis105FlowActivity.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| package com.jnj.vaccinetracker.reportsoverview.hmis105.activity | ||
|
|
||
| import android.content.Context | ||
| import android.content.Intent | ||
| import android.os.Build | ||
| import android.os.Bundle | ||
| import androidx.annotation.RequiresApi | ||
| import androidx.databinding.DataBindingUtil | ||
| import com.jnj.vaccinetracker.R | ||
| import com.jnj.vaccinetracker.common.ui.BaseActivity | ||
| import com.jnj.vaccinetracker.databinding.ActivityFlowBinding | ||
| import com.jnj.vaccinetracker.reportsoverview.hmis105.screens.Hmis105ReportFragment | ||
|
|
||
| @RequiresApi(Build.VERSION_CODES.Q) | ||
| class Hmis105FlowActivity : BaseActivity() { | ||
|
|
||
| companion object { | ||
| fun create(context: Context): Intent = Intent(context, Hmis105FlowActivity::class.java) | ||
| } | ||
|
|
||
| private lateinit var binding: ActivityFlowBinding | ||
|
|
||
| override fun onCreate(savedInstanceState: Bundle?) { | ||
| super.onCreate(savedInstanceState) | ||
| binding = DataBindingUtil.setContentView(this, R.layout.activity_flow) | ||
| binding.lifecycleOwner = this | ||
|
|
||
| if (savedInstanceState == null) { | ||
| val fragment = Hmis105ReportFragment() | ||
| supportFragmentManager.beginTransaction() | ||
| .add(R.id.fragment_container, fragment) | ||
| .commit() | ||
| } | ||
| } | ||
| } | ||
|
|
83 changes: 83 additions & 0 deletions
83
app/src/main/java/com/jnj/vaccinetracker/reportsoverview/hmis105/adapters/Hmis105Adapter.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| package com.jnj.vaccinetracker.reportsoverview.hmis105.adapters | ||
|
|
||
| import android.view.LayoutInflater | ||
| import android.view.View | ||
| import android.view.ViewGroup | ||
| import androidx.recyclerview.widget.DiffUtil | ||
| import androidx.recyclerview.widget.ListAdapter | ||
| import androidx.recyclerview.widget.RecyclerView | ||
| import com.jnj.vaccinetracker.databinding.ItemHmis105ReportRowBinding | ||
| import com.jnj.vaccinetracker.reportsoverview.hmis105.dto.Hmis105ReportDTO | ||
|
|
||
| class Hmis105Adapter : ListAdapter<Hmis105ReportDTO, Hmis105Adapter.ViewHolder>(DiffCallback) { | ||
|
|
||
| override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { | ||
| val inflater = LayoutInflater.from(parent.context) | ||
| val binding = ItemHmis105ReportRowBinding.inflate(inflater, parent, false) | ||
| return ViewHolder(binding) | ||
| } | ||
|
|
||
| override fun onBindViewHolder(holder: ViewHolder, position: Int) { | ||
| val item = getItem(position) | ||
| holder.bind(item) | ||
| } | ||
|
|
||
| inner class ViewHolder(private val binding: ItemHmis105ReportRowBinding) : RecyclerView.ViewHolder(binding.root) { | ||
| fun bind(report: Hmis105ReportDTO) { | ||
| binding.textViewDoses.text = report.doses | ||
| if (isSectionHeader(report)) { | ||
| setNumericViewsVisibility(View.GONE) | ||
| binding.textViewUnder1Static.text = "" | ||
| binding.textViewUnder1Outreach.text = "" | ||
| binding.textView1to4Static.text = "" | ||
| binding.textView1to4Outreach.text = "" | ||
| binding.textView5to14Static.text = "" | ||
| binding.textView5to14Outreach.text = "" | ||
| binding.textViewTotal.text = "" | ||
| } else { | ||
| setNumericViewsVisibility(View.VISIBLE) | ||
| binding.textViewUnder1Static.text = report.under1Static.toString() | ||
| binding.textViewUnder1Outreach.text = report.under1Outreach.toString() | ||
| binding.textView1to4Static.text = report.age1to4Static.toString() | ||
| binding.textView1to4Outreach.text = report.age1to4Outreach.toString() | ||
| binding.textView5to14Static.text = report.age5to14Static.toString() | ||
| binding.textView5to14Outreach.text = report.age5to14Outreach.toString() | ||
| binding.textViewTotal.text = report.total.toString() | ||
| } | ||
| } | ||
|
|
||
| private fun setNumericViewsVisibility(visibility: Int) { | ||
| binding.textViewUnder1Static.visibility = visibility | ||
| binding.textViewUnder1Outreach.visibility = visibility | ||
| binding.textView1to4Static.visibility = visibility | ||
| binding.textView1to4Outreach.visibility = visibility | ||
| binding.textView5to14Static.visibility = visibility | ||
| binding.textView5to14Outreach.visibility = visibility | ||
| binding.textViewTotal.visibility = visibility | ||
| } | ||
|
|
||
| private fun isSectionHeader(report: Hmis105ReportDTO): Boolean { | ||
| return report.under1Static == 0 && | ||
| report.under1Outreach == 0 && | ||
| report.age1to4Static == 0 && | ||
| report.age1to4Outreach == 0 && | ||
| report.age5to14Static == 0 && | ||
| report.age5to14Outreach == 0 && | ||
| report.total == 0 && | ||
| report.doses == report.doses.uppercase() | ||
| } | ||
| } | ||
|
|
||
| companion object DiffCallback : DiffUtil.ItemCallback<Hmis105ReportDTO>() { | ||
| override fun areItemsTheSame( | ||
| oldItem: Hmis105ReportDTO, | ||
| newItem: Hmis105ReportDTO | ||
| ): Boolean = oldItem.doses == newItem.doses | ||
|
|
||
| override fun areContentsTheSame( | ||
| oldItem: Hmis105ReportDTO, | ||
| newItem: Hmis105ReportDTO | ||
| ): Boolean = oldItem == newItem | ||
| } | ||
| } | ||
|
|
||
13 changes: 13 additions & 0 deletions
13
app/src/main/java/com/jnj/vaccinetracker/reportsoverview/hmis105/dto/Hmis105ReportDTO.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| package com.jnj.vaccinetracker.reportsoverview.hmis105.dto | ||
|
|
||
| data class Hmis105ReportDTO( | ||
| val doses: String, | ||
| val under1Static: Int = 0, | ||
| val under1Outreach: Int = 0, | ||
| val age1to4Static: Int = 0, | ||
| val age1to4Outreach: Int = 0, | ||
| val age5to14Static: Int = 0, | ||
| val age5to14Outreach: Int = 0, | ||
| val total: Int = 0 | ||
| ) | ||
|
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.