index int64 0 0 | repo_id stringclasses 829
values | file_path stringlengths 34 254 | content stringlengths 6 5.38M |
|---|---|---|---|
0 | code_files/vets-api-private/modules | code_files/vets-api-private/modules/my_health/catalog-info-v1.yaml | apiVersion: backstage.io/v1alpha1
kind: API
metadata:
annotations:
github.com/project-slug: department-of-veterans-affairs/vets-api
description: APIs for the MyHealth namespace within vets-api
namespace: vagov-platform
name: my-health-api
tags:
- ruby
- rails
title: VA.gov MyHealth API
links:
... |
0 | code_files/vets-api-private/modules | code_files/vets-api-private/modules/my_health/my_health.gemspec | require_relative 'lib/my_health/version'
Gem::Specification.new do |spec|
spec.name = 'my_health'
spec.version = MyHealth::VERSION
spec.authors = ['Patrick Vinograd']
spec.email = ['patrick@adhocteam.us']
spec.homepage = 'https://api.va.gov/'
spec.summary = 'VA.gov MyHealth APIs... |
0 | code_files/vets-api-private/modules/my_health/app/serializers/my_health | code_files/vets-api-private/modules/my_health/app/serializers/my_health/v1/message_draft_serializer.rb | # frozen_string_literal: true
module MyHealth
module V1
class MessageDraftSerializer < MessageSerializer
include JSONAPI::Serializer
set_type :message_drafts
end
end
end
|
0 | code_files/vets-api-private/modules/my_health/app/serializers/my_health | code_files/vets-api-private/modules/my_health/app/serializers/my_health/v1/triage_team_serializer.rb | # frozen_string_literal: true
module MyHealth
module V1
class TriageTeamSerializer
include JSONAPI::Serializer
set_type :triage_teams
set_id :triage_team_id
attributes :triage_team_id, :name, :relation_type, :preferred_team
end
end
end
|
0 | code_files/vets-api-private/modules/my_health/app/serializers/my_health | code_files/vets-api-private/modules/my_health/app/serializers/my_health/v1/prescription_documentation_serializer.rb | # frozen_string_literal: true
require 'digest'
module MyHealth
module V1
class PrescriptionDocumentationSerializer
include JSONAPI::Serializer
set_id { '' }
attributes :html do |object|
object.html[:html]
end
end
end
end
|
0 | code_files/vets-api-private/modules/my_health/app/serializers/my_health | code_files/vets-api-private/modules/my_health/app/serializers/my_health/v1/prescription_preference_serializer.rb | # frozen_string_literal: true
module MyHealth
module V1
class PrescriptionPreferenceSerializer
include JSONAPI::Serializer
attributes :email_address, :rx_flag
end
end
end
|
0 | code_files/vets-api-private/modules/my_health/app/serializers/my_health | code_files/vets-api-private/modules/my_health/app/serializers/my_health/v1/vaccine_serializer.rb | # frozen_string_literal: true
module MyHealth
module V1
class VaccineSerializer
include JSONAPI::Serializer
attribute :id
attribute :name
attribute :date_received
attribute :location
attribute :manufacturer
attribute :reactions
attribute :notes
link :self d... |
0 | code_files/vets-api-private/modules/my_health/app/serializers/my_health | code_files/vets-api-private/modules/my_health/app/serializers/my_health/v1/allergy_serializer.rb | # frozen_string_literal: true
module MyHealth
module V1
class AllergySerializer
include JSONAPI::Serializer
attribute :id
attribute :name
attribute :date
attribute :categories
attribute :reactions
attribute :location
attribute :observedHistoric
attribute :no... |
0 | code_files/vets-api-private/modules/my_health/app/serializers/my_health | code_files/vets-api-private/modules/my_health/app/serializers/my_health/v1/tracking_serializer.rb | # frozen_string_literal: true
module MyHealth
module V1
class TrackingSerializer
include JSONAPI::Serializer
set_id :tracking_number
set_type :trackings
link :self do |object|
MyHealth::UrlHelper.new.v1_prescription_trackings_url(object.prescription_id)
end
link :pr... |
0 | code_files/vets-api-private/modules/my_health/app/serializers/my_health | code_files/vets-api-private/modules/my_health/app/serializers/my_health/v1/eligible_data_classes_serializer.rb | # frozen_string_literal: true
module MyHealth
module V1
class EligibleDataClassesSerializer
include JSONAPI::Serializer
set_type :eligible_data_classes
set_id { '' }
attribute :data_classes do |object|
object.map(&:name)
end
end
end
end
|
0 | code_files/vets-api-private/modules/my_health/app/serializers/my_health | code_files/vets-api-private/modules/my_health/app/serializers/my_health/v1/messaging_preference_serializer.rb | # frozen_string_literal: true
module MyHealth
module V1
class MessagingPreferenceSerializer
include JSONAPI::Serializer
attributes :email_address, :frequency
end
end
end
|
0 | code_files/vets-api-private/modules/my_health/app/serializers/my_health | code_files/vets-api-private/modules/my_health/app/serializers/my_health/v1/extract_status_serializer.rb | # frozen_string_literal: true
module MyHealth
module V1
class ExtractStatusSerializer
include JSONAPI::Serializer
set_type :extract_status
attributes :extract_type, :last_updated, :status, :created_on, :station_number
end
end
end
|
0 | code_files/vets-api-private/modules/my_health/app/serializers/my_health | code_files/vets-api-private/modules/my_health/app/serializers/my_health/v1/message_serializer.rb | # frozen_string_literal: true
module MyHealth
module V1
class MessageSerializer < MessagesSerializer
include JSONAPI::Serializer
set_type :messages
has_many :attachments, serializer: AttachmentSerializer, &:attachments
end
end
end
|
0 | code_files/vets-api-private/modules/my_health/app/serializers/my_health | code_files/vets-api-private/modules/my_health/app/serializers/my_health/v1/all_triage_teams_serializer.rb | # frozen_string_literal: true
module MyHealth
module V1
class AllTriageTeamsSerializer
include JSONAPI::Serializer
set_type :all_triage_teams
set_id :triage_team_id
attributes :triage_team_id, :name, :station_number,
:blocked_status, :preferred_team, :relation_type, :le... |
0 | code_files/vets-api-private/modules/my_health/app/serializers/my_health | code_files/vets-api-private/modules/my_health/app/serializers/my_health/v1/message_signature_serializer.rb | # frozen_string_literal: true
# This serializer was used intended to be used in
# MyHealth::V1::MessagesController#signature
# However, it's not actually being used because the call doesn't
# follow JSON:API specs and just uses "object" itself
# I'm not deleting the serializer so the mhv team can update the
# control... |
0 | code_files/vets-api-private/modules/my_health/app/serializers/my_health | code_files/vets-api-private/modules/my_health/app/serializers/my_health/v1/attachment_serializer.rb | # frozen_string_literal: true
module MyHealth
module V1
class AttachmentSerializer
include JSONAPI::Serializer
set_type :attachments
attribute :name
attribute :message_id
attribute :attachment_size
link :download do |object|
MyHealth::UrlHelper.new.v1_message_attach... |
0 | code_files/vets-api-private/modules/my_health/app/serializers/my_health | code_files/vets-api-private/modules/my_health/app/serializers/my_health/v1/messages_serializer.rb | # frozen_string_literal: true
module MyHealth
module V1
class MessagesSerializer
include JSONAPI::Serializer
attribute :message_id, &:id
attribute :category
attribute :subject
attribute :body
attribute :attachment
attribute :sent_date
attribute :sender_id
at... |
0 | code_files/vets-api-private/modules/my_health/app/serializers/my_health | code_files/vets-api-private/modules/my_health/app/serializers/my_health/v1/prescription_serializer.rb | # frozen_string_literal: true
module MyHealth
module V1
class PrescriptionSerializer
include JSONAPI::Serializer
set_id :prescription_id
link :self do |object|
MyHealth::UrlHelper.new.v1_prescription_url(object.prescription_id)
end
link :tracking do |object|
objec... |
0 | code_files/vets-api-private/modules/my_health/app/serializers/my_health | code_files/vets-api-private/modules/my_health/app/serializers/my_health/v1/message_details_serializer.rb | # frozen_string_literal: true
module MyHealth
module V1
class MessageDetailsSerializer < MessagesSerializer
include JSONAPI::Serializer
set_id :message_id
attribute :message_id, &:id
attribute :body, &:message_body
attribute :message_id
attribute :thread_id
attribute :... |
0 | code_files/vets-api-private/modules/my_health/app/serializers/my_health | code_files/vets-api-private/modules/my_health/app/serializers/my_health/v1/health_condition_serializer.rb | # frozen_string_literal: true
module MyHealth
module V1
class HealthConditionSerializer
include JSONAPI::Serializer
attribute :id
attribute :name
attribute :date
attribute :provider
attribute :facility
attribute :comments
link :self do |object|
MyHealth::... |
0 | code_files/vets-api-private/modules/my_health/app/serializers/my_health | code_files/vets-api-private/modules/my_health/app/serializers/my_health/v1/prescription_details_serializer.rb | # frozen_string_literal: true
module MyHealth
module V1
class PrescriptionDetailsSerializer < PrescriptionSerializer
include JSONAPI::Serializer
set_id :prescription_id
attribute :cmop_ndc_number
attribute :in_cerner_transition
attribute :not_refillable_display_message
attri... |
0 | code_files/vets-api-private/modules/my_health/app/serializers/my_health | code_files/vets-api-private/modules/my_health/app/serializers/my_health/v1/threads_serializer.rb | # frozen_string_literal: true
module MyHealth
module V1
class ThreadsSerializer
include JSONAPI::Serializer
set_id :thread_id
set_type :message_threads
attribute :thread_id
attribute :folder_id
attribute :message_id
attribute :thread_page_size
attribute :message... |
0 | code_files/vets-api-private/modules/my_health/app/serializers/my_health | code_files/vets-api-private/modules/my_health/app/serializers/my_health/v1/folder_serializer.rb | # frozen_string_literal: true
module MyHealth
module V1
class FolderSerializer
include JSONAPI::Serializer
set_type :folders
attributes :name, :count, :unread_count, :system_folder
attribute :folder_id, &:id
link :self do |object|
MyHealth::UrlHelper.new.v1_folder_url(obj... |
0 | code_files/vets-api-private/modules/my_health/app/serializers/my_health | code_files/vets-api-private/modules/my_health/app/serializers/my_health/v1/category_serializer.rb | # frozen_string_literal: true
module MyHealth
module V1
class CategorySerializer
include JSONAPI::Serializer
set_type :categories
set_id :category_id
attribute :message_category_type
end
end
end
|
0 | code_files/vets-api-private/modules/my_health/app/serializers/my_health | code_files/vets-api-private/modules/my_health/app/serializers/my_health/v2/drug_sheet_serializer.rb | # frozen_string_literal: true
module MyHealth
module V2
class DrugSheetSerializer
include JSONAPI::Serializer
set_id do |object|
Digest::SHA256.hexdigest(object.html[:html].to_s)
end
attributes :html do |object|
object.html[:html]
end
end
end
end
|
0 | code_files/vets-api-private/modules/my_health/app/serializers/my_health | code_files/vets-api-private/modules/my_health/app/serializers/my_health/v2/prescription_serializer.rb | # frozen_string_literal: true
module MyHealth
module V2
class PrescriptionSerializer
# TODO: add V2 serializer specs
include JSONAPI::Serializer
set_id :prescription_id
# TODO: Add links when show and trackings routes are implemented
# link :self do |object|
# MyHealth::U... |
0 | code_files/vets-api-private/modules/my_health/app/serializers/my_health | code_files/vets-api-private/modules/my_health/app/serializers/my_health/v2/prescription_details_serializer.rb | # frozen_string_literal: true
module MyHealth
module V2
class PrescriptionDetailsSerializer < PrescriptionSerializer
include JSONAPI::Serializer
set_id :prescription_id
# Fields not in UHD model - defensive
attribute :cmop_ndc_number do |object|
object.cmop_ndc_number if object.... |
0 | code_files/vets-api-private/modules/my_health/app/controllers | code_files/vets-api-private/modules/my_health/app/controllers/my_health/application_controller.rb | # frozen_string_literal: true
module MyHealth
class ApplicationController < ::ApplicationController
end
end
|
0 | code_files/vets-api-private/modules/my_health/app/controllers | code_files/vets-api-private/modules/my_health/app/controllers/my_health/mr_controller.rb | # frozen_string_literal: true
require 'medical_records/client'
require 'medical_records/bb_internal/client'
require 'medical_records/phr_mgr/client'
require 'medical_records/lighthouse_client'
module MyHealth
class MRController < ApplicationController
include MyHealth::MHVControllerConcerns
include JsonApiP... |
0 | code_files/vets-api-private/modules/my_health/app/controllers | code_files/vets-api-private/modules/my_health/app/controllers/my_health/apidocs_controller.rb | # frozen_string_literal: true
module MyHealth
class ApidocsController < MyHealth::ApplicationController
service_tag 'mhv-messaging'
skip_before_action :authenticate
def index
permitted_classes = [Time] # Allow the Time class to be deserialized
swagger = YAML.safe_load(
File.read(MyHe... |
0 | code_files/vets-api-private/modules/my_health/app/controllers | code_files/vets-api-private/modules/my_health/app/controllers/my_health/bb_controller.rb | # frozen_string_literal: true
require 'bb/client'
module MyHealth
class BBController < ApplicationController
include MyHealth::MHVControllerConcerns
service_tag 'mhv-medical-records'
protected
def client
@client ||= BB::Client.new(session: { user_id: current_user.mhv_correlation_id })
en... |
0 | code_files/vets-api-private/modules/my_health/app/controllers | code_files/vets-api-private/modules/my_health/app/controllers/my_health/sm_controller.rb | # frozen_string_literal: true
require 'sm/client'
module MyHealth
class SMController < ApplicationController
include MyHealth::MHVControllerConcerns
include JsonApiPaginationLinks
service_tag 'mhv-messaging'
protected
def client
@client ||= SM::Client.new(session: { user_id: current_user... |
0 | code_files/vets-api-private/modules/my_health/app/controllers | code_files/vets-api-private/modules/my_health/app/controllers/my_health/rx_controller.rb | # frozen_string_literal: true
require 'rx/client'
module MyHealth
class RxController < ApplicationController
include MyHealth::MHVControllerConcerns
include JsonApiPaginationLinks
service_tag 'mhv-medications'
protected
def client
@client ||= Rx::Client.new(
session: { user_id: c... |
0 | code_files/vets-api-private/modules/my_health/app/controllers/my_health | code_files/vets-api-private/modules/my_health/app/controllers/my_health/v1/messages_controller.rb | # frozen_string_literal: true
require 'unique_user_events'
module MyHealth
module V1
class MessagesController < SMController
MAX_STANDARD_FILES = 4
before_action :extend_timeout, only: %i[create reply], if: :oh_triage_group?
def show
message_id = params[:id].try(:to_i)
respon... |
0 | code_files/vets-api-private/modules/my_health/app/controllers/my_health | code_files/vets-api-private/modules/my_health/app/controllers/my_health/v1/conditions_controller.rb | # frozen_string_literal: true
module MyHealth
module V1
class ConditionsController < MRController
def index
# EXPERIMENTAL - new conditions model not yet implemented
#
# if Flipper.enabled?(:mhv_medical_records_support_new_model_health_condition)
# use_cache = params.key?(... |
0 | code_files/vets-api-private/modules/my_health/app/controllers/my_health | code_files/vets-api-private/modules/my_health/app/controllers/my_health/v1/attachments_controller.rb | # frozen_string_literal: true
module MyHealth
module V1
class AttachmentsController < SMController
def show
response = client.get_attachment(params[:message_id], params[:id])
raise Common::Exceptions::RecordNotFound, params[:id] if response.blank?
send_data(response[:body], filenam... |
0 | code_files/vets-api-private/modules/my_health/app/controllers/my_health | code_files/vets-api-private/modules/my_health/app/controllers/my_health/v1/prescriptions_controller.rb | # frozen_string_literal: true
require 'unique_user_events'
module MyHealth
module V1
class PrescriptionsController < RxController
include Filterable
include MyHealth::PrescriptionHelper::Filtering
include MyHealth::PrescriptionHelper::Sorting
include MyHealth::RxGroupingHelper
# Th... |
0 | code_files/vets-api-private/modules/my_health/app/controllers/my_health | code_files/vets-api-private/modules/my_health/app/controllers/my_health/v1/clinical_notes_controller.rb | # frozen_string_literal: true
module MyHealth
module V1
class ClinicalNotesController < MRController
def index
render_resource client.list_clinical_notes
end
def show
note_id = params[:id].try(:to_i)
render_resource client.get_clinical_note(note_id)
end
end
... |
0 | code_files/vets-api-private/modules/my_health/app/controllers/my_health | code_files/vets-api-private/modules/my_health/app/controllers/my_health/v1/labs_and_tests_controller.rb | # frozen_string_literal: true
module MyHealth
module V1
class LabsAndTestsController < MRController
def index
render_resource client.list_labs_and_tests
end
def show
record_id = params[:id].try(:to_i)
render_resource client.get_diagnostic_report(record_id)
end
... |
0 | code_files/vets-api-private/modules/my_health/app/controllers/my_health | code_files/vets-api-private/modules/my_health/app/controllers/my_health/v1/triage_teams_controller.rb | # frozen_string_literal: true
module MyHealth
module V1
class TriageTeamsController < SMController
include Vets::SharedLogging
STATSD_KEY_PREFIX = 'api.my_health.triage_teams'
def index
resource = client.get_triage_teams(@current_user.uuid, use_cache?)
if resource.blank?
... |
0 | code_files/vets-api-private/modules/my_health/app/controllers/my_health | code_files/vets-api-private/modules/my_health/app/controllers/my_health/v1/threads_controller.rb | # frozen_string_literal: true
require 'unique_user_events'
module MyHealth
module V1
class ThreadsController < SMController
include Vets::SharedLogging
STATSD_KEY_PREFIX = 'api.my_health.threads'
def index
resource = fetch_folder_threads
raise Common::Exceptions::RecordNotFou... |
0 | code_files/vets-api-private/modules/my_health/app/controllers/my_health | code_files/vets-api-private/modules/my_health/app/controllers/my_health/v1/vitals_controller.rb | # frozen_string_literal: true
require 'unique_user_events'
module MyHealth
module V1
class VitalsController < MRController
def index
resource = client.list_vitals(params[:from], params[:to])
# Log unique user events for vitals accessed
UniqueUserEvents.log_events(
user: ... |
0 | code_files/vets-api-private/modules/my_health/app/controllers/my_health | code_files/vets-api-private/modules/my_health/app/controllers/my_health/v1/messaging_preferences_controller.rb | # frozen_string_literal: true
module MyHealth
module V1
class MessagingPreferencesController < SMController
def show
resource = client.get_preferences
render json: MessagingPreferenceSerializer.new(resource)
end
# Set secure messaging email notification preferences.
# @pa... |
0 | code_files/vets-api-private/modules/my_health/app/controllers/my_health | code_files/vets-api-private/modules/my_health/app/controllers/my_health/v1/tooltips_controller.rb | # frozen_string_literal: true
module MyHealth
module V1
class TooltipsController < ApplicationController
before_action :set_user_account, only: %i[index create update]
before_action :set_tooltip, only: [:update]
service_tag 'mhv-medications'
def index
tooltips = @user_account.too... |
0 | code_files/vets-api-private/modules/my_health/app/controllers/my_health | code_files/vets-api-private/modules/my_health/app/controllers/my_health/v1/message_drafts_controller.rb | # frozen_string_literal: true
module MyHealth
module V1
class MessageDraftsController < SMController
def create
draft_response = client.post_create_message_draft(draft_params.to_h)
render json: MessageDraftSerializer.new(draft_response), status: :created
end
def update
... |
0 | code_files/vets-api-private/modules/my_health/app/controllers/my_health | code_files/vets-api-private/modules/my_health/app/controllers/my_health/v1/folders_controller.rb | # frozen_string_literal: true
module MyHealth
module V1
class FoldersController < SMController
def index
resource = client.get_folders(@current_user.uuid, use_cache?)
links = pagination_links(resource)
resource = resource.paginate(**pagination_params)
options = { meta: reso... |
0 | code_files/vets-api-private/modules/my_health/app/controllers/my_health | code_files/vets-api-private/modules/my_health/app/controllers/my_health/v1/health_records_controller.rb | # frozen_string_literal: true
module MyHealth
module V1
class HealthRecordsController < BBController
include MyHealth::AALClientConcerns
def refresh
resource = client.get_extract_status
render json: ExtractStatusSerializer.new(resource.data, { meta: resource.metadata })
end
... |
0 | code_files/vets-api-private/modules/my_health/app/controllers/my_health | code_files/vets-api-private/modules/my_health/app/controllers/my_health/v1/unique_user_metrics_controller.rb | # frozen_string_literal: true
require 'unique_user_events'
module MyHealth
module V1
##
# Controller for logging unique user metrics events in the MHV Portal.
# Supports batch processing of multiple events in a single request.
#
class UniqueUserMetricsController < ApplicationController
ser... |
0 | code_files/vets-api-private/modules/my_health/app/controllers/my_health | code_files/vets-api-private/modules/my_health/app/controllers/my_health/v1/vaccines_controller.rb | # frozen_string_literal: true
module MyHealth
module V1
class VaccinesController < MRController
def index
# EXPERIMENTAL - new vaccine model not yet implemented
#
# if Flipper.enabled?(:mhv_medical_records_support_new_model_vaccine)
# use_cache = params.key?(:use_cache) ? ... |
0 | code_files/vets-api-private/modules/my_health/app/controllers/my_health | code_files/vets-api-private/modules/my_health/app/controllers/my_health/v1/prescription_documentation_controller.rb | # frozen_string_literal: true
module MyHealth
module V1
class PrescriptionDocumentationController < RxController
def index
id = params[:id]
rx = client.get_rx_details(id)
raise StandardError, 'Rx not found' if rx.nil?
raise StandardError, 'Missing NDC number' if rx.cmop_ndc_... |
0 | code_files/vets-api-private/modules/my_health/app/controllers/my_health | code_files/vets-api-private/modules/my_health/app/controllers/my_health/v1/health_record_contents_controller.rb | # frozen_string_literal: true
module MyHealth
module V1
class HealthRecordContentsController < BBController
include ActionController::Live
REPORT_HEADERS = %w[Content-Type Content-Disposition].freeze
def show
# doc_type will default to 'pdf' if any value, including nil is provided.
... |
0 | code_files/vets-api-private/modules/my_health/app/controllers/my_health | code_files/vets-api-private/modules/my_health/app/controllers/my_health/v1/trackings_controller.rb | # frozen_string_literal: true
module MyHealth
module V1
class TrackingsController < RxController
# This index action supports various parameters described below, all are optional
# This comment can be removed once documentation is finalized
# @param page - the paginated page to fetch
# @p... |
0 | code_files/vets-api-private/modules/my_health/app/controllers/my_health | code_files/vets-api-private/modules/my_health/app/controllers/my_health/v1/allergies_controller.rb | # frozen_string_literal: true
module MyHealth
module V1
class AllergiesController < MRController
def index
# EXPERIMENTAL - new allergies model not yet implemented
#
# if Flipper.enabled?(:mhv_medical_records_support_new_model_allergy)
# use_cache = params.key?(:use_cache)... |
0 | code_files/vets-api-private/modules/my_health/app/controllers/my_health | code_files/vets-api-private/modules/my_health/app/controllers/my_health/v1/all_triage_teams_controller.rb | # frozen_string_literal: true
module MyHealth
module V1
class AllTriageTeamsController < SMController
include Vets::SharedLogging
STATSD_KEY_PREFIX = 'api.my_health.all_triage_teams'
def index
resource = client.get_all_triage_teams(@current_user.uuid, use_cache?)
if resource.b... |
0 | code_files/vets-api-private/modules/my_health/app/controllers/my_health | code_files/vets-api-private/modules/my_health/app/controllers/my_health/v1/prescription_preferences_controller.rb | # frozen_string_literal: true
module MyHealth
module V1
class PrescriptionPreferencesController < RxController
def show
resource = client.get_preferences
render json: PrescriptionPreferenceSerializer.new(resource)
end
def update
resource = client.post_preferences(params... |
0 | code_files/vets-api-private/modules/my_health/app/controllers/my_health | code_files/vets-api-private/modules/my_health/app/controllers/my_health/v1/aal_controller.rb | # frozen_string_literal: true
module MyHealth
module V1
class AALController < ApplicationController
include MyHealth::AALClientConcerns
service_tag 'mhv-aal'
before_action :authorize_aal
before_action :authenticate_aal_client!
def create
once_per_session = ActiveModel::Typ... |
0 | code_files/vets-api-private/modules/my_health/app/controllers/my_health/v1 | code_files/vets-api-private/modules/my_health/app/controllers/my_health/v1/medical_records/bbmi_notification_controller.rb | # frozen_string_literal: true
module MyHealth
module V1
module MedicalRecords
class BbmiNotificationController < MRController
# Retrieves the BBMI notification setting
# @return [JSON] BBMI notification setting
def status
resource = bb_client.get_bbmi_notification_setting
... |
0 | code_files/vets-api-private/modules/my_health/app/controllers/my_health/v1 | code_files/vets-api-private/modules/my_health/app/controllers/my_health/v1/medical_records/imaging_controller.rb | # frozen_string_literal: true
module MyHealth
module V1
module MedicalRecords
class ImagingController < MRController
include ActionController::Live
before_action :set_study_id, only: %i[request_download images image dicom]
def index
render_resource(bb_client.list_imaging... |
0 | code_files/vets-api-private/modules/my_health/app/controllers/my_health/v1 | code_files/vets-api-private/modules/my_health/app/controllers/my_health/v1/medical_records/military_service_controller.rb | # frozen_string_literal: true
module MyHealth
module V1
module MedicalRecords
class MilitaryServiceController < ApplicationController
include MyHealth::AALClientConcerns
service_tag 'mhv-medical-records'
before_action :authorize
class MissingEdipiError < StandardError; end... |
0 | code_files/vets-api-private/modules/my_health/app/controllers/my_health/v1 | code_files/vets-api-private/modules/my_health/app/controllers/my_health/v1/medical_records/mr_session_controller.rb | # frozen_string_literal: true
module MyHealth
module V1
module MedicalRecords
class MRSessionController < MRController
def create
client
head :no_content
end
def status
resource = phrmgr_client.get_phrmgr_status
render json: resource.to_json
... |
0 | code_files/vets-api-private/modules/my_health/app/controllers/my_health/v1 | code_files/vets-api-private/modules/my_health/app/controllers/my_health/v1/medical_records/patient_controller.rb | # frozen_string_literal: true
module MyHealth
module V1
module MedicalRecords
class PatientController < MRController
# Gets a user's treatment facilities
# @return [Array] of treatment facilities and related user info
def index
resource = bb_client.get_patient
re... |
0 | code_files/vets-api-private/modules/my_health/app/controllers/my_health/v1 | code_files/vets-api-private/modules/my_health/app/controllers/my_health/v1/medical_records/radiology_controller.rb | # frozen_string_literal: true
module MyHealth
module V1
module MedicalRecords
class RadiologyController < MRController
def index
resource = bb_client.list_radiology
render json: resource.to_json
end
end
end
end
end
|
0 | code_files/vets-api-private/modules/my_health/app/controllers/my_health/v1 | code_files/vets-api-private/modules/my_health/app/controllers/my_health/v1/medical_records/ccd_controller.rb | # frozen_string_literal: true
module MyHealth
module V1
module MedicalRecords
class CcdController < MRController
include MyHealth::AALClientConcerns
##
# Generates a CCD
# @return [Array] of objects with CCDs generated date and status (COMPLETE or not)
#
def... |
0 | code_files/vets-api-private/modules/my_health/app/controllers/my_health/v1 | code_files/vets-api-private/modules/my_health/app/controllers/my_health/v1/medical_records/self_entered_controller.rb | # frozen_string_literal: true
require 'medical_records/bb_internal/client'
module MyHealth
module V1
module MedicalRecords
class SelfEnteredController < ApplicationController
include MyHealth::MHVControllerConcerns
include MyHealth::AALClientConcerns
service_tag 'mhv-medical-record... |
0 | code_files/vets-api-private/modules/my_health/app/controllers/my_health | code_files/vets-api-private/modules/my_health/app/controllers/my_health/v2/conditions_controller.rb | # frozen_string_literal: true
require 'unified_health_data/service'
require 'unified_health_data/serializers/condition_serializer'
require 'unique_user_events'
module MyHealth
module V2
class ConditionsController < ApplicationController
include MyHealth::V2::Concerns::ErrorHandler
include SortableRe... |
0 | code_files/vets-api-private/modules/my_health/app/controllers/my_health | code_files/vets-api-private/modules/my_health/app/controllers/my_health/v2/prescriptions_controller.rb | # frozen_string_literal: true
require 'unified_health_data/service'
require 'unified_health_data/serializers/prescriptions_refills_serializer'
require 'securerandom'
require 'unique_user_events'
require 'vets/collection'
module MyHealth
module V2
class PrescriptionsController < ApplicationController
inclu... |
0 | code_files/vets-api-private/modules/my_health/app/controllers/my_health | code_files/vets-api-private/modules/my_health/app/controllers/my_health/v2/clinical_notes_controller.rb | # frozen_string_literal: true
require 'unified_health_data/service'
require 'unified_health_data/serializers/clinical_notes_serializer'
require 'unique_user_events'
module MyHealth
module V2
class ClinicalNotesController < ApplicationController
include MyHealth::V2::Concerns::ErrorHandler
include So... |
0 | code_files/vets-api-private/modules/my_health/app/controllers/my_health | code_files/vets-api-private/modules/my_health/app/controllers/my_health/v2/labs_and_tests_controller.rb | # frozen_string_literal: true
require 'unified_health_data/service'
require 'unified_health_data/serializers/lab_or_test_serializer'
require 'unique_user_events'
module MyHealth
module V2
class LabsAndTestsController < ApplicationController
include SortableRecords
service_tag 'mhv-medical-records'
... |
0 | code_files/vets-api-private/modules/my_health/app/controllers/my_health | code_files/vets-api-private/modules/my_health/app/controllers/my_health/v2/immunizations_controller.rb | # frozen_string_literal: true
require 'lighthouse/veterans_health/client'
require 'lighthouse/veterans_health/models/immunization'
require 'lighthouse/veterans_health/serializers/immunization_serializer'
require 'common/client/errors'
require 'common/exceptions'
require 'unique_user_events'
module MyHealth
module V... |
0 | code_files/vets-api-private/modules/my_health/app/controllers/my_health | code_files/vets-api-private/modules/my_health/app/controllers/my_health/v2/vitals_controller.rb | # frozen_string_literal: true
require 'unified_health_data/service'
require 'unified_health_data/serializers/vital_serializer'
module MyHealth
module V2
class VitalsController < ApplicationController
include MyHealth::V2::Concerns::ErrorHandler
include SortableRecords
service_tag 'mhv-medical-... |
0 | code_files/vets-api-private/modules/my_health/app/controllers/my_health | code_files/vets-api-private/modules/my_health/app/controllers/my_health/v2/allergies_controller.rb | # frozen_string_literal: true
require 'unified_health_data/service'
require 'unified_health_data/serializers/allergy_serializer'
require 'unique_user_events'
module MyHealth
module V2
class AllergiesController < ApplicationController
include MyHealth::V2::Concerns::ErrorHandler
include SortableRecor... |
0 | code_files/vets-api-private/modules/my_health/app/controllers/my_health | code_files/vets-api-private/modules/my_health/app/controllers/my_health/v2/ccd_controller.rb | # frozen_string_literal: true
require 'unified_health_data/service'
module MyHealth
module V2
class CcdController < ApplicationController
include MyHealth::V2::Concerns::ErrorHandler
service_tag 'mhv-medical-records'
def download
file_format = params[:format] || 'xml'
binary_d... |
0 | code_files/vets-api-private/modules/my_health/app/controllers/my_health/v2 | code_files/vets-api-private/modules/my_health/app/controllers/my_health/v2/prescriptions/drug_sheets_controller.rb | # frozen_string_literal: true
module MyHealth
module V2
module Prescriptions
class DrugSheetsController < RxController
# Search for drug sheet documentation by NDC (National Drug Code).
# Uses Krames API to fetch drug information HTML content.
def search
ndc = params[:ndc]... |
0 | code_files/vets-api-private/modules/my_health/app/controllers/my_health/v2 | code_files/vets-api-private/modules/my_health/app/controllers/my_health/v2/concerns/error_handler.rb | # frozen_string_literal: true
module MyHealth
module V2
module Concerns
module ErrorHandler
extend ActiveSupport::Concern
private
# Main error handling orchestrator
# @param error [Exception] The error to handle
# @param resource_name [String] The name of the resou... |
0 | code_files/vets-api-private/modules/my_health/app/controllers | code_files/vets-api-private/modules/my_health/app/controllers/concerns/sortable_records.rb | # frozen_string_literal: true
module SortableRecords
extend ActiveSupport::Concern
private
# Sorts records based on their default_sort_by configuration
# @param records [Array] Array of Vets::Model objects with default_sort_by defined
# @param sort_param [String, nil] 'asc' for ascending, anything else for... |
0 | code_files/vets-api-private/modules/my_health/app/controllers/concerns | code_files/vets-api-private/modules/my_health/app/controllers/concerns/my_health/aal_client_concerns.rb | # frozen_string_literal: true
require 'mhv/aal/client'
module MyHealth
##
# Module to support AAL logging. By design, the methods here do not block execution of the request
# if there is an error. They simply log the error instead.
#
module AALClientConcerns
extend ActiveSupport::Concern
included d... |
0 | code_files/vets-api-private/modules/my_health/app/controllers/concerns | code_files/vets-api-private/modules/my_health/app/controllers/concerns/my_health/mhv_controller_concerns.rb | # frozen_string_literal: true
module MyHealth
module MHVControllerConcerns
extend ActiveSupport::Concern
included do
before_action :authorize
before_action :authenticate_client
end
protected
def authenticate_client
# The authenticate method checks whether the session is expir... |
0 | code_files/vets-api-private/modules/my_health/app/helpers | code_files/vets-api-private/modules/my_health/app/helpers/my_health/prescription_helper_v2.rb | # frozen_string_literal: true
require 'common/exceptions'
module MyHealth
module PrescriptionHelperV2
module Filtering
def collection_resource
case params[:refill_status]
when 'active'
client.get_active_rxs_with_details
else
client.get_all_rxs
end
... |
0 | code_files/vets-api-private/modules/my_health/app/helpers | code_files/vets-api-private/modules/my_health/app/helpers/my_health/routing.rb | # frozen_string_literal: true
module MyHealth
module Routing
extend ActiveSupport::Concern
include MyHealth::Engine.routes.url_helpers
included do
def default_url_options
Rails.application.routes.default_url_options
end
end
end
end
|
0 | code_files/vets-api-private/modules/my_health/app/helpers | code_files/vets-api-private/modules/my_health/app/helpers/my_health/facilities_helper.rb | # frozen_string_literal: true
require 'lighthouse/facilities/v1/client'
module MyHealth
module FacilitiesHelper
module_function
COMPLICATED_SYSTEMS = {
'528' => 'VA New York state health care (multiple facilities)',
'589' => 'VA Kansas and Missouri health care (multiple facilities)',
'620... |
0 | code_files/vets-api-private/modules/my_health/app/helpers | code_files/vets-api-private/modules/my_health/app/helpers/my_health/prescription_helper.rb | # frozen_string_literal: true
require 'common/exceptions'
module MyHealth
module PrescriptionHelper
module Filtering
def collection_resource
case params[:refill_status]
when nil
client.get_all_rxs
when 'active'
client.get_active_rxs_with_details
end
... |
0 | code_files/vets-api-private/modules/my_health/app/helpers | code_files/vets-api-private/modules/my_health/app/helpers/my_health/url_helper.rb | # frozen_string_literal: true
module MyHealth
class UrlHelper
# TODO: Should we do memoization to avoid creating a new instance of the engine's url_helpers?
include MyHealth::Routing
end
end
|
0 | code_files/vets-api-private/modules/my_health/app/helpers | code_files/vets-api-private/modules/my_health/app/helpers/my_health/rx_grouping_helper.rb | # frozen_string_literal: true
module MyHealth
module RxGroupingHelper
def group_prescriptions(prescriptions)
prescriptions ||= []
grouped_prescriptions = []
prescriptions.sort_by!(&:prescription_number)
while prescriptions.any?
prescription = prescriptions[0]
related_pr... |
0 | code_files/vets-api-private/modules/my_health/app/helpers | code_files/vets-api-private/modules/my_health/app/helpers/my_health/application_helper.rb | # frozen_string_literal: true
module MyHealth
module ApplicationHelper
end
end
|
0 | code_files/vets-api-private/modules/my_health/app/helpers | code_files/vets-api-private/modules/my_health/app/helpers/my_health/rx_grouping_helper_v2.rb | # frozen_string_literal: true
module MyHealth
module RxGroupingHelperV2
def group_prescriptions(prescriptions)
prescriptions ||= []
with_numbers, without_numbers = prescriptions.partition { |rx| valid_prescription_number?(rx) }
grouped = process_prescriptions_with_numbers(with_numbers)
gr... |
0 | code_files/vets-api-private/modules/my_health | code_files/vets-api-private/modules/my_health/bin/rails | #!/usr/bin/env ruby
# frozen_string_literal: true
# This command will automatically be run when you run "rails" with Rails gems
# installed from the root of your application.
ENGINE_ROOT = File.expand_path('..', __dir__)
ENGINE_PATH = File.expand_path('../lib/my_health/engine', __dir__)
APP_PATH = File.expand_path('.... |
0 | code_files/vets-api-private/modules/my_health | code_files/vets-api-private/modules/my_health/config/routes.rb | # frozen_string_literal: true
MyHealth::Engine.routes.draw do
namespace :v2 do
scope :medical_records do
resources :allergies, only: %i[index show], defaults: { format: :json }
resources :clinical_notes, only: %i[index show], defaults: { format: :json }
resources :conditions, only: %i[index sho... |
0 | code_files/vets-api-private/modules/my_health/config | code_files/vets-api-private/modules/my_health/config/initializers/fhir_client_patch.rb | # frozen_string_literal: true
# Combined monkeypatches for the Ruby FHIR client
# Includes:
# - Custom headers for search, read, and next_page
#
# Patched version: department-of-veterans-affairs/fhir_client (fork of 5.0.3)
module FHIR
##
# These patches allow FHIR calls to take custom headers. This is to allow us... |
0 | code_files/vets-api-private/modules/my_health/spec/serializer | code_files/vets-api-private/modules/my_health/spec/serializer/v1/all_triage_teams_serializer_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require_relative '../../factories/all_triage_teams'
describe MyHealth::V1::AllTriageTeamsSerializer, type: :serializer do
subject { serialize(triage_team, serializer_class: described_class) }
let(:triage_team) { build_stubbed(:all_triage_team) }
let(:data) {... |
0 | code_files/vets-api-private/modules/my_health/spec/serializer | code_files/vets-api-private/modules/my_health/spec/serializer/v1/messages_serializer_spec.rb | # frozen_string_literal: true
require 'rails_helper'
describe MyHealth::V1::MessagesSerializer, type: :serializer do
subject { serialize(message, serializer_class: described_class) }
let(:message) { build_stubbed(:message) }
let(:data) { JSON.parse(subject)['data'] }
let(:attributes) { data['attributes'] }
... |
0 | code_files/vets-api-private/modules/my_health/spec/serializer | code_files/vets-api-private/modules/my_health/spec/serializer/v1/category_serializer_spec.rb | # frozen_string_literal: true
require 'rails_helper'
describe MyHealth::V1::CategorySerializer, type: :serializer do
subject { serialize(category, serializer_class: described_class) }
let(:category) { build_stubbed(:category) }
let(:data) { JSON.parse(subject)['data'] }
let(:attributes) { data['attributes'] ... |
0 | code_files/vets-api-private/modules/my_health/spec/serializer | code_files/vets-api-private/modules/my_health/spec/serializer/v1/prescription_serializer_spec.rb | # frozen_string_literal: true
require 'rails_helper'
describe MyHealth::V1::PrescriptionSerializer, type: :serializer do
subject { serialize(prescription, serializer_class: described_class) }
let(:prescription) { build_stubbed(:prescription) }
let(:data) { JSON.parse(subject)['data'] }
let(:attributes) { dat... |
0 | code_files/vets-api-private/modules/my_health/spec/serializer | code_files/vets-api-private/modules/my_health/spec/serializer/v1/folder_serializer_spec.rb | # frozen_string_literal: true
require 'rails_helper'
describe MyHealth::V1::FolderSerializer, type: :serializer do
subject { serialize(folder, serializer_class: described_class) }
let(:folder) { build_stubbed(:folder) }
let(:data) { JSON.parse(subject)['data'] }
let(:attributes) { data['attributes'] }
let(... |
0 | code_files/vets-api-private/modules/my_health/spec/serializer | code_files/vets-api-private/modules/my_health/spec/serializer/v1/thread_serializer_spec.rb | # frozen_string_literal: true
require 'rails_helper'
describe MyHealth::V1::ThreadsSerializer, type: :serializer do
subject { serialize(thread, serializer_class: described_class) }
let(:thread) { build(:message_thread) }
let(:data) { JSON.parse(subject)['data'] }
let(:attributes) { data['attributes'] }
let... |
0 | code_files/vets-api-private/modules/my_health/spec/serializer | code_files/vets-api-private/modules/my_health/spec/serializer/v1/tracking_serializer_spec.rb | # frozen_string_literal: true
require 'rails_helper'
describe MyHealth::V1::TrackingSerializer, type: :serializer do
subject { serialize(tracking, serializer_class: described_class) }
let(:tracking) { build(:tracking) }
let(:data) { JSON.parse(subject)['data'] }
let(:attributes) { data['attributes'] }
let(... |
0 | code_files/vets-api-private/modules/my_health/spec/serializer | code_files/vets-api-private/modules/my_health/spec/serializer/v1/message_serializer_spec.rb | # frozen_string_literal: true
require 'rails_helper'
describe MyHealth::V1::MessageSerializer, type: :serializer do
subject { serialize(message, { serializer_class: described_class, include: [:attachments] }) }
let(:message) { build_stubbed(:message, :with_attachments) }
let(:data) { JSON.parse(subject)['data'... |
0 | code_files/vets-api-private/modules/my_health/spec/serializer | code_files/vets-api-private/modules/my_health/spec/serializer/v1/triage_teams_serializer_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require_relative '../../factories/all_triage_teams'
describe MyHealth::V1::TriageTeamSerializer, type: :serializer do
subject { serialize(triage_team, serializer_class: described_class) }
let(:triage_team) { build_stubbed(:triage_team) }
let(:data) { JSON.pa... |
0 | code_files/vets-api-private/modules/my_health/spec/serializer | code_files/vets-api-private/modules/my_health/spec/serializer/v1/messaging_preference_serializer_spec.rb | # frozen_string_literal: true
require 'rails_helper'
describe MyHealth::V1::MessagingPreferenceSerializer, type: :serializer do
subject { serialize(messaging_preference, serializer_class: described_class) }
let(:messaging_preference) { build_stubbed(:messaging_preference) }
let(:data) { JSON.parse(subject)['da... |
0 | code_files/vets-api-private/modules/my_health/spec/serializer | code_files/vets-api-private/modules/my_health/spec/serializer/v1/prescription_preference_serializer_spec.rb | # frozen_string_literal: true
require 'rails_helper'
describe MyHealth::V1::PrescriptionPreferenceSerializer, type: :serializer do
subject { serialize(prescription_preference, serializer_class: described_class) }
let(:prescription_preference) { build_stubbed(:prescription_preference) }
let(:data) { JSON.parse(... |
0 | code_files/vets-api-private/modules/my_health/spec/serializer | code_files/vets-api-private/modules/my_health/spec/serializer/v1/message_details_serializer_spec.rb | # frozen_string_literal: true
require 'rails_helper'
describe MyHealth::V1::MessageDetailsSerializer, type: :serializer do
subject { serialize(message, serializer_class: described_class) }
let(:message) { build(:message_thread_details, :with_attachments_for_thread, has_attachments: true) }
let(:data) { JSON.pa... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.